diff options
author | Harald Hoyer <harald@redhat.com> | 2009-09-15 09:00:13 +0200 |
---|---|---|
committer | Harald Hoyer <harald@redhat.com> | 2009-09-15 15:00:18 +0200 |
commit | 2f02ae9d45b263eecf4348986a8e67057dbad126 (patch) | |
tree | 0a71665cd7a5e416b436694036742d8b40e561c4 /test/TEST-12-RAID-DEG | |
parent | 11fcc8c8f941edb438ad48ef7deb6cbf8d87d530 (diff) | |
download | dracut-2f02ae9d45b263eecf4348986a8e67057dbad126.tar.gz dracut-2f02ae9d45b263eecf4348986a8e67057dbad126.tar.bz2 dracut-2f02ae9d45b263eecf4348986a8e67057dbad126.zip |
mdraid: add rd_NO_MDADMCONF --mdadmconf --nomdadmconf
Copy /etc/mdadm.conf to initramfs (even for non-hostonly) if
mdadmconf="yes" is set in dracut.conf or --mdadmconf is specified on the
dracut command line.
This was done, because there seems _no_ sane way to autoassemble md raid
arrays.
also moved rd_NO_MD to an udev ENV
Diffstat (limited to 'test/TEST-12-RAID-DEG')
-rwxr-xr-x | test/TEST-12-RAID-DEG/create-root.sh | 2 | ||||
-rwxr-xr-x | test/TEST-12-RAID-DEG/test.sh | 13 |
2 files changed, 11 insertions, 4 deletions
diff --git a/test/TEST-12-RAID-DEG/create-root.sh b/test/TEST-12-RAID-DEG/create-root.sh index bf944187..b21a0602 100755 --- a/test/TEST-12-RAID-DEG/create-root.sh +++ b/test/TEST-12-RAID-DEG/create-root.sh @@ -30,7 +30,9 @@ cp -a -t /sysroot /source/* && \ umount /sysroot && \ lvm lvchange -a n /dev/dracut/root && \ cryptsetup luksClose /dev/mapper/dracut_crypt_test && \ +{ mdadm -W /dev/md0 || : ;} && \ mdadm /dev/md0 --fail /dev/sda2 --remove /dev/sda2 && \ +{ mdadm -W /dev/md0 || : ;} && \ { /sbin/mdadm --detail --export /dev/md0 > /tmp/mduuid ; . /tmp/mduuid; diff --git a/test/TEST-12-RAID-DEG/test.sh b/test/TEST-12-RAID-DEG/test.sh index 94ef50b5..25c96341 100755 --- a/test/TEST-12-RAID-DEG/test.sh +++ b/test/TEST-12-RAID-DEG/test.sh @@ -27,6 +27,8 @@ test_run() { echo "MD_UUID=$MD_UUID" client_run || return 1 + + client_run rd_NO_MDADMCONF || return 1 client_run rd_NO_LVM && return 1 @@ -36,13 +38,13 @@ test_run() { client_run rd_LVM_VG=dummy1 rd_LVM_VG=dracut rd_LVM_VG=dummy2 || return 1 - client_run rd_MD_UUID=failme && return 1 + client_run rd_MD_UUID=failme rd_NO_MDADMCONF && return 1 client_run rd_NO_MD && return 1 - client_run rd_MD_UUID=$MD_UUID || return 1 + client_run rd_MD_UUID=$MD_UUID rd_NO_MDADMCONF || return 1 - client_run rd_MD_UUID=dummy1 rd_MD_UUID=$MD_UUID rd_MD_UUID=dummy2 || return 1 + client_run rd_MD_UUID=dummy1 rd_MD_UUID=$MD_UUID rd_MD_UUID=dummy2 rd_NO_MDADMCONF|| return 1 return 0 } @@ -50,7 +52,7 @@ test_run() { test_setup() { # Create the blank file to use as a root filesystem dd if=/dev/zero of=root.ext2 bs=1M count=20 - + kernel=$KVERSION # Create what will eventually be our root filesystem onto an overlay ( @@ -88,12 +90,15 @@ test_setup() { -append "root=/dev/dracut/root rw rootfstype=ext2 quiet console=ttyS0,115200n81" \ -initrd initramfs.makeroot || return 1 grep -m 1 -q dracut-root-block-created root.ext2 || return 1 + eval $(grep --binary-files=text -m 1 MD_UUID root.ext2) ( initdir=overlay . $basedir/dracut-functions dracut_install poweroff shutdown inst_simple ./hard-off.sh /emergency/01hard-off.sh inst ./cryptroot-ask /sbin/cryptroot-ask + mkdir -p overlay/etc + echo "ARRAY /dev/md0 level=raid5 num-devices=3 UUID=$MD_UUID" > overlay/etc/mdadm.conf ) sudo $basedir/dracut -l -i overlay / \ -o "plymouth" \ |