From 42f795dfb50b8e78fc8ce05b86e4e0f821f766f0 Mon Sep 17 00:00:00 2001 From: torben Date: Fri, 17 Apr 2015 02:41:03 +0200 Subject: Alles versucht :-(( --- testModule/binaries/nbd-client | Bin 0 -> 59639 bytes .../binaries/qemu-nbd-systemd-mark-alternate | Bin 0 -> 7128103 bytes testModule/hooks/mount.sh | 10 +++++--- testModule/hooks/pre-mount.sh | 27 ++++++++++++--------- testModule/hooks/pre-pivot.sh | 12 ++++++--- testModule/kernel_modules/nbd.ko | Bin 458623 -> 463248 bytes testModule/kernel_modules/nbd.ko.backup | Bin 0 -> 463216 bytes testModule/kernel_modules/nbd.ko.old | Bin 0 -> 458623 bytes testModule/module-setup.sh | 11 ++++++--- 9 files changed, 37 insertions(+), 23 deletions(-) create mode 100755 testModule/binaries/nbd-client create mode 100755 testModule/binaries/qemu-nbd-systemd-mark-alternate create mode 100644 testModule/kernel_modules/nbd.ko.backup create mode 100644 testModule/kernel_modules/nbd.ko.old (limited to 'testModule') diff --git a/testModule/binaries/nbd-client b/testModule/binaries/nbd-client new file mode 100755 index 00000000..7bb2207f Binary files /dev/null and b/testModule/binaries/nbd-client 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 Binary files /dev/null and b/testModule/binaries/qemu-nbd-systemd-mark-alternate 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 Binary files a/testModule/kernel_modules/nbd.ko and b/testModule/kernel_modules/nbd.ko differ diff --git a/testModule/kernel_modules/nbd.ko.backup b/testModule/kernel_modules/nbd.ko.backup new file mode 100644 index 00000000..e8c3f40f Binary files /dev/null and b/testModule/kernel_modules/nbd.ko.backup differ diff --git a/testModule/kernel_modules/nbd.ko.old b/testModule/kernel_modules/nbd.ko.old new file mode 100644 index 00000000..40b67a92 Binary files /dev/null and b/testModule/kernel_modules/nbd.ko.old 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 } -- cgit v1.2.3-55-g7522