[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#393728: partman-md patch to allow crypto-on-raid



I wrote:
The attached patch changes partman-md to keep the settings of the md partitions when partman restarts which is enough to allow crypto-on-raid setups to work again, thus fixing #393728, #397872 and #398464.

In order to minimize the impact of the patch this close to the Etch release, I've implemented it so that most of it only applies when the md-device is used for crypto.

Tested with crypto-on-md and with regular fs-on-md.

Would it be ok to commit this?

And this time...with patch included :)

--
David Härdeman
Index: debian/changelog
===================================================================
--- debian/changelog	(revision 42618)
+++ debian/changelog	(working copy)
@@ -1,3 +1,11 @@
+partman-md (31) UNRELEASED; urgency=low
+
+  * Make sure that settings are not reset during partman init stage if
+    the device is used as a crypto volume.
+    Closes: #393728, #397872, #398464.
+
+ -- David Härdeman <david@hardeman.nu>  Tue, 14 Nov 2006 23:02:30 +0100
+
 partman-md (30) unstable; urgency=low
 
   [ Colin Watson ]
Index: init.d/md-devices
===================================================================
--- init.d/md-devices	(revision 42618)
+++ init.d/md-devices	(working copy)
@@ -27,7 +27,14 @@
 	   sed -e 's/^\(md.*\) : active \([[:alnum:]]*\).*/\1/'); do
 	NUMBER=$(echo ${i}|sed -e "s/^md//")
 	DEVICE="/var/lib/partman/devices/=dev=md=${NUMBER}"
-	mkdir -p ${DEVICE}
+	OLDDEVICE="/var/lib/partman/old_devices/=dev=md=${NUMBER}"
+
+	if [ -d "$OLDDEVICE" ]; then
+		mv "$OLDDEVICE" "$DEVICE"
+	else
+		mkdir -p ${DEVICE}
+	fi
+
 	cd ${DEVICE}
 	echo "/dev/md/${NUMBER}" > ${DEVICE}/device
 
@@ -54,6 +61,12 @@
 		fi
 	fi
 
+	if [ -e "$DEVICE/method" ] && [ "$(cat "$DEVICE/method")" = "crypto" ]; then
+		open_dialog DISK_UNCHANGED
+		close_dialog
+		continue
+	fi
+
 	open_dialog NEW_LABEL loop
 	close_dialog
 

Reply to: