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

Bug#500079: Bug#497110: Missing root option for other detected Linux OS on dmraid



Frans Pop ha scritto:
> improvement before it can be merged. Before it gets merged I'd like to
> see a dual boot with Windows tested as well.

Unfortunately I haven't a dual boot with Windows for testing.


> As this whole section is Linux-specific, I don't really like it being
> outside the 'case' statement. If it remains outside, it should start
> with a test for host_os.

Why is Linux-specific ? I think the missing root option is for other OS on
dmraid in general, not only for Linux OS on dmraid


> Note that in other places we use 'dmraid -s -c'. Is there a real
> difference? Consistency is important!

-sa displays only active raid sets, I think you should use -sa also in other place.

> Why not just set tmp_part instead of tmp_satadevn in the first hunk? Then this
> whole hunk would not be needed.

Right, attached the new debdiff


Giuseppe.
diff -Nru grub-installer-1.34/debian/changelog grub-installer-1.35/debian/changelog
--- grub-installer-1.34/debian/changelog	2008-09-22 02:47:51.000000000 +0200
+++ grub-installer-1.35/debian/changelog	2008-09-25 14:12:22.000000000 +0200
@@ -1,3 +1,11 @@
+grub-installer (1.35) unstable; urgency=low
+
+  [Giuseppe Iuculano]
+  * Fix root detection in menu.lst for dmraid devices discovered by os-prober
+    (Closes: #500079)
+
+ -- Giuseppe Iuculano <giuseppe@iuculano.it>  Thu, 25 Sep 2008 14:10:33 +0200
+
 grub-installer (1.34) unstable; urgency=low
 
   [ Frans Pop ]
diff -Nru grub-installer-1.34/grub-installer grub-installer-1.35/grub-installer
--- grub-installer-1.34/grub-installer	2008-09-21 22:25:25.000000000 +0200
+++ grub-installer-1.35/grub-installer	2008-09-25 14:35:09.000000000 +0200
@@ -135,6 +135,21 @@
 	tmp_drive=$(grep -v '^#' $device_map | grep "$tmp_disk *$" | \
 		sed 's%.*\(([hf]d[0-9][a-g0-9,]*)\).*%\1%')
 
+	# If not found, check if it is a SATA RAID partition, and set tmp_drive and tmp_part
+	if type dmraid >/dev/null 2>&1 &&  [ -z "$tmp_drive" ]; then
+		for frdisk in $(dmraid -sa -c | grep -v "No RAID disks"); do
+			if echo "$(basename $tmp_disk)" | grep -q "$frdisk"; then
+				for raiddisk in  $(dmraid -r -c | grep -v "No RAID disks"); do
+					if [ $(dmraid -r -cr $raiddisk)=$frdisk ]; then
+						tmp_drive=$(grep -v '^#' $device_map | grep "$raiddisk *$" | \
+							sed 's%.*\(([hf]d[0-9][a-g0-9,]*)\).*%\1%')
+						tmp_part=$(basename $tmp_disk | sed "s%$frdisk%%")
+					fi
+				done
+			fi
+		done
+	fi
+	
 	# If not found, print an error message and exit
 	if [ -z "$tmp_drive" ]; then
 		echo "$1 does not have any corresponding BIOS drive." 1>&2

Attachment: signature.asc
Description: OpenPGP digital signature


Reply to: