summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorMarco Amadori <amadorim@vdavda.com>2010-09-07 17:38:27 +0200
committerDaniel Baumann <daniel@debian.org>2011-03-09 17:59:20 +0100
commit089ae56f49ab73a926c28d96baee58986ade09a8 (patch)
tree1f18bfcc5d2f0cbb366459980806d51901c47074 /scripts
parentcab29efedefa0cac9b1d56e6f03ab8caf911bf2e (diff)
downloadlive-boot-089ae56f49ab73a926c28d96baee58986ade09a8.tar.gz
live-boot-089ae56f49ab73a926c28d96baee58986ade09a8.zip
Fix snapshots' sync-strings usage (Closes: #591330).
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/live28
1 files changed, 25 insertions, 3 deletions
diff --git a/scripts/live b/scripts/live
index d34279d..bef055a 100755
--- a/scripts/live
+++ b/scripts/live
@@ -1026,6 +1026,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
@@ -1106,11 +1116,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
}
@@ -1448,7 +1458,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}" ]
@@ -1857,6 +1867,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"