diff options
| author | Marco Amadori <amadorim@vdavda.com> | 2010-09-07 17:38:27 +0200 |
|---|---|---|
| committer | Daniel Baumann <daniel@debian.org> | 2011-03-09 17:54:16 +0100 |
| commit | 8705e0f269bf7e592c32d835ac6685612fb39ad3 (patch) | |
| tree | 20a231066cd8a1af02d1a2eed57d5fe00478368f /scripts | |
| parent | f5761134d90fafddba5a506475558409eb97c908 (diff) | |
| download | live-boot-8705e0f269bf7e592c32d835ac6685612fb39ad3.tar.gz live-boot-8705e0f269bf7e592c32d835ac6685612fb39ad3.zip | |
Fix snapshots' sync-strings usage (Closes: #591330).
Diffstat (limited to 'scripts')
| -rwxr-xr-x | scripts/live | 28 |
1 files changed, 25 insertions, 3 deletions
diff --git a/scripts/live b/scripts/live index 60a2c33..98129a5 100755 --- a/scripts/live +++ b/scripts/live @@ -965,6 +965,16 @@ try_snap () snapdata="${1}" snap_mount="${2}" snap_type="${3}" + snap_relpath="${4}" + + if [ -z "${snap_relpath}" ] + then + # root snapshot, default usage + snap_relpath="/" + else + # relative snapshot (actually used just for "/home" snapshots) + snap_mount="${2}${snap_relpath}" + fi if [ -n "${snapdata}" ] && [ ! -b "${snapdata}" ] then @@ -1045,11 +1055,11 @@ try_snap () fi fi else - log_warning_msg "Impossible to include the ${snap_type} Snapshot" + log_warning_msg "Impossible to include the ${snap_type} Snapshot (o)" return 1 fi - echo "export ${snap_type}SNAP="/cow${snap_mount#$rootmnt}":${snapdev}:${snapfile}" >> /etc/live.conf # for resync on reboot/halt + echo "export ${snap_type}SNAP=${snap_relpath}:${snapdev}:${snapfile}" >> snapshot.conf # for resync on reboot/halt return 0 } @@ -1387,7 +1397,7 @@ setup_unionfs () # Look for other snapshots to copy in try_snap "${root_snapdata}" "${rootmnt}" "ROOT" # This second type should be removed when snapshot grow smarter - try_snap "${home_snapdata}" "${rootmnt}/home" "HOME" + try_snap "${home_snapdata}" "${rootmnt}" "HOME" "/home" fi if [ -n "${SHOWMOUNTS}" ] @@ -1796,6 +1806,18 @@ mountroot () # when booting FAI, this simple workaround solves it ls /root/* >/dev/null 2>&1 + # copy snapshot configuration if exists + if [ -f snapshot.conf ] + then + log_begin_msg "Copying snapshot.conf to ${rootmnt}/etc/live/boot.d" + if [ ! -d "${rootmnt}/etc/live/boot.d" ] + then + mkdir -p "${rootmnt}/etc/live/boot.d" + fi + cp snapshot.conf "${rootmnt}/etc/live/boot.d/" + log_end_msg + fi + maybe_break live-bottom log_begin_msg "Running /scripts/live-bottom\n" |
