Store package list on ISO. [Closes: issue779] [Closes: issue749]
authorMichael Prokop <mika@grml.org>
Mon, 1 Feb 2010 20:07:37 +0000 (21:07 +0100)
committerMichael Prokop <mika@grml.org>
Mon, 1 Feb 2010 20:09:06 +0000 (21:09 +0100)
Thanks to azhag and dilex for the idea.

grml-live

index 0240972..6eadde8 100755 (executable)
--- a/grml-live
+++ b/grml-live
@@ -826,6 +826,15 @@ if [ "$ARCH" = i386 ] || [ "$ARCH" = amd64 ] ; then
          sed -i "/%GRUB_LEGACY%/d" "$BUILD_OUTPUT"/boot/grub/grub.cfg
       fi
 
+      DPKG_LIST="/var/log/fai/$HOSTNAME/last/dpkg.list" # the dpkg --list output of the chroot
+      if ! [ -r "$DPKG_LIST" ] ; then
+         ewarn "$DPKG_LIST could not be read, ignoring to store package information on ISO therefore."
+      else
+         einfo "Storing package list information as /GRML/${GRML_NAME}-packages.txt on ISO."
+         cp "$DPKG_LIST" "${BUILD_OUTPUT}/GRML/${GRML_NAME}-packages.txt"
+         eend $?
+      fi
+
       # autostart for Windows:
       if [ -d "${TEMPLATE_DIRECTORY}/windows/autostart/" ] ; then
          cp ${TEMPLATE_DIRECTORY}/windows/autostart/* "$BUILD_OUTPUT"/