summaryrefslogtreecommitdiffstats
path: root/testModule
diff options
context:
space:
mode:
authortorben2015-04-17 02:41:03 +0200
committertorben2015-04-17 02:41:03 +0200
commit42f795dfb50b8e78fc8ce05b86e4e0f821f766f0 (patch)
tree0832855f278a7ec810993f6803435d7abed43ccb /testModule
parentHook name fix. (diff)
downloadsystemd-init-42f795dfb50b8e78fc8ce05b86e4e0f821f766f0.tar.gz
systemd-init-42f795dfb50b8e78fc8ce05b86e4e0f821f766f0.tar.xz
systemd-init-42f795dfb50b8e78fc8ce05b86e4e0f821f766f0.zip
Alles versucht :-((
Diffstat (limited to 'testModule')
-rwxr-xr-xtestModule/binaries/nbd-clientbin0 -> 59639 bytes
-rwxr-xr-xtestModule/binaries/qemu-nbd-systemd-mark-alternatebin0 -> 7128103 bytes
-rwxr-xr-xtestModule/hooks/mount.sh10
-rwxr-xr-xtestModule/hooks/pre-mount.sh27
-rwxr-xr-xtestModule/hooks/pre-pivot.sh12
-rw-r--r--testModule/kernel_modules/nbd.kobin458623 -> 463248 bytes
-rw-r--r--testModule/kernel_modules/nbd.ko.backupbin0 -> 463216 bytes
-rw-r--r--testModule/kernel_modules/nbd.ko.oldbin0 -> 458623 bytes
-rw-r--r--testModule/module-setup.sh11
9 files changed, 37 insertions, 23 deletions
diff --git a/testModule/binaries/nbd-client b/testModule/binaries/nbd-client
new file mode 100755
index 00000000..7bb2207f
--- /dev/null
+++ b/testModule/binaries/nbd-client
Binary files differ
diff --git a/testModule/binaries/qemu-nbd-systemd-mark-alternate b/testModule/binaries/qemu-nbd-systemd-mark-alternate
new file mode 100755
index 00000000..03c2a6b1
--- /dev/null
+++ b/testModule/binaries/qemu-nbd-systemd-mark-alternate
Binary files differ
diff --git a/testModule/hooks/mount.sh b/testModule/hooks/mount.sh
index f0a34f6a..93a11e7c 100755
--- a/testModule/hooks/mount.sh
+++ b/testModule/hooks/mount.sh
@@ -1,3 +1,7 @@
-# TODO
-warn '............MOUNT.............'
-mount /dev/nbd0 /sysroot/TEST
+if [ $MOUNT_READY ]; then
+ warn '............MOUNT ALREADY DONE.............'
+else
+ export MOUNT_READY=true
+ warn '............MOUNT.............'
+ #mount /dev/nbd0 /sysroot/TEST
+fi
diff --git a/testModule/hooks/pre-mount.sh b/testModule/hooks/pre-mount.sh
index 00871764..548e748d 100755
--- a/testModule/hooks/pre-mount.sh
+++ b/testModule/hooks/pre-mount.sh
@@ -1,12 +1,15 @@
-# TODO
-warn '............PRE-MOUNT.............'
-
-insmod /usr/lib/modules/3.10.0-229.1.2.el7.x86_64/extra/dnbd3.ko
-local dnbd3_device_node="$(dnbd3-client -h 132.230.4.1 -i stage4/torben/test \
- -r 1 -d /dev/dnbd0)"
-dnbd3_device_node='/dev/dnbd0'
-qemu-img create -f qcow2 -o backing_file="$dnbd3_device_node",backing_fmt=qcow2 /test.qcow2
-insmod /usr/lib/modules/3.10.0-229.1.2.el7.x86_64/extra/nbd.ko
-# NOTE: "--persistent" doesn't work with wrapper.
-#systemd_preserve_process_marker /usr/bin/qemu-nbd --connect=/dev/nbd0 /test.qcow2 --socket /qemu-nbd-TEST
-/usr/bin/qemu-nbd-systemd-mark --connect=/dev/nbd0 /test.qcow2 --socket /qemu-nbd-TEST
+if [ $PRE_MOUNT_READY ]; then
+ warn '............PRE-MOUNT ALREADY DONE.............'
+else
+ export PRE_MOUNT_READY=true
+ warn '............PRE-MOUNT.............'
+ #insmod /usr/lib/modules/3.10.0-229.1.2.el7.x86_64/extra/dnbd3.ko
+ #local dnbd3_device_node="$(dnbd3-client -h 132.230.4.1 -i stage4/torben/test \
+ # -r 1 -d /dev/dnbd0)"
+ #dnbd3_device_node='/dev/dnbd0'
+ #qemu-img create -f qcow2 -o backing_file="$dnbd3_device_node",backing_fmt=qcow2 /test.qcow2
+ qemu-img create -f qcow2 /run/test.qcow2 100M
+ insmod /usr/lib/modules/3.10.0-229.1.2.el7.x86_64/extra/nbd.ko
+ /usr/bin/qemu-nbd-systemd-mark-alternate --connect=/dev/nbd0 /run/test.qcow2 --socket /run/qemu-nbd-TEST --aio=native
+ #--persistent
+fi
diff --git a/testModule/hooks/pre-pivot.sh b/testModule/hooks/pre-pivot.sh
index 3326fae7..fcc6a977 100755
--- a/testModule/hooks/pre-pivot.sh
+++ b/testModule/hooks/pre-pivot.sh
@@ -1,4 +1,8 @@
-# TODO
-warn '............PRE-PIVOT.............'
-#mount /dev/nbd0 /sysroot/TEST
-# strace -ff -o /sysroot/log.txt -p PID
+if [ $PRE_PIVOT_READY ]; then
+ warn '............PRE-PIVOT ALREADY DONE.............'
+else
+ export PRE_PIVOT_READY=true
+ warn '............PRE-PIVOT.............'
+ #mount /dev/nbd0 /sysroot/TEST/
+ # strace -ff -o /sysroot/log.txt -p PID
+fi
diff --git a/testModule/kernel_modules/nbd.ko b/testModule/kernel_modules/nbd.ko
index 40b67a92..47cf6cd6 100644
--- a/testModule/kernel_modules/nbd.ko
+++ b/testModule/kernel_modules/nbd.ko
Binary files differ
diff --git a/testModule/kernel_modules/nbd.ko.backup b/testModule/kernel_modules/nbd.ko.backup
new file mode 100644
index 00000000..e8c3f40f
--- /dev/null
+++ b/testModule/kernel_modules/nbd.ko.backup
Binary files differ
diff --git a/testModule/kernel_modules/nbd.ko.old b/testModule/kernel_modules/nbd.ko.old
new file mode 100644
index 00000000..40b67a92
--- /dev/null
+++ b/testModule/kernel_modules/nbd.ko.old
Binary files differ
diff --git a/testModule/module-setup.sh b/testModule/module-setup.sh
index 09d7070f..009941fd 100644
--- a/testModule/module-setup.sh
+++ b/testModule/module-setup.sh
@@ -10,7 +10,7 @@ depends() {
}
installkernel() {
- instmods ext4 mbcache jbd2 \
+ instmods nbd ext4 mbcache jbd2 \
ip6t_rpfilter ip6t_REJEiCT ipt_REJECT xt_conntrack ebtable_nat \
ebtable_broute bridge stp llc ebtable_filter ebtables ip6table_nat \
nf_conntrack_ipv6 nf_defrag_ipv6 nf_nat_ipv6 ip6table_mangle \
@@ -23,7 +23,7 @@ installkernel() {
mperf libcrc32c sd_mod crc_t10dif crct10dif_common sr_mod cdrom \
ata_generic pata_acpi ahci libahci vboxvideo drm i2c_core ata_piix \
libata vboxguest dm_mirror dm_region_hash dm_log dm_mod
- # Production: instmods ext4 mbcache jbd2
+ # Production: instmods nbd ext4 mbcache jbd2
}
install() {
@@ -35,9 +35,11 @@ install() {
inst "$moddir/binaries/endless" /usr/bin/@endless
inst "$moddir/binaries/dnbd3-client" /usr/bin/dnbd3-client
inst "$moddir/binaries/busybox" /usr/bin/busybox
+ inst "$moddir/binaries/nbd-client" /usr/bin/nbd-client
inst "$moddir/binaries/qemu-nbd" /usr/bin/qemu-nbd
inst "$moddir/binaries/qemu-nbd" /usr/bin/@qemu-nbd
inst "$moddir/binaries/qemu-nbd-systemd-mark" /usr/bin/qemu-nbd-systemd-mark
+ inst "$moddir/binaries/qemu-nbd-systemd-mark-alternate" /usr/bin/qemu-nbd-systemd-mark-alternate
inst "$moddir/kernel_modules/dnbd3.ko" /usr/lib/modules/3.10.0-229.1.2.el7.x86_64/extra/dnbd3.ko
inst "$moddir/kernel_modules/nbd.ko" /usr/lib/modules/3.10.0-229.1.2.el7.x86_64/extra/nbd.ko
@@ -50,8 +52,9 @@ install() {
inst_hook pre-pivot 10 "$moddir/hooks/pre-pivot.sh"
inst_multiple lsblk ping ip ifconfig sshd htop dhclient tail head cat vim \
- touch sed lsmod insmod qemu-img sleep route wget find lsof \
- strace chroot switch_root pivot_root # qemu-nbd
+ touch sed lsmod insmod qemu-img sleep route wget find lsof strace \
+ chroot switch_root pivot_root # qemu-nbd
# Production: inst_multiple insmod qemu-img # qemu-nbd
+ #dracut_need_initqueue
return 0
}