]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
Don't create fully generic initramfs'es in the test framework
authorVictor Lowther <victor.lowther@gmail.com>
Fri, 29 May 2009 22:55:31 +0000 (17:55 -0500)
committerVictor Lowther <victor.lowther@gmail.com>
Fri, 29 May 2009 22:55:31 +0000 (17:55 -0500)
There is no point loading every driver available when we are not testing
network functionality and qemu does not even support the stuff we were
loading.  It just wastes time and space.

test/TEST-10-RAID/test.sh

index f7abe54d8a990f5c6b8cc573d654cb1da338c91c..34507aab22802c64b85521ca88320f2bfc33f915 100755 (executable)
@@ -10,12 +10,13 @@ test_run() {
 }
 
 test_setup() {
-    # This script creates a root filesystem on an encrypted LVM PV
+    # Create the blank file to use as a root filesystem
     dd if=/dev/zero of=root.ext2 bs=1M count=20
 
-    initdir=overlay/source
     kernel=$(uname -r)
+    # Create what will eventually be our root filesystem onto an overlay
     (
+       initdir=overlay/source
        . $basedir/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 
@@ -38,11 +39,10 @@ test_setup() {
     )
  
     # 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...
+    # We do it this way so that we do not risk trashing the host mdraid
+    # devices, volume groups, encrypted partitions, etc.
     $basedir/dracut -l -i overlay / \
-       -m "dash kernel-modules test crypt lvm mdraid udev-rules base rootfs-block" \
+       -m "dash crypt lvm mdraid udev-rules base rootfs-block" \
        -d "ata_piix ext2 sd_mod" \
        -f initramfs.makeroot || return 1
 
@@ -52,7 +52,10 @@ test_setup() {
        -append "root=/dev/dracut/root rw rootfstype=ext2 quiet console=ttyS0,115200n81" \
        -initrd initramfs.makeroot  || return 1
 
-    sudo $basedir/dracut -l -f initramfs.testing  || return 1
+    sudo $basedir/dracut -l \
+       -m "dash crypt lvm mdraid udev-rules base rootfs-block" \
+       -d "ata_piix ext2 sd_mod" \
+       -f initramfs.testing || return 1
 }
 
 test_cleanup() {