Package: cryptsetup
Version: 2:1.6.6-1
Tags: patch

Hi,

I'm booting on 4 encrypted devices, opened as LVM PVs, and use the LVM
mirroring feature for the LVs (including rootfs).

Trying to boot with a missing drive triggers the 'panic -r "ALERT!
${cryptsource} does not exist.  Dropping to a shell!"' error, although it is
possible to boot without this device. (Especially in my case where the missing
device had no LV segment at all anymore.)

I propose the attached patch to skip the device if we exit the shell without
fixing the problem, instead of looping in the panic shell.

Regards

-- 
Cédric
diff --git a/cryptroot-script b/cryptroot-script
index 414f882..6aea503 100644
--- a/cryptroot-script
+++ b/cryptroot-script
@@ -222,11 +222,16 @@ setup_mapping()
 	udev_settle
 
 	# We've given up, but we'll let the user fix matters if they can
-	while [ ! -e "${cryptsource}" ]; do
+	if [ ! -e "${cryptsource}" ]; then
+		echo "  ALERT! ${cryptsource} does not exist."
 		echo "	Check cryptopts=source= bootarg: cat /proc/cmdline"
 		echo "	or missing modules, devices: cat /proc/modules; ls /dev"
-		panic -r "ALERT!  ${cryptsource} does not exist.  Dropping to a shell!"
-	done
+		panic -r "Dropping to a shell. Will skip ${cryptsource} if you can't fix."
+	fi
+
+	if [ ! -e "${cryptsource}" ]; then
+		return 1
+	fi
 
 	# Prepare commands
 	cryptopen="/sbin/cryptsetup -T 1"

Reply via email to