* [PATCH 1/7] also resume from "swsuspend" partitions
[not found] ` <1245331581-2453-1-git-send-email-harald-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
@ 2009-06-18 13:26 ` Harald Hoyer
2009-06-18 13:26 ` [PATCH 2/7] install "basename" for path_id Harald Hoyer
` (5 subsequent siblings)
6 siblings, 0 replies; 10+ messages in thread
From: Harald Hoyer @ 2009-06-18 13:26 UTC (permalink / raw)
To: initramfs-u79uwXL29TY76Z2rM5mHXA; +Cc: Harald Hoyer
---
modules.d/95resume/resume-genrules.sh | 16 ++++++++++------
1 files changed, 10 insertions(+), 6 deletions(-)
diff --git a/modules.d/95resume/resume-genrules.sh b/modules.d/95resume/resume-genrules.sh
index 5ff4efe..002a304 100755
--- a/modules.d/95resume/resume-genrules.sh
+++ b/modules.d/95resume/resume-genrules.sh
@@ -1,11 +1,15 @@
if [ -n "$resume" ]; then
- (
+ {
printf "KERNEL==\"%s\", RUN+=\"/bin/sh -c 'echo %%M:%%m > /sys/power/resume'\"\n" \
- ${resume#/dev/}
+ ${resume#/dev/};
printf "SYMLINK==\"%s\", RUN+=\"/bin/sh -c 'echo %%M:%%m > /sys/power/resume'\"\n" \
- ${resume#/dev/}
- ) >> /etc/udev/rules.d/99-resume.rules
+ ${resume#/dev/};
+ } >> /etc/udev/rules.d/99-resume.rules
elif ! getarg noresume; then
- echo "SUBSYSTEM==\"block\", ACTION==\"add\", ENV{ID_FS_TYPE}==\"suspend\", RUN+=\"/bin/sh -c 'echo %M:%m > /sys/power/resume'\"" \
- >> /etc/udev/rules.d/99-resume.rules
+ {
+ echo "SUBSYSTEM==\"block\", ACTION==\"add\", ENV{ID_FS_TYPE}==\"suspend\"," \
+ " RUN+=\"/bin/sh -c 'echo %M:%m > /sys/power/resume'\"";
+ echo "SUBSYSTEM==\"block\", ACTION==\"add\", ENV{ID_FS_TYPE}==\"swsuspend\"," \
+ " RUN+=\"/bin/sh -c 'echo %M:%m > /sys/power/resume'\"";
+ } >> /etc/udev/rules.d/99-resume.rules
fi
--
1.6.2.2
--
To unsubscribe from this list: send the line "unsubscribe initramfs" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related [flat|nested] 10+ messages in thread* [PATCH 2/7] install "basename" for path_id
[not found] ` <1245331581-2453-1-git-send-email-harald-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2009-06-18 13:26 ` [PATCH 1/7] also resume from "swsuspend" partitions Harald Hoyer
@ 2009-06-18 13:26 ` Harald Hoyer
2009-06-18 13:26 ` [PATCH 3/7] kill the server after the test_run Harald Hoyer
` (4 subsequent siblings)
6 siblings, 0 replies; 10+ messages in thread
From: Harald Hoyer @ 2009-06-18 13:26 UTC (permalink / raw)
To: initramfs-u79uwXL29TY76Z2rM5mHXA; +Cc: Harald Hoyer
---
modules.d/95udev-rules/install | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/modules.d/95udev-rules/install b/modules.d/95udev-rules/install
index 4cf488d..c5d73a6 100755
--- a/modules.d/95udev-rules/install
+++ b/modules.d/95udev-rules/install
@@ -3,9 +3,9 @@
# ultimately, /lib/initramfs/rules.d or somesuch which includes links/copies
# of the rules we want so that we just copy those in would be best
dracut_install udevd udevadm /lib*/udev/*_id /etc/udev/udev.conf /etc/group
+dracut_install basename
inst_rules 50-udev-default.rules 60-persistent-storage.rules \
61-persistent-storage-edd.rules 80-drivers.rules 95-udev-late.rules
-
#Some debian udev rules are named differently
inst_rules 50-udev.rules 95-late.rules
@@ -13,4 +13,4 @@ if ldd $(find_binary udevd) |grep -q /lib64/libc; then
dracut_install /lib64/libnss_files*
else
dracut_install /lib/libnss_files*
-fi
\ No newline at end of file
+fi
--
1.6.2.2
--
To unsubscribe from this list: send the line "unsubscribe initramfs" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related [flat|nested] 10+ messages in thread* [PATCH 3/7] kill the server after the test_run
[not found] ` <1245331581-2453-1-git-send-email-harald-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2009-06-18 13:26 ` [PATCH 1/7] also resume from "swsuspend" partitions Harald Hoyer
2009-06-18 13:26 ` [PATCH 2/7] install "basename" for path_id Harald Hoyer
@ 2009-06-18 13:26 ` Harald Hoyer
[not found] ` <1245331581-2453-4-git-send-email-harald-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2009-06-18 13:26 ` [PATCH 4/7] use 128M for the test virtual machines instead of 512M Harald Hoyer
` (3 subsequent siblings)
6 siblings, 1 reply; 10+ messages in thread
From: Harald Hoyer @ 2009-06-18 13:26 UTC (permalink / raw)
To: initramfs-u79uwXL29TY76Z2rM5mHXA; +Cc: Harald Hoyer
---
test/TEST-20-NFS/test.sh | 4 ++++
test/TEST-40-NBD/test.sh | 6 ++++++
2 files changed, 10 insertions(+), 0 deletions(-)
diff --git a/test/TEST-20-NFS/test.sh b/test/TEST-20-NFS/test.sh
index 345ba4b..d3787ec 100755
--- a/test/TEST-20-NFS/test.sh
+++ b/test/TEST-20-NFS/test.sh
@@ -258,6 +258,10 @@ test_run() {
test_nfsv3 || return 1
test_nfsv4
+ if [[ -s server.pid ]]; then
+ sudo kill -TERM $(cat server.pid)
+ rm -f server.pid
+ fi
}
test_setup() {
diff --git a/test/TEST-40-NBD/test.sh b/test/TEST-40-NBD/test.sh
index 8d98c08..f3a3d20 100755
--- a/test/TEST-40-NBD/test.sh
+++ b/test/TEST-40-NBD/test.sh
@@ -170,6 +170,12 @@ test_run() {
client_test "NBD root=/dev/dracut/root netroot=dhcp (w/ fstype and opts)" \
52:54:00:12:34:05 \
"root=/dev/dracut/root netroot=dhcp" || return 1
+
+ if [[ -s server.pid ]]; then
+ sudo kill -TERM $(cat server.pid)
+ rm -f server.pid
+ fi
+
}
make_encrypted_root() {
--
1.6.2.2
--
To unsubscribe from this list: send the line "unsubscribe initramfs" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related [flat|nested] 10+ messages in thread* [PATCH 4/7] use 128M for the test virtual machines instead of 512M
[not found] ` <1245331581-2453-1-git-send-email-harald-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
` (2 preceding siblings ...)
2009-06-18 13:26 ` [PATCH 3/7] kill the server after the test_run Harald Hoyer
@ 2009-06-18 13:26 ` Harald Hoyer
2009-06-18 13:26 ` [PATCH 5/7] add iSCSI testsuite Harald Hoyer
` (2 subsequent siblings)
6 siblings, 0 replies; 10+ messages in thread
From: Harald Hoyer @ 2009-06-18 13:26 UTC (permalink / raw)
To: initramfs-u79uwXL29TY76Z2rM5mHXA; +Cc: Harald Hoyer
---
test/TEST-10-RAID/test.sh | 4 ++--
test/TEST-20-NFS/test.sh | 4 ++--
test/TEST-40-NBD/test.sh | 6 +++---
3 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/test/TEST-10-RAID/test.sh b/test/TEST-10-RAID/test.sh
index a6e81ab..b208760 100755
--- a/test/TEST-10-RAID/test.sh
+++ b/test/TEST-10-RAID/test.sh
@@ -4,7 +4,7 @@ TEST_DESCRIPTION="root filesystem on an encrypted LVM PV"
KVERSION=${KVERSION-$(uname -r)}
test_run() {
- $testdir/run-qemu -hda root.ext2 -m 512M -nographic \
+ $testdir/run-qemu -hda root.ext2 -m 128M -nographic \
-net none -kernel /boot/vmlinuz-$KVERSION \
-append "root=/dev/dracut/root rw quiet console=ttyS0,115200n81" \
-initrd initramfs.testing
@@ -47,7 +47,7 @@ test_setup() {
-f initramfs.makeroot $KVERSION || return 1
rm -rf overlay
# Invoke KVM and/or QEMU to actually create the target filesystem.
- $testdir/run-qemu -hda root.ext2 -m 512M -nographic -net none \
+ $testdir/run-qemu -hda root.ext2 -m 128M -nographic -net none \
-kernel "/boot/vmlinuz-$kernel" \
-append "root=/dev/dracut/root rw rootfstype=ext2 quiet console=ttyS0,115200n81" \
-initrd initramfs.makeroot || return 1
diff --git a/test/TEST-20-NFS/test.sh b/test/TEST-20-NFS/test.sh
index d3787ec..ff11f27 100755
--- a/test/TEST-20-NFS/test.sh
+++ b/test/TEST-20-NFS/test.sh
@@ -10,7 +10,7 @@ run_server() {
# Start server first
echo "NFS TEST SETUP: Starting DHCP/NFS server"
- $testdir/run-qemu -hda server.ext2 -m 512M -nographic \
+ $testdir/run-qemu -hda server.ext2 -m 128M -nographic \
-net nic,macaddr=52:54:00:12:34:56,model=e1000 \
-net socket,mcast=230.0.0.1:1234 \
-serial udp:127.0.0.1:9999 \
@@ -42,7 +42,7 @@ client_test() {
return 1
fi
- $testdir/run-qemu -hda client.img -m 512M -nographic \
+ $testdir/run-qemu -hda client.img -m 128M -nographic \
-net nic,macaddr=$mac,model=e1000 \
-net socket,mcast=230.0.0.1:1234 \
-kernel /boot/vmlinuz-$KVERSION \
diff --git a/test/TEST-40-NBD/test.sh b/test/TEST-40-NBD/test.sh
index f3a3d20..b6d12b6 100755
--- a/test/TEST-40-NBD/test.sh
+++ b/test/TEST-40-NBD/test.sh
@@ -11,7 +11,7 @@ run_server() {
echo "NBD TEST SETUP: Starting DHCP/NBD server"
$testdir/run-qemu -hda server.ext2 -hdb nbd.ext2 -hdc encrypted.ext2 \
- -m 512M -nographic \
+ -m 128M -nographic \
-net nic,macaddr=52:54:00:12:34:56,model=e1000 \
-net socket,mcast=230.0.0.1:1234 \
-serial udp:127.0.0.1:9999 \
@@ -46,7 +46,7 @@ client_test() {
return 1
fi
- $testdir/run-qemu -hda flag.img -m 512M -nographic \
+ $testdir/run-qemu -hda flag.img -m 128M -nographic \
-net nic,macaddr=$mac,model=e1000 \
-net socket,mcast=230.0.0.1:1234 \
-kernel /boot/vmlinuz-$KVERSION \
@@ -213,7 +213,7 @@ make_encrypted_root() {
rm -rf overlay
# Invoke KVM and/or QEMU to actually create the target filesystem.
- $testdir/run-qemu -hda flag.img -hdb encrypted.ext2 -m 512M \
+ $testdir/run-qemu -hda flag.img -hdb encrypted.ext2 -m 128M \
-nographic -net none \
-kernel "/boot/vmlinuz-$kernel" \
-append "root=/dev/dracut/root rw quiet console=ttyS0,115200n81" \
--
1.6.2.2
--
To unsubscribe from this list: send the line "unsubscribe initramfs" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related [flat|nested] 10+ messages in thread* [PATCH 5/7] add iSCSI testsuite
[not found] ` <1245331581-2453-1-git-send-email-harald-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
` (3 preceding siblings ...)
2009-06-18 13:26 ` [PATCH 4/7] use 128M for the test virtual machines instead of 512M Harald Hoyer
@ 2009-06-18 13:26 ` Harald Hoyer
2009-06-18 13:26 ` [PATCH 6/7] add DEBUGFAIL to TEST-10-RAID Harald Hoyer
2009-06-18 13:26 ` [PATCH 7/7] remove redundant vol_id run from out udev rules Harald Hoyer
6 siblings, 0 replies; 10+ messages in thread
From: Harald Hoyer @ 2009-06-18 13:26 UTC (permalink / raw)
To: initramfs-u79uwXL29TY76Z2rM5mHXA; +Cc: Harald Hoyer
---
test/TEST-30-ISCSI/Makefile | 10 +++
test/TEST-30-ISCSI/Makefile.tbd | 10 ---
test/TEST-30-ISCSI/client-init | 13 +++
test/TEST-30-ISCSI/create-root.sh | 38 +++++-----
test/TEST-30-ISCSI/dhcpd.conf | 25 ++++++
test/TEST-30-ISCSI/server-init | 17 ++++
test/TEST-30-ISCSI/targets | 21 +++++
test/TEST-30-ISCSI/test.sh | 162 +++++++++++++++++++++++++++++++------
8 files changed, 242 insertions(+), 54 deletions(-)
create mode 100644 test/TEST-30-ISCSI/Makefile
delete mode 100644 test/TEST-30-ISCSI/Makefile.tbd
create mode 100755 test/TEST-30-ISCSI/client-init
create mode 100644 test/TEST-30-ISCSI/dhcpd.conf
create mode 100755 test/TEST-30-ISCSI/server-init
create mode 100644 test/TEST-30-ISCSI/targets
diff --git a/test/TEST-30-ISCSI/Makefile b/test/TEST-30-ISCSI/Makefile
new file mode 100644
index 0000000..bc0ddb6
--- /dev/null
+++ b/test/TEST-30-ISCSI/Makefile
@@ -0,0 +1,10 @@
+all:
+ @make -s --no-print-directory -C ../.. all
+ @basedir=../.. testdir=../ ./test.sh --all
+setup:
+ @make --no-print-directory -C ../.. all
+ @basedir=../.. testdir=../ ./test.sh --setup
+clean:
+ @basedir=../.. testdir=../ ./test.sh --clean
+run:
+ @basedir=../.. testdir=../ ./test.sh --run
diff --git a/test/TEST-30-ISCSI/Makefile.tbd b/test/TEST-30-ISCSI/Makefile.tbd
deleted file mode 100644
index 2ef573d..0000000
--- a/test/TEST-30-ISCSI/Makefile.tbd
+++ /dev/null
@@ -1,10 +0,0 @@
-all:
- make -C ../.. all
- @basedir=../.. testdir=../ ./test.sh --all
-setup:
- make -C ../.. all
- @basedir=../.. testdir=../ ./test.sh --setup
-clean:
- @basedir=../.. testdir=../ ./test.sh --clean
-run:
- @basedir=../.. testdir=../ ./test.sh --run
diff --git a/test/TEST-30-ISCSI/client-init b/test/TEST-30-ISCSI/client-init
new file mode 100755
index 0000000..b1cfa09
--- /dev/null
+++ b/test/TEST-30-ISCSI/client-init
@@ -0,0 +1,13 @@
+#!/bin/sh
+exec >/dev/console 2>&1
+export TERM=linux
+export PS1='initramfs-test:\w\$ '
+stty sane
+echo "made it to the rootfs! Powering down."
+while read dev fs fstype opts rest; do
+ [ "$fstype" != "ext2" ] && continue
+ echo "iscsi-OK $dev $fstype $opts" > /dev/sda
+ break
+done < /proc/mounts
+#sh -i
+poweroff -f
diff --git a/test/TEST-30-ISCSI/create-root.sh b/test/TEST-30-ISCSI/create-root.sh
index 2dc9a59..32c1828 100755
--- a/test/TEST-30-ISCSI/create-root.sh
+++ b/test/TEST-30-ISCSI/create-root.sh
@@ -6,29 +6,29 @@ done
udevadm control --reload-rules
# save a partition at the beginning for future flagging purposes
sfdisk -C 640 -H 2 -S 32 -L /dev/sda <<EOF
-,1
-,213
-,213
-,213
+,,
EOF
-mdadm --create /dev/md0 --run --auto=yes --level=5 --raid-devices=3 /dev/sda2 /dev/sda3 /dev/sda4
+#mdadm --create /dev/md0 --run --auto=yes --level=5 --raid-devices=3 /dev/sda2 /dev/sda3 /dev/sda4
# wait for the array to finish initailizing, otherwise this sometimes fails
# randomly.
-mdadm -W /dev/md0
-echo -n test >keyfile
-cryptsetup -q luksFormat /dev/md0 /keyfile
-echo "The passphrase is test"
-cryptsetup luksOpen /dev/md0 dracut_crypt_test </keyfile && \
-lvm pvcreate -ff -y /dev/mapper/dracut_crypt_test && \
-lvm vgcreate dracut /dev/mapper/dracut_crypt_test && \
-lvm lvcreate -l 100%FREE -n root dracut && \
-lvm vgchange -ay && \
-mke2fs /dev/dracut/root && \
+#mdadm -W /dev/md0
+#echo -n test >keyfile
+#cryptsetup -q luksFormat /dev/sda1 /keyfile
+#echo "The passphrase is test"
+#cryptsetup luksOpen /dev/sda1 dracut_crypt_test </keyfile && \
+#lvm pvcreate -ff -y /dev/mapper/dracut_crypt_test && \
+#lvm vgcreate dracut /dev/mapper/dracut_crypt_test && \
+#lvm pvcreate -ff -y /dev/sda1 && \
+#lvm vgcreate dracut /dev/sda1 && \
+#lvm lvcreate -l 100%FREE -n root dracut && \
+#lvm vgchange -ay && \
+mke2fs -L ROOT /dev/sda1 && \
mkdir -p /sysroot && \
-mount /dev/dracut/root /sysroot && \
+mount /dev/sda1 /sysroot && \
cp -a -t /sysroot /source/* && \
umount /sysroot && \
-lvm lvchange -a n /dev/dracut/root && \
-cryptsetup luksClose /dev/mapper/dracut_crypt_test && \
-echo "dracut-root-block-created" >/dev/sda1
+echo "dracut-root-block-created" >/dev/sdb
poweroff -f
+
+#lvm lvchange -a n /dev/dracut/root && \
+#cryptsetup luksClose /dev/mapper/dracut_crypt_test && \
diff --git a/test/TEST-30-ISCSI/dhcpd.conf b/test/TEST-30-ISCSI/dhcpd.conf
new file mode 100644
index 0000000..515922a
--- /dev/null
+++ b/test/TEST-30-ISCSI/dhcpd.conf
@@ -0,0 +1,25 @@
+ddns-update-style none;
+
+use-host-decl-names true;
+
+subnet 192.168.50.0 netmask 255.255.255.0 {
+ option subnet-mask 255.255.255.0;
+ option routers 192.168.50.1;
+ next-server 192.168.50.1;
+ server-identifier 192.168.50.1;
+ option domain-name-servers 192.168.50.1;
+ option domain-search "example.com";
+ option domain-name "other.com";
+
+ # MAC numbering scheme:
+ # NFSv3: last octect starts at 0x00 and works up
+
+ group {
+ option root-path "iscsiroot=192.168.50.1::::test";
+
+ host iscsi-1 {
+ hardware ethernet 52:54:00:12:34:00;
+ fixed-address 192.168.50.101;
+ }
+ }
+}
diff --git a/test/TEST-30-ISCSI/server-init b/test/TEST-30-ISCSI/server-init
new file mode 100755
index 0000000..69b38ec
--- /dev/null
+++ b/test/TEST-30-ISCSI/server-init
@@ -0,0 +1,17 @@
+#!/bin/sh
+export TERM=linux
+export PS1='nfstest-server:\w\$ '
+stty sane
+echo "made it to the rootfs!"
+echo server > /proc/sys/kernel/hostname
+ip addr add 127.0.0.1/8 dev lo
+ip link set lo up
+ip addr add 192.168.50.1/24 dev eth0
+ip link set eth0 up
+>/var/lib/dhcpd/dhcpd.leases
+chmod 777 /var/lib/dhcpd/dhcpd.leases
+dhcpd -cf /etc/dhcpd.conf -lf /var/lib/dhcpd/dhcpd.leases
+# Wait forever for the VM to die
+/usr/sbin/iscsi-target -D -t iqn.2009-06.dracut
+mount -n -o remount,ro /
+poweroff -f
diff --git a/test/TEST-30-ISCSI/targets b/test/TEST-30-ISCSI/targets
new file mode 100644
index 0000000..e3c7114
--- /dev/null
+++ b/test/TEST-30-ISCSI/targets
@@ -0,0 +1,21 @@
+# $NetBSD: targets,v 1.2 2006/03/04 21:53:16 agc Exp $
+#
+# Structure of this file:
+#
+# + an extent is a straight (offset, length) pair of a file or device
+# it's the lowest common storage denominator
+# at least one is needed
+# + a device is made up of one or more extents or other devices
+# devices can be added in a hierachical manner, to enhance resilience
+# + in this example, no device definitions are necessary, as the target
+# will just use a simple extent for persistent storage
+# + a target is made up of 1 or more devices
+# The code does not support RAID1 recovery at present
+
+# Simple file showing 1 extent, mapped straight into 1 target
+
+# extents file start length
+extent0 /dev/sdb 0 20971520
+
+# target flags storage netmask
+target0 rw extent0 192.168.50.0/24
diff --git a/test/TEST-30-ISCSI/test.sh b/test/TEST-30-ISCSI/test.sh
index e4fe2fd..3fd6bd3 100755
--- a/test/TEST-30-ISCSI/test.sh
+++ b/test/TEST-30-ISCSI/test.sh
@@ -1,29 +1,79 @@
#!/bin/bash
-TEST_DESCRIPTION="root filesystem on an encrypted LVM PV over ISCSI"
+TEST_DESCRIPTION="root filesystem over iSCSI"
+
+KVERSION=${KVERSION-$(uname -r)}
+
+#DEBUGFAIL="rdinitdebug rdnetdebug udevinfo"
+
+run_server() {
+ # Start server first
+ echo "iSCSI TEST SETUP: Starting DHCP/iSCSI server"
+
+ $testdir/run-qemu -hda server.ext2 -hdb root.ext2 -m 128M -nographic \
+ -net nic,macaddr=52:54:00:12:34:56,model=e1000 \
+ -net socket,mcast=230.0.0.1:1234 \
+ -serial udp:127.0.0.1:9999 \
+ -kernel /boot/vmlinuz-$KVERSION \
+ -append "root=/dev/sda rw quiet console=ttyS0,115200n81" \
+ -initrd initramfs.server -pidfile server.pid -daemonize || return 1
+ sudo chmod 644 server.pid || return 1
+
+ # Cleanup the terminal if we have one
+ tty -s && stty sane
+
+ echo Sleeping 10 seconds to give the server a head start
+ sleep 10
+}
+
+run_client() {
+
+ # Need this so kvm-qemu will boot (needs non-/dev/zero local disk)
+ if ! dd if=/dev/zero of=client.img bs=1M count=1; then
+ echo "Unable to make client sda image" 1>&2
+ return 1
+ fi
+
+ $testdir/run-qemu -hda client.img -m 128M -nographic \
+ -net nic,macaddr=52:54:00:12:34:00,model=e1000 \
+ -net socket,mcast=230.0.0.1:1234 \
+ -kernel /boot/vmlinuz-$KVERSION \
+ -append "root=LABEL=ROOT netroot=iscsi:192.168.50.1::::iqn.2009-06.dracut:target0 rw quiet console=ttyS0,115200n81 $DEBUGFAIL" \
+ -initrd initramfs.testing
+ grep -m 1 -q iscsi-OK client.img || return 1
+}
test_run() {
- $testdir/run-qemu -m 512M -nographic -net nic,vlan=0,macaddr=52:54:00:12:34:FE -net tap,vlan=0,ifname=vnet2 \
- -kernel /boot/vmlinuz-$(uname -r) \
- -append "root=/dev/dracut/root rw quiet console=ttyS0,115200n81 iscsiroot=192.168.2.2::::iqn.2004-04.com.qnap:TS-439:iSCSI.test.8CCAFA ip=dhcp" \
- -initrd initramfs.testing
- #grep -m 1 -q dracut-root-block-success root.ext2 || return 1
+ if ! run_server; then
+ echo "Failed to start server" 1>&2
+ return 1
+ fi
+ run_client
+ if [[ -s server.pid ]]; then
+ sudo kill -TERM $(cat server.pid)
+ rm -f server.pid
+ fi
}
test_setup() {
+ if [ ! -x /usr/sbin/iscsi-target ]; then
+ echo "Need iscsi-target from netbsd-iscsi"
+ return 1
+ fi
+
+ # Create the blank file to use as a root filesystem
+ dd if=/dev/zero of=root.ext2 bs=1M count=20
- kernel=$(uname -r)
+ kernel=$KVERSION
# 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
- inst "$basedir/modules.d/40network/dhclient-script" "/sbin/dhclient-script"
- inst "$basedir/modules.d/40network/ifup" "/sbin/ifup"
- dracut_install grep
- inst $testdir/test-init /sbin/init
- find_binary plymouth >/dev/null && dracut_install plymouth
+ dracut_install sh shutdown poweroff stty cat ps ln ip \
+ /lib/terminfo/l/linux mount dmesg mkdir \
+ cp ping grep
+ inst ./client-init /sbin/init
(cd "$initdir"; mkdir -p dev sys proc etc var/run tmp )
+ ldconfig -n -r "$initdir" /lib* /usr/lib*
)
# second, install the files needed to make the root filesystem
@@ -37,32 +87,94 @@ test_setup() {
# create an initramfs that will create the target root filesystem.
# We do it this way so that we do not risk trashing the host mdraid
# devices, volume groups, encrypted partitions, etc.
- $basedir/dracut -l --verbose -i overlay / \
- -m "dash crypt lvm mdraid udev-rules base rootfs-block iscsi network" \
+ $basedir/dracut -l -i overlay / \
+ -m "dash crypt lvm mdraid udev-rules base rootfs-block" \
-d "ata_piix ext2 sd_mod" \
- -f initramfs.makeroot || return 1
+ -f initramfs.makeroot $KVERSION || return 1
rm -rf overlay
+
+
+ # Need this so kvm-qemu will boot (needs non-/dev/zero local disk)
+ if ! dd if=/dev/zero of=client.img bs=1M count=1; then
+ echo "Unable to make client sdb image" 1>&2
+ return 1
+ fi
# Invoke KVM and/or QEMU to actually create the target filesystem.
- $testdir/run-qemu -m 512M -nographic -net nic,vlan=0,macaddr=52:54:00:12:34:FE -net tap,vlan=0,ifname=vnet2 \
+ $testdir/run-qemu -hda root.ext2 -hdb client.img -m 128M -nographic -net none \
-kernel "/boot/vmlinuz-$kernel" \
- -append "root=/dev/dracut/root iscsiroot=192.168.2.2::::iqn.2004-04.com.qnap:TS-439:iSCSI.test.8CCAFA ip=dhcp rw rootfstype=ext2 console=ttyS0,115200n81 quiet" \
+ -append "root=/dev/dracut/root rw rootfstype=ext2 quiet console=ttyS0,115200n81" \
-initrd initramfs.makeroot || return 1
-
+ grep -m 1 -q dracut-root-block-created client.img || return 1
+ rm client.img
(
initdir=overlay
. $basedir/dracut-functions
dracut_install poweroff shutdown
- inst ./cryptroot-ask /sbin/cryptroot-ask
+# inst_simple ./hard-off.sh /emergency/01hard-off.sh
+# inst ./cryptroot-ask /sbin/cryptroot-ask
)
+# -m "debug dash crypt lvm mdraid udev-rules base rootfs-block iscsi" \
sudo $basedir/dracut -l -i overlay / \
- -m "dash crypt lvm mdraid udev-rules base rootfs-block iscsi" \
+ -m "debug dash udev-rules base rootfs-block iscsi" \
-d "ata_piix ext2 sd_mod" \
- -f initramfs.testing || return 1
+ -f initramfs.testing $KVERSION || return 1
+
+ # Make server root
+ dd if=/dev/zero of=server.ext2 bs=1M count=60
+ mke2fs -F server.ext2
+ mkdir mnt
+ sudo mount -o loop server.ext2 mnt
+
+ kernel=$KVERSION
+ (
+ initdir=mnt
+ . $basedir/dracut-functions
+ (
+ cd "$initdir";
+ mkdir -p dev sys proc etc var/run tmp var/lib/dhcpd /etc/iscsi
+ )
+ inst /etc/passwd /etc/passwd
+ dracut_install sh ls shutdown poweroff stty cat ps ln ip \
+ /lib/terminfo/l/linux dmesg mkdir cp ping \
+ modprobe tcpdump \
+ /etc/services sleep mount chmod
+ dracut_install /usr/sbin/iscsi-target
+ instmods iscsi_tcp crc32c ipv6
+ inst ./targets /etc/iscsi/targets
+# inst ./root.ext2 /
+ [ -f /etc/netconfig ] && dracut_install /etc/netconfig
+ which dhcpd >/dev/null 2>&1 && dracut_install dhcpd
+ [ -x /usr/sbin/dhcpd3 ] && inst /usr/sbin/dhcpd3 /usr/sbin/dhcpd
+ inst ./server-init /sbin/init
+ inst ./hosts /etc/hosts
+ inst ./dhcpd.conf /etc/dhcpd.conf
+ dracut_install /etc/nsswitch.conf /etc/rpc /etc/protocols
+ inst /etc/group /etc/group
+
+ /sbin/depmod -a -b "$initdir" $kernel
+ ldconfig -n -r "$initdir" /lib* /usr/lib*
+ )
+
+ sudo umount mnt
+ rm -fr mnt
+
+
+ # Make server's dracut image
+ $basedir/dracut -l -i overlay / \
+ -m "dash udev-rules base rootfs-block debug" \
+ -d "ata_piix ext2 sd_mod e1000" \
+ -f initramfs.server $KVERSION || return 1
+
}
test_cleanup() {
- rm -fr overlay mnt
- rm -f root.ext2 initramfs.makeroot initramfs.testing
+ if [[ -s server.pid ]]; then
+ sudo kill -TERM $(cat server.pid)
+ rm -f server.pid
+ fi
+ rm -rf mnt overlay
+ rm -f client.ext2 server.ext2 client.img initramfs.server initramfs.testing
+ rm -f initramfs.makeroot root.ext2
}
. $testdir/test-functions
--
1.6.2.2
--
To unsubscribe from this list: send the line "unsubscribe initramfs" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related [flat|nested] 10+ messages in thread* [PATCH 6/7] add DEBUGFAIL to TEST-10-RAID
[not found] ` <1245331581-2453-1-git-send-email-harald-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
` (4 preceding siblings ...)
2009-06-18 13:26 ` [PATCH 5/7] add iSCSI testsuite Harald Hoyer
@ 2009-06-18 13:26 ` Harald Hoyer
2009-06-18 13:26 ` [PATCH 7/7] remove redundant vol_id run from out udev rules Harald Hoyer
6 siblings, 0 replies; 10+ messages in thread
From: Harald Hoyer @ 2009-06-18 13:26 UTC (permalink / raw)
To: initramfs-u79uwXL29TY76Z2rM5mHXA; +Cc: Harald Hoyer
---
test/TEST-10-RAID/test.sh | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/test/TEST-10-RAID/test.sh b/test/TEST-10-RAID/test.sh
index b208760..59ae01e 100755
--- a/test/TEST-10-RAID/test.sh
+++ b/test/TEST-10-RAID/test.sh
@@ -3,10 +3,13 @@ TEST_DESCRIPTION="root filesystem on an encrypted LVM PV"
KVERSION=${KVERSION-$(uname -r)}
+# Uncomment this to debug failures
+#DEBUGFAIL="rdinitdebug rdnetdebug"
+
test_run() {
$testdir/run-qemu -hda root.ext2 -m 128M -nographic \
-net none -kernel /boot/vmlinuz-$KVERSION \
- -append "root=/dev/dracut/root rw quiet console=ttyS0,115200n81" \
+ -append "root=/dev/dracut/root rw quiet console=ttyS0,115200n81 $DEBUGFAIL" \
-initrd initramfs.testing
grep -m 1 -q dracut-root-block-success root.ext2 || return 1
}
--
1.6.2.2
--
To unsubscribe from this list: send the line "unsubscribe initramfs" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related [flat|nested] 10+ messages in thread* [PATCH 7/7] remove redundant vol_id run from out udev rules
[not found] ` <1245331581-2453-1-git-send-email-harald-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
` (5 preceding siblings ...)
2009-06-18 13:26 ` [PATCH 6/7] add DEBUGFAIL to TEST-10-RAID Harald Hoyer
@ 2009-06-18 13:26 ` Harald Hoyer
6 siblings, 0 replies; 10+ messages in thread
From: Harald Hoyer @ 2009-06-18 13:26 UTC (permalink / raw)
To: initramfs-u79uwXL29TY76Z2rM5mHXA; +Cc: Harald Hoyer
moved mdadm rules before luks rules
add nbd vol_id rules
---
modules.d/50plymouth-pre0.7/63-luks.rules | 2 --
modules.d/50plymouth/63-luks.rules | 1 -
modules.d/90crypt/63-luks.rules | 1 -
modules.d/90lvm/64-lvm.rules | 2 +-
modules.d/90mdraid/61-mdadm.rules | 12 ++++++++++++
modules.d/90mdraid/70-mdadm.rules | 12 ------------
modules.d/90mdraid/install | 2 +-
modules.d/95nbd/61-nbd.rules | 6 ++++++
modules.d/95nbd/install | 1 +
9 files changed, 21 insertions(+), 18 deletions(-)
create mode 100644 modules.d/90mdraid/61-mdadm.rules
delete mode 100644 modules.d/90mdraid/70-mdadm.rules
create mode 100644 modules.d/95nbd/61-nbd.rules
diff --git a/modules.d/50plymouth-pre0.7/63-luks.rules b/modules.d/50plymouth-pre0.7/63-luks.rules
index 893577b..711e865 100644
--- a/modules.d/50plymouth-pre0.7/63-luks.rules
+++ b/modules.d/50plymouth-pre0.7/63-luks.rules
@@ -6,8 +6,6 @@
SUBSYSTEM!="block", GOTO="luks_end"
ACTION!="add|change", GOTO="luks_end"
-
-KERNEL!="sr*", IMPORT{program}="vol_id --export $tempnode"
ENV{ID_FS_TYPE}=="crypto_LUKS", RUN+="cryptroot-ask $env{DEVNAME} luks-$env{ID_FS_UUID}"
LABEL="luks_end"
diff --git a/modules.d/50plymouth/63-luks.rules b/modules.d/50plymouth/63-luks.rules
index 01a1b1d..cfa619b 100644
--- a/modules.d/50plymouth/63-luks.rules
+++ b/modules.d/50plymouth/63-luks.rules
@@ -7,7 +7,6 @@
SUBSYSTEM!="block", GOTO="luks_end"
ACTION!="add|change", GOTO="luks_end"
-KERNEL!="sr*", IMPORT{program}="vol_id --export $tempnode"
ENV{ID_FS_TYPE}=="crypto_LUKS", RUN+="/sbin/cryptroot-ask $env{DEVNAME} luks-$env{ID_FS_UUID}"
LABEL="luks_end"
diff --git a/modules.d/90crypt/63-luks.rules b/modules.d/90crypt/63-luks.rules
index 01a1b1d..cfa619b 100644
--- a/modules.d/90crypt/63-luks.rules
+++ b/modules.d/90crypt/63-luks.rules
@@ -7,7 +7,6 @@
SUBSYSTEM!="block", GOTO="luks_end"
ACTION!="add|change", GOTO="luks_end"
-KERNEL!="sr*", IMPORT{program}="vol_id --export $tempnode"
ENV{ID_FS_TYPE}=="crypto_LUKS", RUN+="/sbin/cryptroot-ask $env{DEVNAME} luks-$env{ID_FS_UUID}"
LABEL="luks_end"
diff --git a/modules.d/90lvm/64-lvm.rules b/modules.d/90lvm/64-lvm.rules
index f742287..8a2fcc4 100644
--- a/modules.d/90lvm/64-lvm.rules
+++ b/modules.d/90lvm/64-lvm.rules
@@ -7,7 +7,7 @@
SUBSYSTEM!="block", GOTO="lvm_end"
ACTION!="add|change", GOTO="lvm_end"
-KERNEL!="sr*", IMPORT{program}="vol_id --export $tempnode"
+KERNEL=="dm-[0-9]*", IMPORT{program}="vol_id --export $tempnode"
ENV{ID_FS_TYPE}=="LVM2_member", RUN+="/bin/sh -c '/sbin/lvm vgscan; /sbin/lvm vgchange -ay'"
LABEL="lvm_end"
diff --git a/modules.d/90mdraid/61-mdadm.rules b/modules.d/90mdraid/61-mdadm.rules
new file mode 100644
index 0000000..1a5d98c
--- /dev/null
+++ b/modules.d/90mdraid/61-mdadm.rules
@@ -0,0 +1,12 @@
+# This file causes block devices with Linux RAID (mdadm) signatures to
+# automatically cause mdadm to be run.
+# See udev(8) for syntax
+
+SUBSYSTEM!="block", GOTO="raid_end"
+ACTION!="add|change", GOTO="raid_end"
+KERNEL=="md/*", GOTO="raid_end"
+
+KERNEL=="md*", IMPORT{program}="vol_id --export $tempnode"
+ENV{ID_FS_TYPE}=="linux_raid_member", RUN+="/sbin/mdadm -IR $root/%k"
+
+LABEL="raid_end"
diff --git a/modules.d/90mdraid/70-mdadm.rules b/modules.d/90mdraid/70-mdadm.rules
deleted file mode 100644
index ae54c96..0000000
--- a/modules.d/90mdraid/70-mdadm.rules
+++ /dev/null
@@ -1,12 +0,0 @@
-# This file causes block devices with Linux RAID (mdadm) signatures to
-# automatically cause mdadm to be run.
-# See udev(8) for syntax
-
-SUBSYSTEM!="block", GOTO="raid_end"
-ACTION!="add|change", GOTO="raid_end"
-KERNEL=="md/*", GOTO="raid_end"
-
-KERNEL!="sr*", IMPORT{program}="vol_id --export $tempnode"
-ENV{ID_FS_TYPE}=="linux_raid_member", RUN+="/sbin/mdadm -IR $root/%k"
-
-LABEL="raid_end"
diff --git a/modules.d/90mdraid/install b/modules.d/90mdraid/install
index 6b729d9..a6fad0d 100755
--- a/modules.d/90mdraid/install
+++ b/modules.d/90mdraid/install
@@ -3,7 +3,7 @@ dracut_install mdadm
inst /etc/passwd
inst /etc/group
instmods =drivers/md
-inst_rules "$moddir/70-mdadm.rules"
+inst_rules "$moddir/61-mdadm.rules"
[ -f /etc/mdadm/mdadm.conf ] && inst /etc/mdadm/mdadm.conf /etc/mdadm.conf
[ -f /etc/mdadm.conf ] && inst /etc/mdadm.conf
if [ -x /sbin/mdmon ] ; then
diff --git a/modules.d/95nbd/61-nbd.rules b/modules.d/95nbd/61-nbd.rules
new file mode 100644
index 0000000..5892cf3
--- /dev/null
+++ b/modules.d/95nbd/61-nbd.rules
@@ -0,0 +1,6 @@
+SUBSYSTEM!="block", GOTO="nbd_end"
+ACTION!="add|change", GOTO="nbd_end"
+
+KERNEL=="nbd*", IMPORT{program}="vol_id --export $tempnode"
+
+LABEL="nbd_end"
diff --git a/modules.d/95nbd/install b/modules.d/95nbd/install
index eca74e4..dace08f 100755
--- a/modules.d/95nbd/install
+++ b/modules.d/95nbd/install
@@ -2,5 +2,6 @@
inst nbd-client
inst_hook cmdline 90 "$moddir/parse-nbdroot.sh"
+inst_rules "$moddir/61-nbd.rules"
inst "$moddir/nbdroot" "/sbin/nbdroot"
instmods nbd
--
1.6.2.2
--
To unsubscribe from this list: send the line "unsubscribe initramfs" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related [flat|nested] 10+ messages in thread