diff options
| author | torben | 2015-04-16 15:40:19 +0200 |
|---|---|---|
| committer | torben | 2015-04-16 15:40:19 +0200 |
| commit | 3828cf7cca22287a52c3165e5419b78a8d7bf165 (patch) | |
| tree | a7f740a26235d0ccd43fc5b3e7f3dc03e4b3c4bb /testModule | |
| parent | funny qemu.nbd hacks (diff) | |
| download | systemd-init-3828cf7cca22287a52c3165e5419b78a8d7bf165.tar.gz systemd-init-3828cf7cca22287a52c3165e5419b78a8d7bf165.tar.xz systemd-init-3828cf7cca22287a52c3165e5419b78a8d7bf165.zip | |
Fixes blockdevice killing during systemd-switch-root.
Diffstat (limited to 'testModule')
| -rwxr-xr-x[-rw-r--r--] | testModule/hooks/cmdline.sh | 0 | ||||
| -rwxr-xr-x | testModule/hooks/mount.sh | 3 | ||||
| -rwxr-xr-x[-rw-r--r--] | testModule/hooks/pre-mount.sh | 8 | ||||
| -rwxr-xr-x[-rw-r--r--] | testModule/hooks/pre-pivot.sh | 8 | ||||
| -rw-r--r-- | testModule/module-setup.sh | 2 |
5 files changed, 13 insertions, 8 deletions
diff --git a/testModule/hooks/cmdline.sh b/testModule/hooks/cmdline.sh index 340467df..340467df 100644..100755 --- a/testModule/hooks/cmdline.sh +++ b/testModule/hooks/cmdline.sh diff --git a/testModule/hooks/mount.sh b/testModule/hooks/mount.sh new file mode 100755 index 00000000..f0a34f6a --- /dev/null +++ b/testModule/hooks/mount.sh @@ -0,0 +1,3 @@ +# TODO +warn '............MOUNT.............' +mount /dev/nbd0 /sysroot/TEST diff --git a/testModule/hooks/pre-mount.sh b/testModule/hooks/pre-mount.sh index 210ea26f..00871764 100644..100755 --- a/testModule/hooks/pre-mount.sh +++ b/testModule/hooks/pre-mount.sh @@ -1,6 +1,12 @@ # TODO -warn '............START.............' +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 diff --git a/testModule/hooks/pre-pivot.sh b/testModule/hooks/pre-pivot.sh index 48591219..3326fae7 100644..100755 --- a/testModule/hooks/pre-pivot.sh +++ b/testModule/hooks/pre-pivot.sh @@ -1,10 +1,4 @@ # TODO -warn '............MOUNT.............' -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 -# --verbose & +warn '............PRE-PIVOT.............' #mount /dev/nbd0 /sysroot/TEST # strace -ff -o /sysroot/log.txt -p PID diff --git a/testModule/module-setup.sh b/testModule/module-setup.sh index 4a5c4331..3a5da7fc 100644 --- a/testModule/module-setup.sh +++ b/testModule/module-setup.sh @@ -37,6 +37,7 @@ install() { inst "$moddir/binaries/busybox" /usr/bin/busybox 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/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 @@ -45,6 +46,7 @@ install() { # since we have to modify the some kernel parameter before. inst_hook cmdline 1 "$moddir/hooks/cmdline.sh" inst_hook pre-mount 10 "$moddir/hooks/pre-mount.sh" + inst_hook pre-mount 10 "$moddir/hooks/mount.sh" inst_hook pre-pivot 10 "$moddir/hooks/pre-pivot.sh" inst_multiple lsblk ping ip ifconfig sshd htop dhclient tail head cat vim \ |
