diff -Nru grub-installer-1.27ubuntu8/debian/changelog grub-installer-1.27ubuntu8.1/debian/changelog --- grub-installer-1.27ubuntu8/debian/changelog 2008-05-02 11:52:56.000000000 -0500 +++ grub-installer-1.27ubuntu8.1/debian/changelog 2008-11-04 14:28:48.000000000 -0600 @@ -1,3 +1,11 @@ +grub-installer (1.27ubuntu8.1) hardy-proposed; urgency=low + + * Backport fixes for booting degraded software RAID (LP: #290885). + * grub-installer: determine if installing to a /dev/md RAID device, and + iteratively write grub to each disk in the array. + + -- Dustin Kirkland Tue, 04 Nov 2008 14:28:31 -0600 + grub-installer (1.27ubuntu8) hardy-proposed; urgency=low * Let grub automatically detect the boot device when using Wubi diff -Nru grub-installer-1.27ubuntu8/grub-installer grub-installer-1.27ubuntu8.1/grub-installer --- grub-installer-1.27ubuntu8/grub-installer 2008-05-02 11:44:23.000000000 -0500 +++ grub-installer-1.27ubuntu8.1/grub-installer 2008-11-04 11:55:18.000000000 -0600 @@ -310,6 +310,7 @@ # Identify partition table of the disk containing our boot partition bootfslabel=$(partmap $disc_offered || echo unknown) +found=0 # Check if the boot file system is on Serial ATA RAID frdev="" if type dmraid >/dev/null 2>&1; then @@ -318,10 +319,26 @@ frdev=/dev/mapper/$frdisk frbootpart=${disc_offered#$frdev} frgrubroot=$(($frbootpart - 1)) + frtype=sataraid + found=1 break fi done fi +# Check if the boot file system is on an mdadm device +if [ "$found" = "0" ] && type mdadm >/dev/null 2>&1; then + frdisk_list= + for frdisk in $(mdadm --detail "$bootfs_nodevfs" 2>/dev/null | \ + grep " active sync " 2>/dev/null | \ + sed "s/^.* active sync\s*//" 2>/dev/null \ + ); do + # Build a list of devices in the mirror + frdisk_list="$frdisk_list $frdisk" + frdev= + frtype="mdadm" + found=1 + done +fi info "Identified partition label for $bootfs: $bootfslabel" @@ -582,6 +599,19 @@ mkdir -p $ROOT/boot/grub +write_grub() { + info "Installing GRUB to $frdev; grub root is $disc_offered" + # TODO: Check for errors during this process! + TERM=linux $chroot $ROOT \ + grub --device-map=/dev/null >/var/log/grub-${frtype}.log 2>&1 /var/log/grub-dmraid.log 2>&1