2 # don't let udev and this script step on eachother's toes
3 for x
in 64-lvm.rules
70-mdadm.rules
99-mount-rules; do
4 > "/etc/udev/rules.d/$x"
6 rm -f -- /etc
/lvm
/lvm.conf
7 udevadm control
--reload
9 cryptsetup
-q luksFormat
/dev
/sdb
/keyfile
10 echo "The passphrase is test"
11 cryptsetup luksOpen
/dev
/sdb dracut_crypt_test
</keyfile
&& \
12 lvm pvcreate
-ff -y /dev
/mapper
/dracut_crypt_test
&& \
13 lvm vgcreate dracut
/dev
/mapper
/dracut_crypt_test
&& \
14 lvm lvcreate
-l 100%FREE
-n root dracut
&& \
16 mke2fs
-L dracut
-j /dev
/dracut
/root
&& \
17 /sbin
/tune2fs
-e continue /dev
/dracut
/root
&& \
18 mkdir
-p /sysroot
&& \
19 mount
/dev
/dracut
/root
/sysroot
&& \
20 cp -a -t /sysroot
/source
/* && \
23 lvm lvchange
-a n
/dev
/dracut
/root
25 cryptsetup luksClose
/dev
/mapper
/dracut_crypt_test
28 eval $
(udevadm info
--query=env
--name=/dev
/sdb|
while read line ||
[ -n "$line" ]; do [ "$line" != "${line#*ID_FS_UUID*}" ] && echo $line; done;)
29 { echo "dracut-root-block-created"; echo "ID_FS_UUID=$ID_FS_UUID"; } >/dev
/sda