blob: a4ce6ab0bc86a52b1e397eb5d17042f7616113cd (
plain) (
tree)
|
|
#!/bin/bash
check() {
source "$moddir/scripts/utils.sh"
UTILS_STANDARD_OUTPUT=/dev/stdout
UTILS_ERROR_OUTPUT=/dev/stderr
utils_compile_nbd "$moddir/binaries/nbd/" && \
utils_compile_dnbd3 "$moddir/binaries/dnbd3" && \
utils_compile_systemd_preserve_process_marker \
"$moddir/binaries/systemd-preserve-process-marker/"
return $?
}
depends() {
echo base network bash kernel-modules
# Should be used if it would work btrfs
}
installkernel() {
inst "$moddir/binaries/dnbd3/build/dnbd3.ko" \
/usr/lib/modules/current/extra/dnbd3.ko
inst "$moddir/binaries/nbd/nbd.ko" \
/usr/lib/modules/current/extra/nbd.ko
# NOTE: btrfs crc32c are included by the btrfs dracut module
instmods ext4 dm_snapshot btrfs crc32c
}
install() {
# region binaries
inst "$moddir/binaries/dnbd3/build/dnbd3-client" /usr/bin/dnbd3-client
inst "$moddir/binaries/systemd-preserve-process-marker/systemd-preserve-process-marker" \
/usr/bin/systemd-preserve-process-marker
# endregion
# region hooks
inst_hook cmdline 00 "$moddir/hooks/cmdline/enable-sysrq.sh"
# TODO inst_hook cmdline 10 "$moddir/hooks/cmdline/prepare-network-kcl-parameter.sh"
inst_hook cmdline 90 "$moddir/hooks/cmdline/set-dracut-environment-variables.sh"
inst_hook pre-udev 00 "$moddir/hooks/pre-udev/load-custom-kernel-modules.sh"
inst_hook pre-udev 00 "$moddir/hooks/pre-udev/setup-loopback-device.sh"
# this is the configuration hook where the config stuff is wget'ed
# TODO
#inst_hook pre-mount 00 "$moddir/hooks/pre-mount/fetch-config.sh"
# this is the main hook where all the magic is triggered
#inst_hook pre-mount 10 "$moddir/hooks/pre-mount/mount-qcow.sh"
inst_hook pre-mount 10 "$moddir/hooks/pre-mount/prepare-root-partition.sh"
inst_hook mount 10 "$moddir/hooks/mount/mount-root-device.sh"
inst_hook pre-pivot 00 "$moddir/hooks/pre-pivot/mount-tmp.sh"
# endregion
# region scripts
inst "$moddir/scripts/utils.sh" "/usr/lib/utils.sh"
# endregion
## TODO deprecated
# the main magic script containing all the functions needed
# to prepare the qcow2-based root filesystem
#inst "$moddir/scripts/setup-qcow2" /sbin/setup-qcow2
# 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.
inst_multiple lsblk ping ip ifconfig sshd htop tail head cat vim \
touch sed lsmod sleep route wget find lsof strace chroot switch_root \
pivot_root mount fdisk mkfs.xfs \
insmod qemu-nbd blockdev partx dmsetup cut awk losetup dd mkfs.ext4 \
grep
# Production:
# inst_multiple insmod qemu-nbd blockdev partx dmsetup cut awk losetup dd
}
|