X-Git-Url: https://git.grml.org/?p=grml-live.git;a=blobdiff_plain;f=etc%2Fgrml%2Ffai%2Fconfig%2Fscripts%2FGRMLBASE%2F98-clean-chroot;h=1d18dd3ed58cc9b8c75f86b8b61b5744830e74e8;hp=f808c6558c38390a2d98a8547a58ff88260e8214;hb=462afb6bf4b12814e77ebd618a03200cb77eb95f;hpb=89cdf10f27a3ffcb6846ae5aa5e51cb9e5010738 diff --git a/etc/grml/fai/config/scripts/GRMLBASE/98-clean-chroot b/etc/grml/fai/config/scripts/GRMLBASE/98-clean-chroot index f808c65..1d18dd3 100755 --- a/etc/grml/fai/config/scripts/GRMLBASE/98-clean-chroot +++ b/etc/grml/fai/config/scripts/GRMLBASE/98-clean-chroot @@ -35,15 +35,20 @@ if $ROOTCMD dpkg-divert --list | grep -q '/usr/sbin/update-grub' ; then $ROOTCMD dpkg-divert --rename --remove /usr/sbin/update-grub fi +# revert dpkg-divert of hooks/instsoft.GRMLBASE, which is +# used to work around a grub-probe<->openvz bug +if $ROOTCMD dpkg-divert --list | grep -q '/usr/sbin/grub-probe' ; then + echo "Undoing dpkg-divert of grub-probe executable" + $ROOTCMD rm -f /usr/sbin/grub-probe + $ROOTCMD dpkg-divert --rename --remove /usr/sbin/grub-probe +fi + # revert udev workaround of hooks/updatebase.GRMLBASE if grep -q 'updatebase.GRMLBASE' ${target}/etc/udev/kernel-upgrade 2>/dev/null ; then echo "Removing /etc/udev/kernel-upgrade created by updatebase.GRMLBASE" $ROOTCMD rm -f /etc/udev/kernel-upgrade fi -echo "Updating package list" -$ROOTCMD apt-get update - echo "Cleaning apt places" $ROOTCMD apt-get check 2>/dev/null $ROOTCMD dpkg --clear-avail @@ -89,9 +94,10 @@ rm -rf --one-file-system $target/etc/sysconfig/* \ $target/etc/*group- $target/var/spool/postfix/maildrop/* \ $target/etc/*.old $target/etc/*.original \ $target/etc/lvm/.cache $target/etc/lvm/cache/.cache \ - $target/etc/lvm/backup/main $target/tmp/* \ + $target/etc/lvm/backup/* $target/tmp/* \ $target/var/tmp/* $target/var/backups/* \ - $target/var/lib/mysql $target/var/log/lilo_log.* $target/core* + $target/var/lib/mysql $target/var/log/lilo_log.* $target/core* \ + $target/etc/blkid.tab # remove only "temporary" or saved files in the given directories nuke(){ @@ -194,10 +200,18 @@ else # DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN EOF fi + rm -f ${target}/etc/resolvconf/resolv.conf.d/original rm -f ${target}/etc/resolv.conf $ROOTCMD ln -s /etc/resolvconf/run/resolv.conf /etc/resolv.conf fi +# make sure we don't leak any mdadm configurations +# that are present on the build system to the live system +if [ -f "${target}/etc/mdadm/mdadm.conf" ] ; then + echo "Found /etc/mdadm/mdadm.conf, getting rid of any possible enabled ARRAY settings." + sed -i '/^ARRAY/d' "${target}/etc/mdadm/mdadm.conf" +fi + if ! $ROOTCMD test -x /usr/bin/updatedb ; then echo "Warning: updatedb not installed" else