]>
Commit | Line | Data |
---|---|---|
ea8e543b HH |
1 | #!/bin/bash |
2 | TEST_DESCRIPTION="root filesystem on a LiveCD dmsquash filesystem" | |
3 | ||
4 | KVERSION=${KVERSION-$(uname -r)} | |
5 | ||
6 | # Uncomment this to debug failures | |
7 | #DEBUGFAIL="rd.shell rd.break" | |
8 | ||
9 | test_run() { | |
0be1785a HH |
10 | $testdir/run-qemu \ |
11 | -boot order=d \ | |
12 | -cdrom $TESTDIR/livecd.iso \ | |
13 | -hda $TESTDIR/root.img \ | |
14 | -m 256M -nographic \ | |
ea8e543b HH |
15 | -net none -kernel /boot/vmlinuz-$KVERSION \ |
16 | -append "root=live:CDLABEL=LiveCD live rw quiet rd.retry=3 rd.info console=ttyS0,115200n81 selinux=0 rd.debug $DEBUGFAIL" \ | |
0be1785a HH |
17 | -initrd $TESTDIR/initramfs.testing |
18 | grep -m 1 -q dracut-root-block-success $TESTDIR/root.img || return 1 | |
ea8e543b HH |
19 | } |
20 | ||
21 | test_setup() { | |
0be1785a | 22 | mkdir -p $TESTDIR/overlay |
ea8e543b | 23 | ( |
0be1785a | 24 | initdir=$TESTDIR/overlay |
ea8e543b HH |
25 | . $basedir/dracut-functions |
26 | dracut_install poweroff shutdown | |
27 | inst_hook emergency 000 ./hard-off.sh | |
28 | inst_simple ./99-idesymlinks.rules /etc/udev/rules.d/99-idesymlinks.rules | |
29 | ) | |
30 | ||
0be1785a | 31 | dd if=/dev/zero of=$TESTDIR/root.img count=100 |
ea8e543b | 32 | |
0be1785a HH |
33 | sudo $basedir/dracut -l -i $TESTDIR/overlay / \ |
34 | -a "debug dmsquash-live" \ | |
ea8e543b | 35 | -d "piix ide-gd_mod ata_piix ext3 sd_mod" \ |
0be1785a | 36 | -f $TESTDIR/initramfs.testing $KVERSION || return 1 |
ea8e543b | 37 | |
0be1785a | 38 | mkdir -p $TESTDIR/root-source |
ea8e543b HH |
39 | kernel=$KVERSION |
40 | # Create what will eventually be our root filesystem onto an overlay | |
41 | ( | |
0be1785a | 42 | initdir=$TESTDIR/root-source |
ea8e543b HH |
43 | . $basedir/dracut-functions |
44 | dracut_install sh df free ls shutdown poweroff stty cat ps ln ip route \ | |
96d22bd7 | 45 | mount dmesg ifconfig dhclient mkdir cp ping dhclient \ |
ea8e543b | 46 | umount strace less |
96d22bd7 HH |
47 | for _terminfodir in /lib/terminfo /etc/terminfo /usr/share/terminfo; do |
48 | [ -f ${_terminfodir}/l/linux ] && break | |
49 | done | |
50 | dracut_install -o ${_terminfodir}/l/linux | |
ea8e543b HH |
51 | inst "$basedir/modules.d/40network/dhclient-script" "/sbin/dhclient-script" |
52 | inst "$basedir/modules.d/40network/ifup" "/sbin/ifup" | |
53 | dracut_install grep syslinux isohybrid | |
54 | for f in /usr/share/syslinux/*; do | |
55 | inst_simple "$f" | |
56 | done | |
57 | inst ./test-init /sbin/init | |
0be1785a | 58 | inst $TESTDIR/initramfs.testing "/boot/initramfs-$KVERSION.img" |
ea8e543b HH |
59 | inst /boot/vmlinuz-$KVERSION |
60 | find_binary plymouth >/dev/null && dracut_install plymouth | |
61 | (cd "$initdir"; mkdir -p dev sys proc etc var/run tmp ) | |
62 | cp -a /etc/ld.so.conf* $initdir/etc | |
63 | sudo ldconfig -r "$initdir" | |
64 | ) | |
65 | python create.py -d -c livecd-fedora-minimal.ks | |
0be1785a | 66 | return 0 |
ea8e543b HH |
67 | } |
68 | ||
69 | test_cleanup() { | |
0be1785a | 70 | return 0 |
ea8e543b HH |
71 | } |
72 | ||
73 | . $testdir/test-functions |