X-Git-Url: http://git.grml.org/?a=blobdiff_plain;f=scripts%2Flive;h=f9e4fe269c0154e4ffe70c29e4d8c50ea8b35227;hb=bdb01ba302ac1c351f62d95f123b722a5281be15;hp=9f16749d332b41e2cf0f30204e35dc14a3802544;hpb=ab57eab5d57bd97f5bc6aa5bdaab2ca442fab042;p=live-boot-grml.git diff --git a/scripts/live b/scripts/live index 9f16749..f9e4fe2 100755 --- a/scripts/live +++ b/scripts/live @@ -889,35 +889,46 @@ 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) + cd "${snap_mount}" + zcat "${snapback}/${snapfile}" | /bin/cpio --extract --preserve-modification-time --no-absolute-filenames --sparse --unconditional --make-directories > /dev/null 2>&1 + RES=$? + if [ "${RES}" != "0" ] then - log_warning_msg "Impossible to include the ${snapfile} Snapshot" - return 1 + log_warning_msg "failure to \"zcat ${snapback}/${snapfile} | /bin/cpio --extract --preserve-modification-time --no-absolute-filenames --sparse --unconditional --make-directories\"" fi + cd "${OLDPWD}" + fi + + umount "${snapback}" || log_warning_msg "failure to \"umount ${snapback}\"" + + if [ "${RES}" != "0" ] + then + log_warning_msg "Impossible to include the ${snapfile} Snapshot file" fi - umount "${snapback}" else + # Try to find if it could be a snapshot partition dev=$(find_cow_device "${snap_label}") - if [ -b ${dev} ] + if [ -b "${dev}" ] then + log_success_msg "found snapshot device on ${dev}" if echo "${dev}" | grep -qs loop then # strange things happens, user confused?