2 TEST_DESCRIPTION="root filesystem on a ext3 filesystem"
4 KVERSION=${KVERSION-$(uname -r)}
6 # Uncomment this to debug failures
10 -hda $TESTDIR/root.ext3 \
12 -net none -kernel /boot/vmlinuz-$KVERSION \
13 -append "root=LABEL=dracut rw loglevel=77 systemd.log_level=debug systemd.log_target=console rd.retry=3 rd.info console=ttyS0,115200n81 selinux=0 rd.debug init=/sbin/init $DEBUGFAIL" \
14 -initrd $TESTDIR/initramfs.testing
15 grep -m 1 -q dracut-root-block-success $TESTDIR/root.ext3 || return 1
19 rm -f $TESTDIR/root.ext3
20 # Create the blank file to use as a root filesystem
21 dd if=/dev/null of=$TESTDIR/root.ext3 bs=1M seek=80
24 # Create what will eventually be our root filesystem onto an overlay
26 export initdir=$TESTDIR/overlay/source
28 . $basedir/dracut-functions.sh
29 dracut_install sh df free ls shutdown poweroff stty cat ps ln ip route \
30 mount dmesg ifconfig dhclient mkdir cp ping dhclient \
31 umount strace less setsid
32 for _terminfodir in /lib/terminfo /etc/terminfo /usr/share/terminfo; do
33 [ -f ${_terminfodir}/l/linux ] && break
35 dracut_install -o ${_terminfodir}/l/linux
36 inst "$basedir/modules.d/40network/dhclient-script.sh" "/sbin/dhclient-script"
37 inst "$basedir/modules.d/40network/ifup.sh" "/sbin/ifup"
39 inst ./test-init.sh /sbin/init
40 find_binary plymouth >/dev/null && dracut_install plymouth
41 (cd "$initdir"; mkdir -p dev sys proc etc var/run tmp )
42 cp -a /etc/ld.so.conf* $initdir/etc
43 sudo ldconfig -r "$initdir"
46 # second, install the files needed to make the root filesystem
48 export initdir=$TESTDIR/overlay
49 . $basedir/dracut-functions.sh
50 dracut_install sfdisk mkfs.ext3 poweroff cp umount
51 inst_hook initqueue 01 ./create-root.sh
52 inst_hook initqueue/finished 01 ./finished-false.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 udev-rules base rootfs-block kernel-modules" \
61 -d "piix ide-gd_mod ata_piix ext3 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 -hda $TESTDIR/root.ext3 \
69 -m 256M -nographic -net none \
70 -kernel "/boot/vmlinuz-$kernel" \
71 -append "root=/dev/dracut/root rw rootfstype=ext3 quiet console=ttyS0,115200n81 selinux=0" \
72 -initrd $TESTDIR/initramfs.makeroot || return 1
73 grep -m 1 -q dracut-root-block-created $TESTDIR/root.ext3 || return 1
77 export initdir=$TESTDIR/overlay
78 . $basedir/dracut-functions.sh
79 dracut_install poweroff shutdown
80 inst_hook emergency 000 ./hard-off.sh
81 inst_simple ./99-idesymlinks.rules /etc/udev/rules.d/99-idesymlinks.rules
83 sudo $basedir/dracut.sh -l -i $TESTDIR/overlay / \
86 -d "piix ide-gd_mod ata_piix ext3 sd_mod" \
87 -f $TESTDIR/initramfs.testing $KVERSION || return 1
89 # -o "plymouth network md dmraid multipath fips caps crypt btrfs resume dmsquash-live dm"
96 . $testdir/test-functions