diff options
Diffstat (limited to 'testModule/module-setup.sh')
| -rw-r--r-- | testModule/module-setup.sh | 63 |
1 files changed, 49 insertions, 14 deletions
diff --git a/testModule/module-setup.sh b/testModule/module-setup.sh index 839e5deb..efd79cf1 100644 --- a/testModule/module-setup.sh +++ b/testModule/module-setup.sh @@ -42,32 +42,67 @@ installkernel() { } install() { - # cause we need reboots - inst "$moddir/scripts/r" /usr/bin/r - # Needed to mount remote dnbd3 filesystem. - inst "$moddir/binaries/dnbd3-client" /usr/bin/dnbd3-client + ### BINARIES + # + # busybox: cause we want lightweight tools inst "$moddir/binaries/busybox" /usr/bin/busybox - # A generic wrapper program to prepend a "@" to each process spawned by - # given nested programs. + # dnbd3-client: needed to mount remote dnbd3 filesystem. + inst "$moddir/binaries/dnbd3-client" /usr/bin/dnbd3-client + # A generic wrapper program to prepend a "@" to each process + # spawned by given nested programs. inst "$moddir/binaries/systemd-preserve-process-marker" \ /usr/bin/systemd-preserve-process-marker # NOTE: These modules are build again Kernel: 3.10.0-229.1.2.el7.x86_64 + # TODO: build these in check() ! inst "$moddir/kernel_modules/dnbd3.ko" \ /usr/lib/modules/current/extra/dnbd3.ko inst "$moddir/kernel_modules/nbd.ko" \ /usr/lib/modules/current/extra/nbd.ko - # NOTE: Priority has to be lower than the network cmdline parsing hooks - # since we have to modify the some kernel parameter before. - inst_hook cmdline 00 "$moddir/hooks/cmdline.sh" - inst_hook cmdline 90 "$moddir/hooks/nbd-cmdline.sh" - inst_hook pre-udev 00 "$moddir/hooks/pre-udev.sh" - inst_hook pre-mount 10 "$moddir/hooks/pre-mount.sh" - inst_hook mount 10 "$moddir/hooks/mount.sh" + ### HOOKS + ## HOOK cmdline + # enables sysrq-shortcuts + inst_hook cmdline 00 "$moddir/hooks/cmdline/enable-sysrq.sh" + + # expands the ip parameter in the kernel command line to + # make it dracut-compatible + # TODO: dracut still parses this incorrectly... + inst_hook cmdline 10 "$moddir/hooks/cmdline/expand-kcl-ip.sh" + + # sets environment variables to tell dracut which device + # holds the future root filesystem + inst_hook cmdline 90 "$moddir/hooks/cmdline/mark-root-device.sh" + + ## HOOK pre-udev + # loads the dnbd3/nbd kernel modules + inst_hook pre-udev 00 "$moddir/hooks/pre-udev/load-dnbd3-nbd-modules.sh" + + ## HOOK pre-mount + # this is the main hook where all the magic is triggered + inst_hook pre-mount 10 "$moddir/hooks/pre-mount/mount-qcow.sh" + + ## HOOK mount + # this simply mounts the prepared /dev/root to $NEWROOT + # aka "the dracut way" + inst_hook mount 10 "$moddir/hooks/mount/mount-root-device.sh" + + ## HOOK pre-pivot + # this checks whether we found a partition suitable for + # the future /tmp and if so, mounts it + inst_hook pre-pivot 00 "$moddir/hooks/pre-pivot/mount-tmp.sh" + + ### SCRIPTS + # the main magic script containing all the functions needed + # to prepare the qcow2-based root filesystem inst "$moddir/scripts/setup-qcow2" /sbin/setup-qcow2 - inst "$moddir/scripts/setup-nbdroot" /sbin/setup-nbdroot + # the script triggered by udev upon finding the right partitions + inst "$moddir/scripts/prepare-disks" /sbin/prepare-disks + + # udev rules detecting 44, 45, 46 partitions and running + # 'prepare-disks' to do then format/mount/use them + inst "$moddir/udev/70-openslx-disk.rules" /etc/udev/rules.d/70-openslx-disk.rules # Debugging Uncomment this version if you need some useful debugging tools # in your iniramfs. |
