Files
immucore/dracut/28immucore/module-setup.sh
Itxaka 56632ca277 Add extra files needed for dracut (#36)
* Add extra files needed for dracut

If we are dropping cos-immutable-rootfs then we have to include the
missing files that the package already added.

For example, the several dracut configs of modules for the initramfs
stage, or the general config for the dracut file.

We also need to install and link the initramfs elemental stage service
as that its no longer provided by the cos-immutable-rootfs package and
not integrated into immucore yet

Signed-off-by: Itxaka <itxaka.garcia@spectrocloud.com>

* Minor improvements

Signed-off-by: Itxaka <itxaka.garcia@spectrocloud.com>

---------

Signed-off-by: Itxaka <itxaka.garcia@spectrocloud.com>
2023-02-13 14:34:51 +01:00

43 lines
1.6 KiB
Bash
Executable File

#!/bin/bash
# called by dracut
check() {
require_binaries "$systemdutildir"/systemd || return 1
return 255
}
# called by dracut
depends() {
echo systemd rootfs-block dm fs-lib
#tpm2-tss
return 0
}
# called by dracut
installkernel() {
instmods overlay
}
# called by dracut
install() {
declare moddir=${moddir}
declare systemdutildir=${systemdutildir}
declare systemdsystemunitdir=${systemdsystemunitdir}
# Add missing elemental binary, drop once we get yip lib inside immucore as its only needed to run the stages
inst_multiple immucore elemental
# add utils used by elemental or stages
inst_multiple partprobe sync udevadm parted mkfs.ext2 mkfs.ext3 mkfs.ext4 mkfs.vfat mkfs.fat blkid e2fsck resize2fs mount umount sgdisk rsync
# missing mkfs.xfs xfs_growfs in image?
inst_script "${moddir}/generator.sh" "${systemdutildir}/system-generators/immucore-generator"
inst_simple "${moddir}/immucore.service" "${systemdsystemunitdir}/immucore.service"
mkdir -p "${initdir}/${systemdsystemunitdir}/initrd-fs.target.requires"
ln_r "../immucore.service" "${systemdsystemunitdir}/initrd-fs.target.requires/immucore.service"
# Until this is done on immucore, we need to ship it as part of the dracut module
inst_simple "${moddir}/kairos-setup-initramfs.service" "${systemdsystemunitdir}/kairos-setup-initramfs.service"
mkdir -p "${initdir}/${systemdsystemunitdir}/initrd.target.requires"
ln_r "../kairos-setup-initramfs.service" "${systemdsystemunitdir}/initrd.target.requires/kairos-setup-initramfs.service"
dracut_need_initqueue
}