[SCM] live-boot branch, debian-next, updated. debian/3.0_a25-1-70-ga39a167

Daniel Baumann daniel at debian.org
Thu Apr 5 06:00:33 UTC 2012


The following commit has been merged in the debian-next branch:
commit b78990c495520b41ce163a55dee2d002ebba10de
Author: Tails developers <amnesia at boum.org>
Date:   Wed Feb 15 12:00:51 2012 +0100

    Add backwards compatibility for old labels: live-{rw,sn} and home-rw.
    
    For home-rw we create a live.persist file which make old volumes
    completely compatible with the custom mounts system.

diff --git a/scripts/live b/scripts/live
index 5e080f9..7f76f52 100755
--- a/scripts/live
+++ b/scripts/live
@@ -1001,7 +1001,7 @@ setup_unionfs ()
 
 		if echo ${PERSISTENT_METHOD} | grep -qe "\<overlay\>"
 		then
-			overlays="${root_overlay_label} ${custom_overlay_label}"
+			overlays="${root_overlay_label} ${old_root_overlay_label} ${old_home_overlay_label} ${custom_overlay_label}"
 		fi
 
 		if echo ${PERSISTENT_METHOD} | grep -qe "\<snapshot\>"
@@ -1017,7 +1017,7 @@ setup_unionfs ()
 		do
 			media="$(echo ${media} | tr ":" " ")"
 			case ${media} in
-				${root_snapshot_label}=*)
+				${root_snapshot_label}=*|${old_root_snapshot_label}=*)
 					if [ -z "${root_snapdata}" ]
 					then
 						root_snapdata="${media#*=}"
@@ -1032,13 +1032,18 @@ setup_unionfs ()
 						home_snapdata="${media#*=}"
 					fi
 					;;
-				${root_overlay_label}=*)
+				${root_overlay_label}=*|${old_root_overlay_label}=*)
 					if [ -z "${root_overlay_device}" ]
 					then
 						device="${media#*=}"
 						root_overlay_device="${device}"
 					fi
 					;;
+				${old_home_overlay_label}=*)
+					device="${media#*=}"
+					fix_home_rw_compatibility ${device}
+					overlay_devices="${overlay_devices} ${device}"
+					;;
 				${custom_overlay_label}=*)
 					device="${media#*=}"
 					overlay_devices="${overlay_devices} ${device}"
diff --git a/scripts/live-helpers b/scripts/live-helpers
index 76b94e0..abdfd64 100644
--- a/scripts/live-helpers
+++ b/scripts/live-helpers
@@ -16,8 +16,11 @@ else
 fi
 
 root_overlay_label="full-ov"
+old_root_overlay_label="live-rw"
+old_home_overlay_label="home-rw"
 custom_overlay_label="custom-ov"
 root_snapshot_label="live-sn"
+old_root_snapshot_label="live-sn"
 home_snapshot_label="home-sn"
 persistence_list="live.persist"
 
@@ -254,8 +257,11 @@ Arguments ()
 
 			persistent-subtext=*)
 				root_overlay_label="${root_overlay_label}-${ARGUMENT#persistent-subtext=}"
+				old_root_overlay_label="${old_root_overlay_label}-${ARGUMENT#persistent-subtext=}"
+				old_home_overlay_label="${old_home_overlay_label}-${ARGUMENT#persistent-subtext=}"
 				custom_overlay_label="${custom_overlay_label}-${ARGUMENT#persistent-subtext=}"
 				root_snapshot_label="${root_snapshot_label}-${ARGUMENT#persistent-subtext=}"
+				old_root_snapshot_label="${root_snapshot_label}-${ARGUMENT#persistent-subtext=}"
 				home_snapshot_label="${home_snapshot_label}-${ARGUMENT#persistent-subtext=}"
 				;;
 
@@ -1405,3 +1411,32 @@ do_custom_mounts () {
 		export PERSISTENCE_IS_ON
 	done < ${custom_mounts}
 }
+
+fix_home_rw_compatibility ()
+{
+	local device=${1}
+
+	if [ -n "${PERSISTENT_READONLY}" ]
+	then
+		return
+	fi
+
+	local backing="$(where_is_mounted ${device})"
+	if [ -z "${backing}" ]
+	then
+		backing="${rootmnt}/live/persistent/$(basename ${device})"
+		mkdir -p "${backing}"
+		local device_fstype="$(get_fstype ${device})"
+	local device_mount_opts="rw,noatime"
+	if ! mount -t "${device_fstype}" -o "${device_mount_opts}" "${device}" "${backing}" >/dev/null 2>&1
+	then
+		return
+	fi
+
+	local include_list="${backing}/${persistence_list}"
+	if [ ! -r "${include_list}" ]
+	then
+		echo "# home-rw backwards compatibility:
+. /home" > "${include_list}"
+	fi
+}

-- 
live-boot



More information about the debian-live-changes mailing list