Improving robustness of fromiso cleanup process with is_mountpoint (Closes: #668100).
authorTails developers <amnesia@boum.org>
Tue, 10 Apr 2012 09:48:29 +0000 (11:48 +0200)
committerDaniel Baumann <daniel@debian.org>
Mon, 4 Jun 2012 15:39:49 +0000 (17:39 +0200)
scripts/live

index 322656e..371fac4 100755 (executable)
@@ -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}" ]