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=b2f30a6f90424beb80822421ef46239120860751;hb=462afb6bf4b12814e77ebd618a03200cb77eb95f;hpb=3a6abc058679bab9acfc941de7999fe636148a6d diff --git a/etc/grml/fai/config/scripts/GRMLBASE/98-clean-chroot b/etc/grml/fai/config/scripts/GRMLBASE/98-clean-chroot index b2f30a6..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 @@ -195,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