+# if hooks/updatebase.GRMLBASE fails for whatever reason
+# and can't skip instsoft.GRMLBASE we have to make sure
+# we exit here as well
+if [ -n "$BUILD_ONLY" ] ; then
+ "Exiting hooks/instsoft.GRMLBASE as BUILD_ONLY environment is set."
+ exit 0
+fi
+
+if [ "$FAI_ACTION" = "softupdate" ] ; then
+ echo "Action $FAI_ACTION of FAI (hooks/instsoft.GRMLBASE) via grml-live running"
+
+ if [ -r /etc/resolv.conf ] ; then
+ if [ -d $target/etc/resolvconf/run ] ; then # resolvconf without /run
+ # sanity check to avoid "input file is output file",
+ # see http://bts.grml.org/grml/issue984
+ if ! [ -L $target/etc/resolvconf/run/resolv.conf ] ; then
+ cat /etc/resolv.conf >> $target/etc/resolvconf/run/resolv.conf
+ else
+ echo "Error: /etc/resolvconf/run/resolv.conf in chroot should not be a symlink." >&2
+ echo " Looks like something is wrong, please fix manually." >&2
+ exit 1
+ fi
+ elif [ -L $target/etc/resolvconf/run ] ; then # resolvconf with /run
+ # /etc/resolvconf/run symlinks to /run/resolvconf
+ mkdir -p $target/run/resolvconf
+ cat /etc/resolv.conf >> $target/run/resolvconf/resolv.conf
+ else # no resolvconf installed in chroot
+ if ! [ -L $target/etc/resolv.conf ] ; then
+ cat /etc/resolv.conf >> $target/etc/resolv.conf
+ else
+ echo "Error: /etc/resolv.conf in chroot should not be a symlink (resolvconf not installed)." >&2
+ exit 1
+ fi
+ fi
+ fi
+
+ if [ -r $target/etc/policy-rc.d.conf ] ; then
+ sed -i "s/EXITSTATUS=.*/EXITSTATUS='101'/" $target/etc/policy-rc.d.conf
+ fi
+
+ # we definitely don't want to fail running fai sofupdate just
+ # because of some well known bugs:
+ [ -d $target/etc/apt/apt.conf.d ] || mkdir $target/etc/apt/apt.conf.d
+ cat > $target/etc/apt/apt.conf.d/10apt-listbugs << EOF
+// Check all packages whether they has critical bugs before they are installed.
+// If you don't like it, comment it out.
+//DPkg::Pre-Install-Pkgs {"/usr/sbin/apt-listbugs apt || exit 10"};
+//DPkg::Tools::Options::/usr/sbin/apt-listbugs "";
+//DPkg::Tools::Options::/usr/sbin/apt-listbugs::Version "2";
+EOF
+
+ # FAI softupdate executes upgrade only with the sources.list being
+ # present in the chroot - so let's do it on our own:
+ fcopy /etc/apt/sources.list
+
+ # when re-running grml-live with the -u option we do not want to use the
+ # sources.list config of the live system but grml-live's config instead,
+ # therefore temporarly move known files and restore them again later on
+ # through /etc/grml/fai/config/scripts/GRMLBASE/33-aptsetup:
+ if [ -r "$GRML_SOURCES_LIST" ] ; then
+ mv "$GRML_SOURCES_LIST" "${GRML_SOURCES_LIST}.unused"
+ fi