instsoft.GRMLBASE: ensure that file-rc can be installed
[grml-live.git] / etc / grml / fai / config / hooks / instsoft.GRMLBASE
index 65da202..620c101 100755 (executable)
@@ -55,17 +55,17 @@ EOF
      $ROOTCMD ln -s /bin/true /usr/sbin/grub-probe
    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
+   # Update package lists (so they exist at all), so we actually can
+   # install software.
+   $ROOTCMD apt-get update
 
    if ! $ROOTCMD test -x /usr/bin/aptitude ; then
       $ROOTCMD apt-get -y install aptitude
    fi
 
-   # Update package lists (so they exist at all), so we actually can
-   # install software.
-   $ROOTCMD apt-get update
+   # 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 systemd-sysv-
 
    # make sure we can upgrade automatically,
    # even with unsigned repos, but only if user wants it
@@ -74,6 +74,10 @@ EOF
      APTITUDE_OPTS="${APTITUDE_OPTS:-} --allow-untrusted"
    fi
 
+   # make sure we don't fail when configuration files changed
+   APTGET_OPTS="${APTGET_OPTS:-} -o DPkg::Options::=--force-confdef -o DPkg::Options::=--force-confmiss -o DPkg::Options::=--force-confnew"
+   APTITUDE_OPTS="${APTITUDE_OPTS:-} -o DPkg::Options::=--force-confdef -o DPkg::Options::=--force-confmiss -o DPkg::Options::=--force-confnew"
+
    if $ROOTCMD test -x /usr/bin/aptitude ; then
       if $ROOTCMD aptitude --help | grep -q safe-upgrade ; then
          APT_LISTCHANGES_FRONTEND=none APT_LISTBUGS_FRONTEND=none $ROOTCMD aptitude -y $APTITUDE_OPTS safe-upgrade
@@ -116,14 +120,9 @@ 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
+$ROOTCMD aptitude -o Aptitude::ProblemResolver::Keep-All-Tier=60000 -f -y install file-rc systemd-sysv-
 # }}}
 
-# get rid of insserv:
-if $ROOTCMD dpkg --list insserv 2>/dev/null | grep -q '^ii' ; then
-   $ROOTCMD apt-get -y --purge remove insserv
-fi
-
 # we definitely don't want to fail running fai dirinstall just
 # because of some well known bugs:
 [ -d $target/etc/apt/apt.conf.d ] || mkdir $target/etc/apt/apt.conf.d