2 TEST_DESCRIPTION
="root filesystem on an encrypted LVM PV on a RAID-5"
4 KVERSION
=${KVERSION-$(uname -r)}
6 # Uncomment this to debug failures
9 DISKIMAGE
=$TESTDIR/TEST-10-RAID-root.img
13 -net none
-kernel /boot
/vmlinuz-
$KVERSION \
14 -append "root=/dev/dracut/root rw quiet rd.retry=3 rd.info console=ttyS0,115200n81 selinux=0 rd.debug $DEBUGFAIL" \
15 -initrd $TESTDIR/initramfs.testing
16 grep -m 1 -q dracut-root-block-success
$DISKIMAGE ||
return 1
20 DISKIMAGE
=$TESTDIR/TEST-10-RAID-root.img
21 # Create the blank file to use as a root filesystem
23 dd if=/dev
/null of
=$DISKIMAGE bs
=1M seek
=40
26 # Create what will eventually be our root filesystem onto an overlay
28 initdir
=$TESTDIR/overlay
/source
29 (mkdir
-p "$initdir"; cd "$initdir"; mkdir
-p dev sys proc etc var
/run tmp run
)
30 .
$basedir/dracut-functions.sh
31 dracut_install sh df free
ls shutdown poweroff stty
cat ps
ln ip route \
32 mount dmesg ifconfig dhclient mkdir
cp ping dhclient
33 for _terminfodir
in /lib
/terminfo
/etc
/terminfo
/usr
/share
/terminfo
; do
34 [ -f ${_terminfodir}/l
/linux
] && break
36 dracut_install
-o ${_terminfodir}/l
/linux
37 inst .
/test-init.sh
/sbin
/init
38 inst
"$basedir/modules.d/40network/dhclient-script" "/sbin/dhclient-script"
39 inst
"$basedir/modules.d/40network/ifup" "/sbin/ifup"
41 dracut_install
/lib
/systemd
/systemd-shutdown
42 find_binary plymouth
>/dev
/null
&& dracut_install plymouth
43 cp -a /etc
/ld.so.conf
* $initdir/etc
44 sudo ldconfig
-r "$initdir"
47 # second, install the files needed to make the root filesystem
49 initdir
=$TESTDIR/overlay
50 .
$basedir/dracut-functions.sh
51 dracut_install sfdisk mke2fs poweroff
cp umount
52 inst_hook initqueue
01 .
/create-root.sh
53 inst_simple .
/99-idesymlinks.rules
/etc
/udev
/rules.d
/99-idesymlinks.rules
56 # create an initramfs that will create the target root filesystem.
57 # We do it this way so that we do not risk trashing the host mdraid
58 # devices, volume groups, encrypted partitions, etc.
59 $basedir/dracut.sh
-l -i $TESTDIR/overlay
/ \
60 -m "dash crypt lvm mdraid udev-rules base rootfs-block kernel-modules" \
61 -d "piix ide-gd_mod ata_piix ext2 sd_mod" \
63 -f $TESTDIR/initramfs.makeroot
$KVERSION ||
return 1
64 rm -rf $TESTDIR/overlay
65 # Invoke KVM and/or QEMU to actually create the target filesystem.
68 -m 256M
-nographic -net none \
69 -kernel "/boot/vmlinuz-$kernel" \
70 -append "root=/dev/dracut/root rw rootfstype=ext2 quiet console=ttyS0,115200n81 selinux=0" \
71 -initrd $TESTDIR/initramfs.makeroot ||
return 1
72 grep -m 1 -q dracut-root-block-created
$DISKIMAGE ||
return 1
75 initdir
=$TESTDIR/overlay
76 .
$basedir/dracut-functions.sh
77 dracut_install poweroff shutdown
78 inst_hook emergency
000 .
/hard-off.sh
79 inst .
/cryptroot-ask.sh
/sbin
/cryptroot-ask
80 inst_simple .
/99-idesymlinks.rules
/etc
/udev
/rules.d
/99-idesymlinks.rules
82 sudo
$basedir/dracut.sh
-l -i $TESTDIR/overlay
/ \
83 -o "plymouth network" \
85 -d "piix ide-gd_mod ata_piix ext2 sd_mod" \
86 -f $TESTDIR/initramfs.testing
$KVERSION ||
return 1
93 .
$testdir/test-functions