summaryrefslogtreecommitdiff
path: root/scripts/live
diff options
context:
space:
mode:
authorMarco Amadori <amadorim@vdavda.com>2010-09-13 17:15:29 +0200
committerDaniel Baumann <daniel@debian.org>2011-03-09 17:54:18 +0100
commit785c1aae7102b05a12022698c86f55475a468324 (patch)
tree20f2de5dca06a8ea975490947ce3fd899aa152dd /scripts/live
parentba37cb93f56a3a2ddd9cf540b8bcb5b638eed2ed (diff)
downloadlive-boot-785c1aae7102b05a12022698c86f55475a468324.tar.gz
live-boot-785c1aae7102b05a12022698c86f55475a468324.zip
Added support for empty (initial) snapshots.
Diffstat (limited to 'scripts/live')
-rwxr-xr-xscripts/live12
1 files changed, 10 insertions, 2 deletions
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