X-Git-Url: http://git.grml.org/?a=blobdiff_plain;f=scripts%2Flive;h=0e1b2f444550c5fdb37ee0ea926eb6bdcf104cc7;hb=refs%2Ftags%2Fdebian%2F2.0.5-1;hp=98129a5251ac313a98152fd17ad9c986e391ef3c;hpb=d1191d52c1d77dc689135fb01119fe93e01a3855;p=live-boot-grml.git diff --git a/scripts/live b/scripts/live index 98129a5..0e1b2f4 100755 --- a/scripts/live +++ b/scripts/live @@ -896,6 +896,8 @@ do_snap_copy () if [ -b "${fromdev}" ] then + log_success_msg "Copying snapshot ${fromdev} to ${todir}..." + # look for free mem if [ -n "${HOMEMOUNTED}" -a "${snap_type}" = "HOME" ] then @@ -933,9 +935,8 @@ do_snap_copy () return 0 else - return 1 - log_warning_msg "Unable to find the snapshot ${snap_type} medium" + return 1 fi } @@ -1012,8 +1013,16 @@ try_snap () cpioargs='--unconditional --make-directories' fi - cd "${snap_mount}" && zcat "${snapback}/${snapfile}" | $cpiopath $cpioargs --extract --preserve-modification-time --no-absolute-filenames --sparse 2>/dev/null - RES="$?" + if [ -s "${snapback}/${snapfile}" ] + then + BEFOREDIR="$(pwd)" + cd "${snap_mount}" && zcat "${snapback}/${snapfile}" | $cpiopath $cpioargs --extract --preserve-modification-time --no-absolute-filenames --sparse 2>/dev/null + RES="$?" + cd "${BEFOREDIR}" + else + log_warning_msg "${snapback}/${snapfile} is empty, adding it for sync on reboot." + RES="0" + fi if [ "${RES}" != "0" ] then @@ -1045,7 +1054,7 @@ try_snap () if ! do_snap_copy "${dev}" "${snap_mount}" "${snap_type}" then - log_warning_msg "Impossible to include the ${snap_type} Snapshot" + log_warning_msg "Impossible to include the ${snap_type} Snapshot (i)" return 1 else if [ -n "${snapfile}" ]