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
10 $testdir/run-qemu
-hda root.ext2
-m 256M
-nographic \
11 -net none
-kernel /boot
/vmlinuz-
$KVERSION \
12 -append "root=/dev/dracut/root rw quiet rd.retry=3 rd.info console=ttyS0,115200n81 selinux=0 rd.debug $DEBUGFAIL" \
13 -initrd initramfs.testing
14 grep -m 1 -q dracut-root-block-success root.ext2 ||
return 1
18 # Create the blank file to use as a root filesystem
19 dd if=/dev
/zero of
=root.ext2 bs
=1M count
=40
22 # Create what will eventually be our root filesystem onto an overlay
24 initdir
=overlay
/source
25 .
$basedir/dracut-functions
26 dracut_install sh df free
ls shutdown poweroff stty
cat ps
ln ip route \
27 /lib
/terminfo
/l
/linux mount dmesg ifconfig dhclient mkdir
cp ping dhclient
28 inst
"$basedir/modules.d/40network/dhclient-script" "/sbin/dhclient-script"
29 inst
"$basedir/modules.d/40network/ifup" "/sbin/ifup"
31 inst .
/test-init
/sbin
/init
32 find_binary plymouth
>/dev
/null
&& dracut_install plymouth
33 (cd "$initdir"; mkdir
-p dev sys proc etc var
/run tmp
)
34 cp -a /etc
/ld.so.conf
* $initdir/etc
35 sudo ldconfig
-r "$initdir"
38 # second, install the files needed to make the root filesystem
41 .
$basedir/dracut-functions
42 dracut_install sfdisk mke2fs poweroff
cp umount
43 inst_simple .
/create-root.sh
/initqueue
/01create-root.sh
44 inst_simple .
/99-idesymlinks.rules
/etc
/udev
/rules.d
/99-idesymlinks.rules
47 # create an initramfs that will create the target root filesystem.
48 # We do it this way so that we do not risk trashing the host mdraid
49 # devices, volume groups, encrypted partitions, etc.
50 $basedir/dracut
-l -i overlay
/ \
51 -m "dash crypt lvm mdraid udev-rules base rootfs-block kernel-modules" \
52 -d "piix ide-gd_mod ata_piix ext2 sd_mod" \
54 -f initramfs.makeroot
$KVERSION ||
return 1
56 # Invoke KVM and/or QEMU to actually create the target filesystem.
57 $testdir/run-qemu
-hda root.ext2
-m 256M
-nographic -net none \
58 -kernel "/boot/vmlinuz-$kernel" \
59 -append "root=/dev/dracut/root rw rootfstype=ext2 quiet console=ttyS0,115200n81 selinux=0" \
60 -initrd initramfs.makeroot ||
return 1
61 grep -m 1 -q dracut-root-block-created root.ext2 ||
return 1
64 .
$basedir/dracut-functions
65 dracut_install poweroff shutdown
66 inst_simple .
/hard-off.sh
/emergency
/01hard-off.sh
67 inst .
/cryptroot-ask
/sbin
/cryptroot-ask
68 inst_simple .
/99-idesymlinks.rules
/etc
/udev
/rules.d
/99-idesymlinks.rules
70 sudo
$basedir/dracut
-l -i overlay
/ \
71 -o "plymouth network" \
73 -d "piix ide-gd_mod ata_piix ext2 sd_mod" \
74 -f initramfs.testing
$KVERSION ||
return 1
79 rm -f root.ext2 initramfs.makeroot initramfs.testing
82 .
$testdir/test-functions