summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorMarco Amadori <amadorim@vdavda.com>2008-09-16 16:16:08 +0200
committerDaniel Baumann <daniel@debian.org>2011-03-09 17:48:02 +0100
commitbee7730a411ff3222573092b1b3ff06707c4b698 (patch)
treebc04824ad58fdf44d6d41319d7c6ad046d3978a9 /scripts
parentddef67c34aa996a240abc3e3d191ee0a1744d900 (diff)
downloadlive-boot-bee7730a411ff3222573092b1b3ff06707c4b698.tar.gz
live-boot-bee7730a411ff3222573092b1b3ff06707c4b698.zip
Check for files and umount only if you can mount it first.
* Another clean-up and speed up in the ugly persistance/snapshot code.
Diffstat (limited to 'scripts')
-rw-r--r--scripts/live-helpers18
1 files changed, 10 insertions, 8 deletions
diff --git a/scripts/live-helpers b/scripts/live-helpers
index 0b9bd5f..19cc955 100644
--- a/scripts/live-helpers
+++ b/scripts/live-helpers
@@ -341,16 +341,18 @@ find_files ()
if is_supported_fs ${devfstype}
then
mkdir -p "${snap_backing}"
- try_mount "${devname}" "${snap_backing}" "ro" ${devfstype}
- for filename in ${filenames}
+ if try_mount "${devname}" "${snap_backing}" "ro" "${devfstype}"
+ then
+ for filename in ${filenames}
do
- if [ -f "${snap_backing}/${filename}" ]
- then
- echo "${devname} ${snap_backing} ${filename}"
- return 0
- fi
- done
+ if [ -f "${snap_backing}/${filename}" ]
+ then
+ echo "${devname} ${snap_backing} ${filename}"
+ return 0
+ fi
+ done
+ fi
umount ${snap_backing}
fi