[SCM] live-boot branch, tmp-persistent-custom, updated. debian/3.0_a25-1-30-g5fc05fe

Tails developers amnesia at boum.org
Thu Feb 16 14:58:06 UTC 2012


The following commit has been merged in the tmp-persistent-custom branch:
commit eddcb5be5a049864cc6188bced233ffe42214ef5
Author: Tails developers <amnesia at boum.org>
Date:   Wed Feb 15 12:10:06 2012 +0100

    Check if luks device is already open before trying to open it.

diff --git a/scripts/live-helpers b/scripts/live-helpers
index a5288fb..636e9b4 100644
--- a/scripts/live-helpers
+++ b/scripts/live-helpers
@@ -721,6 +721,21 @@ open_luks_device ()
 		opts="${opts} --readonly"
 	fi
 
+	if /sbin/cryptsetup status "${name}" >/dev/null 2>&1
+	then
+		re="^[[:space:]]*device:[[:space:]]*\([^[:space:]]*\)$"
+		opened_dev=$(cryptsetup status ${name} 2>/dev/null | grep "${re}" | sed "s|${re}|\1|")
+		if [ "${opened_dev}" = "${dev}" ]
+		then
+			luks_device="/dev/mapper/${name}"
+			echo ${luks_device}
+			return 0
+		else
+			log_warning_msg "Cannot open luks device ${dev} since ${opened_dev} already is opened with its name"
+			return 1
+		fi
+	fi
+
 	load_keymap
 
 	while true

-- 
live-boot



More information about the debian-live-changes mailing list