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