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:59:20 +0100 |
| commit | f4adc321a37ab2d885eca2355467215f9d43b96e (patch) | |
| tree | d7639d0ec7091f18f7e693f7099359dc1e27841a /scripts | |
| parent | 3c6ccf74fb3500571f2f35db5571135bebfd548f (diff) | |
| download | live-boot-f4adc321a37ab2d885eca2355467215f9d43b96e.tar.gz live-boot-f4adc321a37ab2d885eca2355467215f9d43b96e.zip | |
Added support for empty (initial) snapshots.
Diffstat (limited to 'scripts')
| -rwxr-xr-x | scripts/live | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/scripts/live b/scripts/live index 07deb55..18881af 100755 --- a/scripts/live +++ b/scripts/live @@ -1074,8 +1074,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 |
