From: Marco Amadori Date: Mon, 13 Sep 2010 15:15:29 +0000 (+0200) Subject: Added support for empty (initial) snapshots. X-Git-Tag: debian/2.0.5-1~2 X-Git-Url: http://git.grml.org/?p=live-boot-grml.git;a=commitdiff_plain;h=5207256fc43b965b1816f2d874ea227b039321d0 Added support for empty (initial) snapshots. Signed-off-by: Marco Amadori --- diff --git a/scripts/live b/scripts/live index 169ffb4..0e1b2f4 100755 --- a/scripts/live +++ b/scripts/live @@ -1013,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