e6d82f826691794100d240295775df95d2e30f39
[grml-live.git] / etc / grml / fai / config / scripts / GRMLBASE / 95-package-information
1 #!/bin/sh
2 # Filename:      /etc/grml/fai/config/scripts/GRMLBASE/95-package-information
3 # Purpose:       store package information of chroot system
4 # Authors:       grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
5 # Bug-Reports:   see http://grml.org/bugs/
6 # License:       This file is licensed under the GPL v2 or any later version.
7 # Latest change: Sat Oct 13 17:48:38 CEST 2007 [mika]
8 ################################################################################
9
10 HOSTNAME=''
11 [ -r /etc/grml/grml-live.conf ] && . /etc/grml/grml-live.conf
12 [ -n "$HOSTNAME" ] || HOSTNAME=grml
13
14 if ! [ -d /var/log/fai/"$HOSTNAME"/last/ ] ; then
15    echo "Error: /var/log/fai/"$HOSTNAME"/last/ not available. Exiting.">&2
16    exit 1
17 fi
18
19 if [ -x $target/usr/bin/dpkg-query ] ; then
20    $ROOTCMD dpkg-query -W --showformat='${Package}\t${Installed-Size;10}\n' > \
21    /var/log/fai/$HOSTNAME/last/packages.size
22 fi
23
24 COLUMNS=200 $ROOTCMD dpkg --list > /var/log/fai/$HOSTNAME/last/dpkg.list
25 COLUMNS=200 $ROOTCMD dpkg --get-selections > /var/log/fai/$HOSTNAME/last/dpkg.selections
26
27 ## END OF FILE #################################################################