#!/bin/bash check() { return 0 } depends() { echo base network bash kernel-modules return 0 } installkernel() { instmods nbd ext4 } install() { # Loads globally needed useful functions or fixes some native dracut ones. inst "$moddir/library.sh" /usr/lib/test-library.sh # 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 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 1 "$moddir/hooks/cmdline.sh" inst_hook pre-mount 10 "$moddir/hooks/pre-mount.sh" # NOTE: Hook "mount" isn't executed on tested version. inst_hook pre-pivot 10 "$moddir/hooks/mount.sh" # Debugging Uncomment this version if you need some useful debugging tools # in your iniramfs. #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 # Production: inst_multiple insmod qemu-img qemu-nbd return 0 }