The last changes made the 00test module really awkward anyways, so just hack the test module into the initramfs in a slight more brutal fashion. --- modules.d/00test/check | 2 -- modules.d/00test/install | 5 ----- {modules.d/00test => test}/copy-root.sh | 0 {modules.d/00test => test}/create-root.sh | 0 {modules.d/00test => test}/halt.sh | 0 test/make-test-root | 20 ++++++++++++++------ 6 files changed, 14 insertions(+), 13 deletions(-) diff --git a/modules.d/00test/check b/modules.d/00test/check deleted file mode 100755 index afe8ade..0000000 --- a/modules.d/00test/check +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/bash -exit 1 diff --git a/modules.d/00test/install b/modules.d/00test/install deleted file mode 100755 index 46a83af..0000000 --- a/modules.d/00test/install +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh -dracut_install sfdisk mke2fs poweroff cp umount -inst_hook pre-pivot 02 "$moddir/halt.sh" -inst_hook pre-pivot 01 "$moddir/copy-root.sh" -inst_hook pre-mount 01 "$moddir/create-root.sh" \ No newline at end of file diff --git a/modules.d/00test/copy-root.sh b/test/copy-root.sh similarity index 100% rename from modules.d/00test/copy-root.sh rename to test/copy-root.sh diff --git a/modules.d/00test/create-root.sh b/test/create-root.sh similarity index 100% rename from modules.d/00test/create-root.sh rename to test/create-root.sh diff --git a/modules.d/00test/halt.sh b/test/halt.sh similarity index 100% rename from modules.d/00test/halt.sh rename to test/halt.sh diff --git a/test/make-test-root b/test/make-test-root index e7f5276..6bc2b5a 100755 --- a/test/make-test-root +++ b/test/make-test-root @@ -4,9 +4,10 @@ dd if=/dev/zero of=test/root.ext2 bs=1M count=20 -initdir=test/mnt kernel=$(uname -r) +# first, make the root filesystem ( + initdir=test/overlay/source . ./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 dhclient @@ -18,16 +19,23 @@ kernel=$(uname -r) find_binary plymouth >/dev/null && dracut_install plymouth (cd "$initdir"; mkdir -p dev sys proc etc var/run tmp ) ) -targetfs="$initdir" -unset initdir + +# second, install the files needed to make the root filesystem +( + initdir=test/overlay + . ./dracut-functions + dracut_install sfdisk mke2fs poweroff cp umount + inst_simple test/halt.sh /pre-pivot/02halt.sh + inst_simple test/copy-root.sh /pre-pivot/01copy-root.sh + inst_simple test/create-root.sh /pre-mount/01create-root.sh +) # create an initramfs that will create the target root filesystem. # We do it this way because creating it directly in the host OS # results in cryptsetup not being able to unlock the LVM PV. # Probably a bug in cryptsetup, but... -./dracut -l -i "$targetfs" /source \ - -i test/overlay / \ - -m "dash kernel-modules test crypt lvm mdraid udev-rules base rootfs-block" \ +./dracut -l -i test/overlay / \ + -m "dash kernel-modules crypt lvm mdraid udev-rules base rootfs-block" \ -d "ata_piix ext2 sd_mod" \ -f test/initramfs.makeroot -- 1.6.0.4 -- To unsubscribe from this list: send the line "unsubscribe initramfs" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html