[SCM] debian-live branch, master, updated. 1.130.1-3-11-g8e4bce9

Marco Amadori marco.amadori at gmail.com
Sat May 31 21:41:42 UTC 2008


The following commit has been merged in the master branch:
commit 8e4bce98581cdbad7c11183d246ee72d5afdb362
Author: Marco Amadori <marco.amadori at gmail.com>
Date:   Sat May 31 00:18:32 2008 +0200

    Fixes "live-snapshot on reboot could not find a writable '/tmp' or '/mnt'" bug.
    
    Signed-off-by: Marco Amadori <marco.amadori at gmail.com>

diff --git a/bin/live-snapshot b/bin/live-snapshot
index c50bcc0..b5a7fa4 100755
--- a/bin/live-snapshot
+++ b/bin/live-snapshot
@@ -2,7 +2,7 @@
 
 # live-snapshot - utility to manage Debian Live systems snapshots
 #
-#   This program mount a device (fallback to /tmpfs under /mnt/snapshot
+#   This program mount a device (fallback to /tmpfs under $MOUNTP
 #   and save the /live/cow (or a different dir) filesystem in it for reusing
 #   in another live-initramfs session. Look at manpage for more info.
 #
@@ -36,7 +36,11 @@ export USERNAME USERFULLNAME HOSTNAME
 PROGRAM="$(basename $0)"
 VERSION=0.0.2
 
-MOUNTP="/mnt/live-snapshot"
+# Needs to be available at run and reboot time
+SAFE_TMPDIR="/live"
+
+# Permits multiple runs
+MOUNTP="$(mktemp -d -p ${SAFE_TMPDIR} live-snapshot-mnt.XXXXXX)"
 SNAP_COW="/live/cow"
 SNAP_DEV=""
 DEST="${MOUNTP}/live-sn.cpio.gz"
@@ -289,10 +293,13 @@ Do_snapshot ()
 {
 	case "${SNAP_TYPE}" in
 		squashfs)
-			echo "./tmp/exclude_list" > /tmp/exclude_list
-			( cd "${SNAP_COW}" && find . -name '*.wh.*' >> /tmp/exclude_list )
-			mksquashfs "${SNAP_COW}" "${DEST}" -ef /tmp/exclude_list
-			rm /tmp/exclude_list
+			EXCLUDE_LIST="$(mktemp -p ${SAFE_TMPDIR} live-snapshot-exclude-list.XXXXXX)"
+			echo "./${EXCLUDE_LIST}" > "${EXCLUDE_LIST}"
+			cd "${SNAP_COW}"
+			find . -name '*.wh.*' >> "${EXCLUDE_LIST}"
+			cd "${OLDPWD}"
+			mksquashfs "${SNAP_COW}" "${DEST}" -ef "${EXCLUDE_LIST}"
+			rm -f "${EXCLUDE_LIST}"
 			;;
 
 		cpio)

-- 
debian-live



More information about the debian-live-changes mailing list