From fede9187d803a414dc5cdfb6ec9179289c40eb92 Mon Sep 17 00:00:00 2001 From: torben Date: Thu, 9 Apr 2015 19:14:12 +0200 Subject: Nur noch pivot_switch fehlt! --- testModule/dnbd3-client | Bin 0 -> 31150 bytes testModule/dnbd3.ko | Bin 0 -> 1345285 bytes testModule/module-setup.sh | 33 +++++++++++++++++++-------------- testModule/mount-dnbd3.sh | 15 +++++++++++++++ testModule/nbd.ko | Bin 0 -> 458623 bytes 5 files changed, 34 insertions(+), 14 deletions(-) create mode 100755 testModule/dnbd3-client create mode 100755 testModule/dnbd3.ko create mode 100644 testModule/mount-dnbd3.sh create mode 100644 testModule/nbd.ko (limited to 'testModule') diff --git a/testModule/dnbd3-client b/testModule/dnbd3-client new file mode 100755 index 00000000..76924b49 Binary files /dev/null and b/testModule/dnbd3-client differ diff --git a/testModule/dnbd3.ko b/testModule/dnbd3.ko new file mode 100755 index 00000000..d7b7ce3b Binary files /dev/null and b/testModule/dnbd3.ko differ diff --git a/testModule/module-setup.sh b/testModule/module-setup.sh index 0f43268b..ae30de9f 100644 --- a/testModule/module-setup.sh +++ b/testModule/module-setup.sh @@ -5,24 +5,13 @@ check() { } depends() { - echo base bash kernel-modules systemd shutdown udev-rules debug qemu btrfs - return 0 -} - -install() { - # Loads globally needed useful functions or fixes some native dracut ones. - inst_simple "$moddir/library.sh" /usr/lib/test-library.sh - # NOTE: Priority has to be greater than the network cmdline parsing hooks - # since we have to modify the some kernel parameter before. - inst_hook cmdline 100 "$moddir/parse-ip.sh" - #inst_simple "$moddir/busybox" /usr/bin/busybox - #inst_hook pre-mount 20 "$moddir/setup_network.sh" - inst_multiple ping ip ifconfig sshd htop dhclient tail head cat vim touch sed + echo base network rootfs-block bash kernel-modules systemd shutdown udev-rules debug qemu btrfs return 0 } installkernel() { - instmods ip6t_rpfilter ip6t_REJEiCT ipt_REJECT xt_conntrack ebtable_nat \ + instmods dnbd3 nbd ext4 \ + 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 \ ip6table_security ip6table_raw ip6table_filter ip6_tables \ @@ -35,3 +24,19 @@ installkernel() { ata_generic pata_acpi ahci libahci vboxvideo drm i2c_core ata_piix \ libata vboxguest dm_mirror dm_region_hash dm_log dm_mod } + +install() { + # Loads globally needed useful functions or fixes some native dracut ones. + inst "$moddir/library.sh" /usr/lib/test-library.sh + inst "$moddir/dnbd3-client" /usr/bin/dnbd3-client + inst "$moddir/dnbd3.ko" /usr/lib/modules/3.10.0-229.1.2.el7.x86_64/extra/dnbd3.ko + inst "$moddir/nbd.ko" /usr/lib/modules/3.10.0-229.1.2.el7.x86_64/extra/nbd.ko + # NOTE: Priority has to be greater than the network cmdline parsing hooks + # since we have to modify the some kernel parameter before. + inst_hook cmdline 100 "$moddir/parse-ip.sh" + inst_hook pre-mount 100 "$moddir/mount-dnbd3.sh" + inst_simple "$moddir/busybox" /usr/bin/busybox + #inst_hook pre-mount 20 "$moddir/setup_network.sh" + inst_multiple lsblk ping ip ifconfig sshd htop dhclient tail head cat vim touch sed lsmod insmod qemu-img qemu-nbd sleep + return 0 +} diff --git a/testModule/mount-dnbd3.sh b/testModule/mount-dnbd3.sh new file mode 100644 index 00000000..9629a153 --- /dev/null +++ b/testModule/mount-dnbd3.sh @@ -0,0 +1,15 @@ +insmod /usr/lib/modules/3.10.0-229.1.2.el7.x86_64/extra/dnbd3.ko + +dnbd3-client --daemon & +sleep 2 +local dnbd3_device_node="$(dnbd3-client -h 132.230.4.1 -i stage4/torben/test -r 1)" + +qemu-img create -f qcow2 -o backing_file="$dnbd3_device_node",backing_fmt=qcow2 /tmp/test.qcow2 +insmod /usr/lib/modules/3.10.0-229.1.2.el7.x86_64/extra/nbd.ko +qemu-nbd -c /dev/nbd0 /tmp/test.qcow2 +mkdir /mnt +mount /dev/nbd0 /mnt + +warn '............JAU.............' +warn '............JAU.............' +warn '............JAU.............' diff --git a/testModule/nbd.ko b/testModule/nbd.ko new file mode 100644 index 00000000..40b67a92 Binary files /dev/null and b/testModule/nbd.ko differ -- cgit v1.2.3-55-g7522