TEST-10-RAID: wait for udev settle before deconstructing
parent
4ce3a1b1bb
commit
f94ceb13b8
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in New Issue