diff --git a/modules.d/00test/install b/modules.d/00test/install deleted file mode 100755 index f534a1c4..00000000 --- a/modules.d/00test/install +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh -dracut_install sfdisk mke2fs poweroff cp umount e2mkdir -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/test/TEST-10-RAID/copy-root.sh b/test/TEST-10-RAID/copy-root.sh new file mode 100755 index 00000000..fe9f57ae --- /dev/null +++ b/test/TEST-10-RAID/copy-root.sh @@ -0,0 +1,2 @@ +#!/bin/sh +cp -a -t "$NEWROOT" /source/* \ No newline at end of file diff --git a/test/TEST-10-RAID/create-root.sh b/test/TEST-10-RAID/create-root.sh new file mode 100755 index 00000000..b6f49126 --- /dev/null +++ b/test/TEST-10-RAID/create-root.sh @@ -0,0 +1,19 @@ +#!/bin/sh +sfdisk -C 640 -H 2 -S 32 -L /dev/sda <keyfile +cryptsetup -q luksFormat /dev/md0 /keyfile +echo "The passphrase is test" +cryptsetup luksOpen /dev/md0 dracut_crypt_test /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=overlay + . $basedir/dracut-functions + dracut_install sfdisk mke2fs poweroff cp umount e2mkdir + inst_simple ./halt.sh /pre-pivot/02halt.sh + inst_simple ./copy-root.sh /pre-pivot/01copy-root.sh + inst_simple ./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... - $basedir/dracut -l -i "$targetfs" /source \ + $basedir/dracut -l -i overlay / \ -m "dash kernel-modules test crypt lvm mdraid udev-rules base rootfs-block" \ -d "ata_piix ext2 sd_mod" \ -f initramfs.makeroot || return 1 @@ -49,8 +55,8 @@ test_setup() { } test_cleanup() { - rm -fr mnt + rm -fr overlay mnt rm -f root.ext2 initramfs.makeroot initramfs.testing } -. $testdir/test-functions \ No newline at end of file +. $testdir/test-functions