dracut/test/make-test-root

32 lines
914 B
Bash
Executable File

#!/bin/bash
dd if=/dev/zero of=test/root.ext2 bs=1M count=20
mke2fs -F test/root.ext2
mkdir test/mnt
mount -o loop test/root.ext2 test/mnt
initdir=test/mnt
kernel=$(uname -r)
(
. ./dracut-functions
dracut_install sh df free ls shutdown poweroff stty cat ps ln ip route \
/lib/terminfo/l/linux mount dmesg ifconfig dhclient mkdir cp ping
inst test/test-init /sbin/init
(cd "$initdir"; mkdir -p dev sys proc etc var/run)
)
targetfs="$initdir"
unset initdir
umount test/mnt
rm -fr test/mnt
#./dracut -l -i "$targetfs" /source \
# -m "dash kernel-modules test crypt lvm udev-rules base rootfs-block" \
# -d "ata_piix ext2 sd_mod" \
# -f test/initramfs.makeroot
#
#qemu-kvm -hda test/root.ext2 -m 512M -nographic -net none \
# -kernel "/boot/vmlinuz-$kernel" \
# -append "root=/dev/dracut/root rw rootfstype=ext2 quiet console=ttyS0,115200n81" \
# -initrd test/initramfs.makeroot