[SCM] live-helper branch, debian, updated. debian/2.0_a3-1-9-gb55ff9e
Daniel Baumann
daniel at debian.org
Wed Dec 23 21:33:46 UTC 2009
The following commit has been merged in the debian branch:
commit b55ff9e7353ff3c77b9ea9b896d6a916e6cac0cf
Author: Daniel Baumann <daniel at debian.org>
Date: Wed Dec 23 22:27:18 2009 +0100
Making unmount routines a bit more robust.
diff --git a/functions/exit.sh b/functions/exit.sh
index 928fd6e..f29dbf7 100755
--- a/functions/exit.sh
+++ b/functions/exit.sh
@@ -20,10 +20,19 @@ Exit ()
# Always exit true in case we are not able to unmount
# (e.g. due to running processes in chroot from user customizations)
Echo_message "Begin unmounting filesystems..."
- for DIRECTORY in $(awk -v dir="${PWD}/chroot/" '$2 ~ dir { print $2 }' /proc/mounts | sort -r)
- do
- umount ${DIRECTORY} > /dev/null 2>&1 || true
- done
+
+ if [ -e /proc/mounts ]
+ then
+ for DIRECTORY in $(awk -v dir="${PWD}/chroot/" '$2 ~ dir { print $2 }' /proc/mounts | sort -r)
+ do
+ umount ${DIRECTORY} > /dev/null 2>&1 || true
+ done
+ else
+ for DIRECTORY in /dev/pts /dev /proc /selinux /sys
+ do
+ umount -f chroot/${DIRECTORY} > /dev/null 2>&1 || true
+ done
+ fi
return ${VALUE}
}
diff --git a/helpers/lh_chroot_devpts b/helpers/lh_chroot_devpts
index 75edab2..9248595 100755
--- a/helpers/lh_chroot_devpts
+++ b/helpers/lh_chroot_devpts
@@ -67,9 +67,11 @@ case "${1}" in
# Unmounting /dev/pts
if [ "${LH_USE_FAKEROOT}" != "true" ]
then
- if Find_files chroot/dev/pts/*
+ if grep -qs "$(pwd)/chroot/dev/pts" /proc/mounts || Find_files chroot/dev/pts/*
then
${LH_ROOT_COMMAND} umount chroot/dev/pts
+ else
+ ${LH_ROOT_COMMAND} umount -f chroot/dev/pts > /dev/null 2>&1 || true
fi
fi
--
live-helper
More information about the debian-live-changes
mailing list