[SCM] live-boot branch, debian-next, updated. debian/3.0_a29-1-15-g9790de3

Daniel Baumann daniel at debian.org
Tue Jun 5 17:13:28 UTC 2012


The following commit has been merged in the debian-next branch:
commit 9790de3c1e58cf0ce5fea3279330241e3f9d6b20
Author: Daniel Baumann <daniel at debian.org>
Date:   Tue Jun 5 19:13:24 2012 +0200

    Transforming persistence_excludes bottom script into normal live-boot script.

diff --git a/initramfs-tools/scripts/live-bottom/08persistence_excludes b/initramfs-tools/scripts/live-bottom/08persistence_excludes
deleted file mode 100755
index 04c685d..0000000
--- a/initramfs-tools/scripts/live-bottom/08persistence_excludes
+++ /dev/null
@@ -1,79 +0,0 @@
-#!/bin/sh
-
-# Persistence enhancer script
-# This script saves precious time on slow persistence devices/image files
-# and writes on flash based device.
-# a tmpfs on $PERSTMP is mounted and directories listed in
-# /etc/live-persistence.binds will be copied there and then bind mounted back.
-
-#set -e
-
-# initramfs-tools header
-
-PREREQ=""
-
-prereqs()
-{
-	echo "${PREREQ}"
-}
-
-case "${1}" in
-	prereqs)
-		prereqs
-		exit 0
-		;;
-esac
-
-# live-boot header
-
-if [ -z "${PERSISTENCE}" ] || [ -n "${NOPERSISTENCE}" ] || [ -z "${PERSISTENCE_IS_ON}" ] || [ ! -f /root/etc/live-persistence.binds ]
-then
-	exit 0
-fi
-
-# FIXME: stop hardcoding overloading of initramfs-tools functions
-. /scripts/functions
-. /lib/live/boot/initramfs-tools.sh
-
-# live-boot script
-
-dirs="$(sed -e '/^ *$/d' -e '/^#.*$/d' /root/etc/live-persistence.binds | tr '\n' '\0')"
-if [ -z "${dirs}" ]
-then
-	exit 0
-fi
-
-log_begin_msg "Moving persistence bind mounts"
-
-PERSTMP="/root/live/persistence-binds"
-CPIO="/bin/cpio"
-
-if [ ! -d "${PERSTMP}" ]
-then
-	mkdir -p "${PERSTMP}"
-fi
-
-mount -t tmpfs tmpfs "${PERSTMP}"
-
-for dir in $(echo "${dirs}" | tr '\0' '\n')
-do
-	if [ ! -e "/root/${dir}" ] && [ ! -L "/root/${dir}" ]
-	then
-		# directory do not exists, create it
-		mkdir -p "/root/${dir}"
-	elif [ ! -d "/root/${dir}" ]
-	then
-		# it is not a directory, skip it
-		break
-	fi
-
-	# Copy previous content if any
-	cd "/root/${dir}"
-	find . -print0 | ${CPIO} -pumd0 "${PERSTMP}/${dir}"
-	cd "${OLDPWD}"
-
-	# Bind mount it to origin
-	mount -o bind "${PERSTMP}/${dir}" "/root/${dir}"
-done
-
-log_end_msg
diff --git a/scripts/boot.sh b/scripts/boot.sh
index 94f5e18..4391a1e 100755
--- a/scripts/boot.sh
+++ b/scripts/boot.sh
@@ -635,6 +635,8 @@ mountroot ()
 		panic "A wrong rootfs was mounted."
 	fi
 
+	persistence_exclude
+
 	maybe_break live-bottom
 	log_begin_msg "Running /scripts/live-bottom\n"
 
diff --git a/scripts/boot/persistence-excludes.sh b/scripts/boot/persistence-excludes.sh
new file mode 100755
index 0000000..ee9521e
--- /dev/null
+++ b/scripts/boot/persistence-excludes.sh
@@ -0,0 +1,62 @@
+#!/bin/sh
+
+#set -e
+
+persistence_exclude ()
+{
+	# Persistence enhancer script
+	# This script saves precious time on slow persistence devices/image files
+	# and writes on flash based device.
+	# a tmpfs on $PERSTMP is mounted and directories listed in
+	# /etc/live-persistence.binds will be copied there and then bind mounted back.
+
+	if [ -z "${PERSISTENCE}" ] || [ -n "${NOPERSISTENCE}" ] || [ -z "${PERSISTENCE_IS_ON}" ] || [ ! -f /root/etc/live-persistence.binds ]
+	then
+		return
+	fi
+
+	# FIXME: stop hardcoding overloading of initramfs-tools functions
+	. /scripts/functions
+	. /lib/live/boot/initramfs-tools.sh
+
+	dirs="$(sed -e '/^ *$/d' -e '/^#.*$/d' /root/etc/live-persistence.binds | tr '\n' '\0')"
+	if [ -z "${dirs}" ]
+	then
+		return
+	fi
+
+	log_begin_msg "Moving persistence bind mounts"
+
+	PERSTMP="/root/live/persistence-binds"
+	CPIO="/bin/cpio"
+
+	if [ ! -d "${PERSTMP}" ]
+	then
+		mkdir -p "${PERSTMP}"
+	fi
+
+	mount -t tmpfs tmpfs "${PERSTMP}"
+
+	for dir in $(echo "${dirs}" | tr '\0' '\n')
+	do
+		if [ ! -e "/root/${dir}" ] && [ ! -L "/root/${dir}" ]
+		then
+			# directory do not exists, create it
+			mkdir -p "/root/${dir}"
+		elif [ ! -d "/root/${dir}" ]
+		then
+			# it is not a directory, skip it
+			break
+		fi
+
+		# Copy previous content if any
+		cd "/root/${dir}"
+		find . -print0 | ${CPIO} -pumd0 "${PERSTMP}/${dir}"
+		cd "${OLDPWD}"
+
+		# Bind mount it to origin
+		mount -o bind "${PERSTMP}/${dir}" "/root/${dir}"
+	done
+
+	log_end_msg
+}

-- 
live-boot



More information about the debian-live-changes mailing list