Do our best to make sure aptitude is installed in chroot
authorMichael Prokop <mika@grml.org>
Wed, 17 Sep 2014 20:38:44 +0000 (22:38 +0200)
committerMichael Prokop <mika@grml.org>
Wed, 17 Sep 2014 20:42:07 +0000 (22:42 +0200)
There seems to be a change in Debian (jessie) causing aptitude to
no longer be present in debootstrapped systems by default any
longer. By setting $FAI_DEBOOTSTRAP_OPTS accordingly we include
it in its default package selection though. If it still shouldn't
be present we explicitely try to install it through the
updatebase.GRMLBASE hook script.

etc/grml/fai/config/hooks/updatebase.GRMLBASE
grml-live

index b1c22e0..d19c4e2 100755 (executable)
@@ -72,5 +72,10 @@ fcopy -i -B -v -r /etc/apt
 # install Grml gpg key:
 $ROOTCMD apt-key add /etc/apt/grml.key
 
 # install Grml gpg key:
 $ROOTCMD apt-key add /etc/apt/grml.key
 
+if ! $ROOTCMD test -x /usr/bin/aptitude ; then
+  echo "aptitude binary is not available, installing to make sure further FAI actions continue to work"
+  $ROOTCMD apt-get -y install aptitude
+fi
+
 ## END OF FILE #################################################################
 # vim:ft=sh expandtab ai tw=80 tabstop=4 shiftwidth=2
 ## END OF FILE #################################################################
 # vim:ft=sh expandtab ai tw=80 tabstop=4 shiftwidth=2
index 90f6438..fc6292f 100755 (executable)
--- a/grml-live
+++ b/grml-live
@@ -635,7 +635,7 @@ if [ -z "$FAI_DEBOOTSTRAP" ] ; then
 fi
 
 if [ -z "$FAI_DEBOOTSTRAP_OPTS" ] ; then
 fi
 
 if [ -z "$FAI_DEBOOTSTRAP_OPTS" ] ; then
-  FAI_DEBOOTSTRAP_OPTS="--exclude=info,tasksel,tasksel-data --arch $ARCH"
+  FAI_DEBOOTSTRAP_OPTS="--exclude=info,tasksel,tasksel-data --include=aptitude --arch $ARCH"
 fi
 
 # create backup of old (not yet automatically generated) config file
 fi
 
 # create backup of old (not yet automatically generated) config file