From fdfb568fc5c822b1f093f49846ac582f87546f44 Mon Sep 17 00:00:00 2001 From: Tails developers Date: Tue, 10 Apr 2012 11:48:29 +0200 Subject: Improving robustness of fromiso cleanup process with is_mountpoint (Closes: #668100). --- scripts/live | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/scripts/live b/scripts/live index 322656e..371fac4 100755 --- a/scripts/live +++ b/scripts/live @@ -1595,8 +1595,14 @@ mountroot () # rid of it when running from RAM if [ -n "$FROMISO" ] && [ "${TORAM}" ] then - losetup -d /dev/loop0 - grep -q /live/fromiso /proc/mounts && umount /live/fromiso + losetup -d /dev/loop0 + + if is_mountpoint /live/fromiso + then + umount /live/fromiso + rmdir --ignore-fail-on-non-empty /live/fromiso \ + >/dev/null 2>&1 || true + fi fi if [ -n "${MODULETORAMFILE}" ] || [ -n "${PLAIN_ROOT}" ] -- cgit v1.2.3