diff options
| author | Marco Amadori <amadorim@vdavda.com> | 2008-09-16 11:35:01 +0200 |
|---|---|---|
| committer | Daniel Baumann <daniel@debian.org> | 2011-03-09 17:48:02 +0100 |
| commit | bc58aa7cd360609e2f52c5db14e87056a12937d8 (patch) | |
| tree | 26b35b079575eed59a50f321de6341970f17dd35 /scripts/live | |
| parent | 4a165b794d37cf495f2c4d0213caba38eb8622d7 (diff) | |
| download | live-boot-bc58aa7cd360609e2f52c5db14e87056a12937d8.tar.gz live-boot-bc58aa7cd360609e2f52c5db14e87056a12937d8.zip | |
Fixed try_snap() umounting on error.
Diffstat (limited to 'scripts/live')
| -rwxr-xr-x | scripts/live | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/scripts/live b/scripts/live index 9f16749..572b367 100755 --- a/scripts/live +++ b/scripts/live @@ -889,30 +889,35 @@ try_snap () if [ ! -z "${snapdata}" ] then + log_success_msg "found snapshot: ${snapdata}" snapdev="$(echo ${snapdata} | cut -f1 -d ' ')" snapback="$(echo ${snapdata} | cut -f2 -d ' ')" snapfile="$(echo ${snapdata} | cut -f3 -d ' ')" + RES="" + if echo "${snapfile}" | grep -qs '\(squashfs\|ext2\|ext3\|jffs2\)' then # squashfs, jffs2 or ext2/ext3 snapshot dev=$(get_backing_device "${snapback}/${snapfile}") - if ! do_snap_copy "${dev}" "${snap_mount}" "${snap_type}" - then - log_warning_msg "Impossible to include the ${snapfile} Snapshot" - return 1 - fi + do_snap_copy "${dev}" "${snap_mount}" "${snap_type}" + RES=$? else # cpio.gz snapshot - if ! (cd "${snap_mount}" && zcat "${snapback}/${snapfile}" | cpio --extract --preserve-modification-time --no-absolute-filenames --sparse --unconditional --make-directories > /dev/null 2>&1) - then - log_warning_msg "Impossible to include the ${snapfile} Snapshot" - return 1 - fi + cd "${snap_mount}" + zcat "${snapback}/${snapfile}" | cpio --extract --preserve-modification-time --no-absolute-filenames --sparse --unconditional --make-directories > /dev/null 2>&1 + RES=$? + cd "${OLDPWD}" fi umount "${snapback}" + + if [ "${RES}" != "0" ] + then + log_warning_msg "Impossible to include the ${snapfile} Snapshot file" + fi + else dev=$(find_cow_device "${snap_label}") |
