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

Re: dmraid 1.0.0.rc15-1



On Mon, Feb 16, 2009 at 02:16:48PM +0100, Frans Pop wrote:
> On Monday 16 February 2009, Colin Watson wrote:
> > The necessary improvements are attached, and I can commit these once
> > Giuseppe has uploaded this to unstable. I don't think we should
> > simplify it by throwing out the old output-comparison code yet, since
> > that would presumably cause problems for lenny-and-a-half.
> 
> It's not a problem for lenny-and-a-half, unless we call dmraid in the 
> chroot target as well as the D-I environment. The D-I environment has to 
> be consistent by definition [1].

Oh, good point, I was confused. Updated patch attached.

-- 
Colin Watson                                       [cjwatson@debian.org]
Index: arch/i386/grub-installer/grub-installer
===================================================================
--- arch/i386/grub-installer/grub-installer	(revision 57571)
+++ arch/i386/grub-installer/grub-installer	(working copy)
@@ -274,8 +274,8 @@
 
 # Check if the boot file system is on Serial ATA RAID
 frdev=""
-if type dmraid >/dev/null 2>&1; then
-	for frdisk in $(dmraid -s -c | grep -iv "No RAID disks"); do
+if type dmraid >/dev/null 2>&1 && dmraid -s -c >/dev/null 2>&1; then
+	for frdisk in $(dmraid -s -c); do
 		if echo "$disc_offered" | grep -q "/$frdisk[0-9]\+"; then
 			frdev=/dev/mapper/$frdisk
 			frbootpart=${disc_offered#$frdev}
Index: base-installer/library.sh
===================================================================
--- base-installer/library.sh	(revision 57571)
+++ base-installer/library.sh	(working copy)
@@ -141,7 +141,7 @@
 		fi
 
 		if type dmraid >/dev/null 2>&1; then
-			if [ "$(dmraid -s -c | grep -iv "No RAID disks")" ]; then
+			if dmraid -s -c >/dev/null 2>&1; then
 				apt-install dmraid
 			fi
 		fi
Index: hw-detect/disk-detect.sh
===================================================================
--- hw-detect/disk-detect.sh	(revision 57571)
+++ hw-detect/disk-detect.sh	(working copy)
@@ -177,7 +177,7 @@
 			module_probe dm-mod || true
 		fi
 
-		if [ "$(dmraid -c -s | tr A-Z a-z)" != "no raid disks" ]; then
+		if dmraid -c -s >/dev/null 2>&1; then
 			logger -t disk-detect "Serial ATA RAID disk(s) detected; enabling dmraid support"
 			# Activate devices
 			log-output -t disk-detect dmraid -ay
Index: os-prober/os-prober
===================================================================
--- os-prober/os-prober	(revision 57571)
+++ os-prober/os-prober	(working copy)
@@ -39,8 +39,9 @@
 		done
 
 		# Add Serial ATA RAID devices
-		if type dmraid >/dev/null 2>&1; then
-			for raidset in $(dmraid -sa -c | grep -iv "No RAID disks"); do
+		if type dmraid >/dev/null 2>&1 && \
+		   dmraid -s -c >/dev/null 2>&1; then
+			for raidset in $(dmraid -sa -c); do
 				for part in /dev/mapper/$raidset*[0-9]; do
 					echo "$part"
 				done
Index: partman/partman-base/init.d/parted
===================================================================
--- partman/partman-base/init.d/parted	(revision 57571)
+++ partman/partman-base/init.d/parted	(working copy)
@@ -86,7 +86,8 @@
 		fi
 
 		# Skip devices that are part of a dmraid device
-		if type dmraid >/dev/null 2>&1; then
+		if type dmraid >/dev/null 2>&1 && \
+		   dmraid -r -c >/dev/null 2>&1; then
 			if part_of_sataraid $device; then
 				continue
 			fi
@@ -109,7 +110,8 @@
 		printf "%s" "$model" >$dev/model
 
 		# Set the sataraid flag for dmraid arrays.
-		if type dmraid >/dev/null 2>&1; then
+		if type dmraid >/dev/null 2>&1 && \
+		   dmraid -s -c >/dev/null 2>&1; then
 			if dmraid -sa -c | grep -q $(basename $device); then
 				>$dev/sataraid
 			fi
Index: partman/partman-base/lib/base.sh
===================================================================
--- partman/partman-base/lib/base.sh	(revision 57571)
+++ partman/partman-base/lib/base.sh	(working copy)
@@ -832,8 +832,9 @@
 	    type=$(dm_table "$1")
 
 	    # First check for Serial ATA RAID devices
-	    if type dmraid >/dev/null 2>&1; then
-		for frdisk in $(dmraid -s -c | grep -iv "No RAID disks"); do
+	    if type dmraid >/dev/null 2>&1 && \
+	       dmraid -s -c >/dev/null 2>&1; then
+		for frdisk in $(dmraid -s -c); do
 			device=${1#/dev/mapper/}
 			case "$1" in
 			    /dev/mapper/$frdisk)

Reply to: