+ # run it on our own, as updatebase is used at the wrong stage for our needs,
+ # see /etc/grml/fai/config/hooks/updatebase.GRMLBASE
+ # the apt-get update might return an error if there's for example
+ # a hashsum mismatch on Debian mirror sources, we might want to continue
+ # but should warn the user
+ if ! $ROOTCMD apt-get update ; then
+ echo "Warning: there was an error executing apt-get update, continuing anyway."
+ fi
+
+ # newer aptitude versions won't remove essential packages using
+ # 'aptitude -f -y install file-rc' anymore, therefore force it:
+ $ROOTCMD aptitude -o Aptitude::ProblemResolver::Keep-All-Tier=60000 -f -y install file-rc
+
+ if ! [ -x $target/usr/bin/aptitude ] ; then
+ $ROOTCMD apt-get -y install aptitude
+ fi
+
+ if [ -x $target/usr/bin/aptitude ] ; then
+ if $ROOTCMD aptitude --help | grep -q safe-upgrade ; then
+ APT_LISTCHANGES_FRONTEND=none APT_LISTBUGS_FRONTEND=none $ROOTCMD aptitude -y safe-upgrade
+ else
+ APT_LISTCHANGES_FRONTEND=none APT_LISTBUGS_FRONTEND=none $ROOTCMD aptitude -y upgrade
+ fi
+ else
+ APT_LISTCHANGES_FRONTEND=none APT_LISTBUGS_FRONTEND=none $ROOTCMD apt-get -y upgrade
+ fi
+
+ exit # make sure we don't continue behind the following "fi"
+fi
+
+# no softupdate but fresh installation
+echo "Action $FAI_ACTION of FAI (hooks/instsoft.GRMLBASE) via grml-live running"
+
+# make sure we have file-rc available before package_config/GRML* is being executed {{{
+# the apt-get update might return an error if there's for example
+# a hashsum mismatch on Debian mirror sources, we might want to continue
+# but should warn the user
+if ! $ROOTCMD apt-get update ; then
+ echo "Warning: there was an error executing apt-get update, continuing anyway."
+ echo "Warning: there was an error executing apt-get update, continuing anyway." >&2
+fi
+
+# newer aptitude versions won't remove essential packages using
+# 'aptitude -f -y install file-rc' anymore, therefore force it via:
+$ROOTCMD aptitude -o Aptitude::ProblemResolver::Keep-All-Tier=60000 -f -y install file-rc
+# }}}
+
+# get rid of insserv:
+if $ROOTCMD dpkg --list insserv 2>/dev/null | grep -q '^ii' ; then
+ $ROOTCMD apt-get -y --purge remove insserv
+fi