diff options
| author | Marco Amadori <amadorim@vdavda.com> | 2010-09-13 17:15:29 +0200 |
|---|---|---|
| committer | Daniel Baumann <daniel@debian.org> | 2011-03-09 17:54:18 +0100 |
| commit | 785c1aae7102b05a12022698c86f55475a468324 (patch) | |
| tree | 20f2de5dca06a8ea975490947ce3fd899aa152dd /scripts/live | |
| parent | ba37cb93f56a3a2ddd9cf540b8bcb5b638eed2ed (diff) | |
| download | live-boot-785c1aae7102b05a12022698c86f55475a468324.tar.gz live-boot-785c1aae7102b05a12022698c86f55475a468324.zip | |
Added support for empty (initial) snapshots.
Diffstat (limited to 'scripts/live')
| -rwxr-xr-x | scripts/live | 12 |
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 |
