Re: dmraid 1.0.0.rc15-1
On Mon, Feb 16, 2009 at 01:41:37AM +0100, Frans Pop wrote:
> On Monday 16 February 2009, Giuseppe Iuculano wrote:
> > Relevant changes for d-i:
> > - Build dmraid shared library for both standard and udeb packages. It
> > will likely be used in the future by udev.
> > - Create new packages, libdmraid-dev, libdmraid1.0.0.rc15,
> > libdmraid1.0.0.rc15-udeb respectively
> > - Install /sbin/dmraid-activate[1] also in dmraid-udeb package
> > - debian/patches/10_exit_code.patch: Fix exit-code[2] for "No RAID
> > disks" and "no block devices found" errors (LP: #300825)
> >
> > Is all of that ok?
>
> Are any changes in D-I needed?
>
> At least the last change [1] means that we can now simplify and improve
> the code. Can you provide patches for that? It would also close #433579.
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.
--
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,7 +274,7 @@
# Check if the boot file system is on Serial ATA RAID
frdev=""
-if type dmraid >/dev/null 2>&1; then
+if type dmraid >/dev/null 2>&1 && dmraid -s -c >/dev/null 2>&1; then
for frdisk in $(dmraid -s -c | grep -iv "No RAID disks"); do
if echo "$disc_offered" | grep -q "/$frdisk[0-9]\+"; then
frdev=/dev/mapper/$frdisk
Index: base-installer/library.sh
===================================================================
--- base-installer/library.sh (revision 57571)
+++ base-installer/library.sh (working copy)
@@ -141,7 +141,8 @@
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 && \
+ [ "$(dmraid -s -c | grep -iv "No RAID disks")" ]; 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,8 @@
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 && \
+ [ "$(dmraid -c -s | tr A-Z a-z)" != "no raid disks" ]; 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,7 +39,8 @@
done
# Add Serial ATA RAID devices
- if type dmraid >/dev/null 2>&1; then
+ if type dmraid >/dev/null 2>&1 && \
+ dmraid -s -c >/dev/null 2>&1; then
for raidset in $(dmraid -sa -c | grep -iv "No RAID disks"); do
for part in /dev/mapper/$raidset*[0-9]; do
echo "$part"
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,7 +832,8 @@
type=$(dm_table "$1")
# First check for Serial ATA RAID devices
- if type dmraid >/dev/null 2>&1; then
+ if type dmraid >/dev/null 2>&1 && \
+ dmraid -s -c >/dev/null 2>&1; then
for frdisk in $(dmraid -s -c | grep -iv "No RAID disks"); do
device=${1#/dev/mapper/}
case "$1" in
Reply to: