Witam

W AC pojawiły się rc-scripts które obsługują szyfrowane partycje,
niestety jest małe (a może duże) ale. Obecne rozwiązanie nie przewiduje
sytuacji w której zaszyfrowany jest wolumen LVM lub MD oraz faktu iż na
takim LVM może być swap.

Osobiście mam sytuację w której szyfrowany jest wolumen LVM na którym
jest /home/users.

W załączniku patch zmieniający miejsce uruchamiania szyfrowania (oraz
swap), następuje to po uruchomieniu LVM/RAID. Podczas zamykania systemu
najpierw wykonywane jest wyłączenie szyfrowania a następnie wyłącznie
LVM/RAID.

Pozdrawiam.

-- 
Pepe
diff -urN rc-scripts-0.4.1.13/rc.d/rc.shutdown.orig rc-scripts-0.4.1.13/rc.d/rc.shutdown
--- rc-scripts-0.4.1.13/rc.d/rc.shutdown.orig	2007-11-26 18:49:46.000000000 +0100
+++ rc-scripts-0.4.1.13/rc.d/rc.shutdown	2007-11-27 22:29:40.000000000 +0100
@@ -96,6 +96,13 @@
 
 	run_cmd "Remounting root filesystem in ro mode" mount -n -o remount,ro /
 
+	if [ -f /etc/crypttab ] && ! is_empty_file /etc/crypttab; then
+		. /etc/rc.d/init.d/cryptsetup
+
+		show "Stopping disk encryption"
+		halt_crypto && ok || fail
+	fi
+
 	if is_yes "$EVMS_LVM" || [ -x /sbin/vgscan -a -x /sbin/vgchange ]; then
 		lvmversion=$(/sbin/vgchange --version 2>/dev/null | awk '{gsub("vgchange: Logical Volume Manager ",""); gsub("LVM version:     ",""); gsub(/\..*/,"");print $1; exit}')
 		if [ "$lvmversion" = "2" ] ; then
@@ -144,13 +151,6 @@
 	_rebootwhat="vserver"
 fi
 
-if [ -f /etc/crypttab ] && ! is_empty_file /etc/crypttab; then
-	. /etc/rc.d/init.d/cryptsetup
-
-	show "Stopping disk encryption"
-	halt_crypto && ok || fail
-fi
-
 if [ "$runlevel" = "0" ] ; then
 	show "The $_rebootwhat is halted"; ok
 	[ -f /fastboot ] && (show "On the next boot fsck will be skipped."; ok)
diff -urN rc-scripts-0.4.1.13/rc.d/rc.sysinit.orig rc-scripts-0.4.1.13/rc.d/rc.sysinit
--- rc-scripts-0.4.1.13/rc.d/rc.sysinit.orig	2007-11-26 18:49:46.000000000 +0100
+++ rc-scripts-0.4.1.13/rc.d/rc.sysinit	2007-11-27 22:28:26.000000000 +0100
@@ -268,22 +268,6 @@
 		TIME_SETUP_DELAYED=yes
 	fi
 
-	if [ -f /etc/crypttab ] && ! is_empty_file /etc/crypttab; then
-		# XXX might need modules dep
-		# Device mapper & related initialization
-		if ! fgrep -q device-mapper /proc/devices; then
-			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
-	fi
-
-	# Start up swapping
-	run_cmd "Activating swap partitions" swapon -a -e
-
 	# Initialize USB controllers
 	usb=0
 	if ! strstr "$cmdline" "nousb" && ! grep -q "/proc/bus/usb" /proc/mounts 2>/dev/null ; then
@@ -431,12 +415,6 @@
 			[ -r $file ] && restorecon $file >/dev/null 2>&1
 		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
-		show "Starting disk encryption using the RNG:"
-		init_crypto 1 && ok || fail
-	fi
 else
 	# Start logging console output since we have all /dev stuff setup
 	if [ "$RC_BOOTLOG" ]; then
@@ -726,6 +704,28 @@
 		fi
 	fi
 
+	if [ -f /etc/crypttab ] && ! is_empty_file /etc/crypttab; then
+		# XXX might need modules dep
+		# Device mapper & related initialization
+		if ! fgrep -q device-mapper /proc/devices; then
+			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
+	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
+		show "Starting disk encryption using the RNG:"
+		init_crypto 1 && ok || fail
+	fi
+
+	# Start up swapping
+	run_cmd "Activating swap partitions" swapon -a -e
+
 	_RUN_QUOTACHECK=0
 	# Check filesystems
 	if [ -z "$fastboot" ] && ! strstr "$cmdline" nofsck; then
_______________________________________________
pld-devel-pl mailing list
[email protected]
http://lists.pld-linux.org/mailman/listinfo/pld-devel-pl

Odpowiedź listem elektroniczym