dracut/0048-TEST-10-RAID-wait-for-udev-settle-before-deconstruct.patch

49 lines
1.8 KiB
Diff
Raw Normal View History

From f94ceb13b8e6eb825b29f453a68657c508481942 Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Wed, 14 Mar 2012 15:52:35 +0100
Subject: [PATCH] TEST-10-RAID: wait for udev settle before deconstructing
---
test/TEST-10-RAID/create-root.sh | 25 ++++++++++++++-----------
1 file changed, 14 insertions(+), 11 deletions(-)
diff --git a/test/TEST-10-RAID/create-root.sh b/test/TEST-10-RAID/create-root.sh
index 099d619..3dd86cb 100755
--- a/test/TEST-10-RAID/create-root.sh
+++ b/test/TEST-10-RAID/create-root.sh
@@ -16,20 +16,23 @@ mdadm --create /dev/md0 --run --auto=yes --level=5 --raid-devices=3 /dev/sda2 /d
# wait for the array to finish initailizing, otherwise this sometimes fails
# randomly.
mdadm -W /dev/md0
+set -e
echo -n test >keyfile
cryptsetup -q luksFormat /dev/md0 /keyfile
echo "The passphrase is test"
-cryptsetup luksOpen /dev/md0 dracut_crypt_test </keyfile && \
-lvm pvcreate -ff -y /dev/mapper/dracut_crypt_test && \
-lvm vgcreate dracut /dev/mapper/dracut_crypt_test && \
+cryptsetup luksOpen /dev/md0 dracut_crypt_test </keyfile
+lvm pvcreate -ff -y /dev/mapper/dracut_crypt_test
+lvm vgcreate dracut /dev/mapper/dracut_crypt_test
lvm lvcreate -l 100%FREE -n root dracut && \
-lvm vgchange -ay && \
-mke2fs /dev/dracut/root && \
-mkdir -p /sysroot && \
-mount /dev/dracut/root /sysroot && \
-cp -a -t /sysroot /source/* && \
-umount /sysroot && \
-lvm lvchange -a n /dev/dracut/root && \
-cryptsetup luksClose /dev/mapper/dracut_crypt_test && \
+lvm vgchange -ay
+mke2fs /dev/dracut/root
+mkdir -p /sysroot
+mount /dev/dracut/root /sysroot
+cp -a -t /sysroot /source/*
+umount /sysroot
+lvm lvchange -a n /dev/dracut/root
+udevadm settle
+cryptsetup luksClose /dev/mapper/dracut_crypt_test
+udevadm settle
echo "dracut-root-block-created" >/dev/sda1
poweroff -f