From d5fe09cccdabb98db2f21002919a8e39d973ddb2 Mon Sep 17 00:00:00 2001 From: Itxaka Date: Tue, 10 Oct 2023 10:31:43 +0200 Subject: [PATCH] POC: test kairos-sysext Signed-off-by: Itxaka --- 90-kairos-sysext.conf | 1 + 90kairos-sysext/module-setup.sh | 26 ++++++++++++++++++++++++++ Earthfile | 3 +++ framework-profile.yaml | 7 ------- 4 files changed, 30 insertions(+), 7 deletions(-) create mode 100644 90-kairos-sysext.conf create mode 100644 90kairos-sysext/module-setup.sh diff --git a/90-kairos-sysext.conf b/90-kairos-sysext.conf new file mode 100644 index 000000000..0938eb06e --- /dev/null +++ b/90-kairos-sysext.conf @@ -0,0 +1 @@ +add_dracutmodules+=" kairos-sysext " diff --git a/90kairos-sysext/module-setup.sh b/90kairos-sysext/module-setup.sh new file mode 100644 index 000000000..05438cd7e --- /dev/null +++ b/90kairos-sysext/module-setup.sh @@ -0,0 +1,26 @@ +#!/bin/bash +# This module tries to add systemd-sysext module to the initramfs if its in the system, otherwise it does nothing + +# called by dracut +check() { + # Return 255 to only include the module, if another module requires it. + return 255 +} + +# called by dracut +depends() { + # If the binary(s) requirements are not fulfilled the module can't be installed. + require_binaries systemd-sysext || return 1 + echo "systemd-sysext" + return 0 +} + +# called by dracut +installkernel() { + return 0 +} + +# called by dracut +install() { + return 0 +} diff --git a/Earthfile b/Earthfile index 10b346346..8cace0e64 100644 --- a/Earthfile +++ b/Earthfile @@ -281,6 +281,9 @@ framework: END END + COPY 90-kairos-sysext.conf /framework/etc/dracut.conf.d/90-kairos-sysext.conf + COPY 90kairos-sysext /framework/usr/lib/dracut/modules.d/90kairos-sysext + SAVE ARTIFACT --keep-own /framework/ framework build-framework-image: diff --git a/framework-profile.yaml b/framework-profile.yaml index 300d6c23b..6e1c12c9c 100755 --- a/framework-profile.yaml +++ b/framework-profile.yaml @@ -76,25 +76,21 @@ flavors: - common-packages - kairos-toolchain - systemd-base - - systemd-latest - dracut-network-legacy opensuse-tumbleweed-arm-rpi: - common-packages - kairos-toolchain - systemd-base - - systemd-latest - dracut-network-legacy opensuse-leap: - common-packages - kairos-toolchain - systemd-base - - systemd-latest - dracut-network-legacy opensuse-leap-arm-rpi: - common-packages - kairos-toolchain - systemd-base - - systemd-latest - dracut-network-legacy alpine-arm-rpi: - common-packages @@ -159,9 +155,6 @@ ubuntu-kernel: packages: - distro-kernels/ubuntu - distro-initrd/ubuntu -systemd-latest: - packages: - - dracut/sysext repositories: - &kairos name: "kairos"