X-Git-Url: https://git.grml.org/?p=grml-debootstrap.git;a=blobdiff_plain;f=chroot-script;h=bbd834f6b819b8d17a3502b269e54daf89f0c70c;hp=bb770a515841e34fd75154bbf85aef8f08eb47ce;hb=d0bc58a42b08cbf02501294ff85ee126ae69a7a4;hpb=0fda360ab5986be65e7ef7354ad92b9ead7e5d85 diff --git a/chroot-script b/chroot-script index bb770a5..bbd834f 100755 --- a/chroot-script +++ b/chroot-script @@ -131,7 +131,12 @@ EOF # remove now useless apt cache {{{ remove_apt_cache() { - apt-get clean + if [ "$RM_APTCACHE" = 'yes' ] ; then + echo "Cleaning apt cache." + apt-get clean + else + echo "Not cleaning apt cache as \$RM_APTCACHE is unset." + fi } # }}} @@ -414,15 +419,14 @@ services() { } # }}} -# unmount all filesystems in chroot, make sure nothing is left {{{ +# unmount /proc and make sure nothing is left {{{ finalize() { # make sure we don't leave any sensible data rm -f /etc/debootstrap/variables + [ -n "$POLICYRCD" ] && rm -f /usr/sbin/policy-rc.d - umount -a 1>/dev/null 2>/dev/null || true - umount /proc 1>/dev/null 2>/dev/null || true - umount /proc 1>/dev/null 2>/dev/null || true - umount -a 1>/dev/null 2>/dev/null || true + + umount /proc >/dev/null 2>/dev/null || true } # }}}