SVN: rc-scripts/trunk/rc.d/rc.sysinit

glen glen at pld-linux.org
Sun Nov 7 20:54:27 CET 2010


Author: glen
Date: Sun Nov  7 20:54:27 2010
New Revision: 11900

Modified:
   rc-scripts/trunk/rc.d/rc.sysinit
Log:
- init crypt mounts also after lvm has been run

Modified: rc-scripts/trunk/rc.d/rc.sysinit
==============================================================================
--- rc-scripts/trunk/rc.d/rc.sysinit	(original)
+++ rc-scripts/trunk/rc.d/rc.sysinit	Sun Nov  7 20:54:27 2010
@@ -342,10 +342,11 @@
 			modprobe dm-mod
 		fi
 
-		# but should do this before swapon?
 		. /etc/rc.d/init.d/cryptsetup
 		show "Starting disk encryption"
-		init_crypto 0 && ok || fail
+		init_crypto 0
+		delay_cryptsetup=$?
+		[ $delay_cryptsetup = 0 ] && ok || fail
 	fi
 
 	# Start up swapping
@@ -461,10 +462,11 @@
 		done
 	fi
 
-	if [ -f /etc/crypttab ] && ! is_empty_file /etc/crypttab; then
-		# XXX, this must be probably done after random is initialized from /var/run/random-seed
+	if [ "$delay_cryptsetup" != 0 ]; then
 		show "Starting disk encryption using the RNG"
-		init_crypto 1 && ok || fail
+		init_crypto 1
+		delay_cryptsetup=$?
+		[ $delay_cryptsetup = 0 ] && ok || fail
 	fi
 else
 	# Start logging console output since we have all /dev stuff setup
@@ -669,6 +671,13 @@
 		fi
 	fi
 
+	if [ "$delay_cryptsetup" != 0 ]; then
+		show "Starting disk encryption"
+		init_crypto 1
+		delay_cryptsetup=$?
+		[ $delay_cryptsetup = 0 ] && ok || fail
+	fi
+
 	# Add raid devices
 	if [ -x /sbin/mdadm -a -f /etc/mdadm.conf ] || [ -f /etc/raidtab ]; then
 		modprobe -s md >/dev/null 2>&1


More information about the pld-cvs-commit mailing list