From: Victor Lowther Date: Sun, 24 May 2009 05:29:46 +0000 (-0700) Subject: Move content of 00test module into the test subdir X-Git-Tag: 0.1~180 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=fe9143d9ca9a7c8142f111b261a1a5950c66ea44;p=thirdparty%2Fdracut.git Move content of 00test module into the test subdir 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. --- diff --git a/modules.d/00test/install b/modules.d/00test/install deleted file mode 100755 index f534a1c47..000000000 --- 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 000000000..fe9f57ae9 --- /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 000000000..b6f491269 --- /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