[arch-commits] CVS update of core/base/initscripts (rc.sysinit)

Thomas Baechler thomas at archlinux.org
Fri Oct 19 22:22:53 UTC 2007


    Date: Friday, October 19, 2007 @ 18:22:53
  Author: thomas
    Path: /home/cvs-core/core/base/initscripts

Modified: rc.sysinit (1.113 -> 1.114)

added (barely tested) improvement of ASK keyword in crypttab


------------+
 rc.sysinit |   17 ++++++++++-------
 1 file changed, 10 insertions(+), 7 deletions(-)


Index: core/base/initscripts/rc.sysinit
diff -u core/base/initscripts/rc.sysinit:1.113 core/base/initscripts/rc.sysinit:1.114
--- core/base/initscripts/rc.sysinit:1.113	Fri Oct 19 03:02:14 2007
+++ core/base/initscripts/rc.sysinit	Fri Oct 19 18:22:52 2007
@@ -145,6 +145,8 @@
 			shift 3
 			copts="$*"
 			stat_append "${cname}.."
+			# For some fun reason, the parameter ordering varies for
+			# LUKS and non-LUKS devices.  Joy.
 			if [ "${cpass}" = "SWAP" ]; then
 				# This is DANGEROUS! The only possible safety check
 				# is to not proceed in case we find a LUKS device
@@ -158,15 +160,16 @@
 						mkswap -L $cname /dev/mapper/$cname >/dev/null
 					fi
 				fi
-			elif [ "${cpass:0:1}" != "/" ]; then
-				# For some fun reason, the parameter ordering varies for
-				# LUKS and non-LUKS devices.  Joy.
-				if [ "${cpass}" = "ASK" ]; then
-					echo -ne "\nEnter passphrase for '${cname}' volume: "
-					read -r -s cpass < /dev/console
-				fi
+			elif [ "${cpass}" = "ASK" ]; then
+				echo -e "\nOpening '${cname}' volume:"
 
 				if $CS isLuks $csrc 2>/dev/null; then
+					$CS $copts luksOpen $csrc $cname < /dev/console
+				else
+					$CS $copts create $cname $csrc < /dev/console
+				fi
+			elif [ "${cpass:0:1}" != "/" ]; then
+				if $CS isLuks $csrc 2>/dev/null; then
 					echo "$cpass" | $CS $copts luksOpen $csrc $cname >/dev/null
 				else
 					echo "$cpass" | $CS $copts create $cname $csrc >/dev/null




More information about the arch-commits mailing list