From 1003402e6fb6ac4bc6c2f507d8ed716d43906f10 Mon Sep 17 00:00:00 2001 From: Joseph Marrero Corchado Date: Tue, 15 Oct 2024 14:11:37 -0400 Subject: [PATCH] tier-0: add kernel-install integration config This MR adds two configurations to enable kernel-install integration, this will enable using dnf or rpm to install kernels. - /usr/lib/kernel/install.conf: enables the hook that tells kernel-install to defer the logic to rpm-ostree, this currently only on f42 - dnf.conf: ensures dnf only keeps one kernel package --- tier-0/kernel-install.yaml | 24 ++++++++++++++++++++++++ tier-0/manifest.yaml | 1 + 2 files changed, 25 insertions(+) create mode 100644 tier-0/kernel-install.yaml diff --git a/tier-0/kernel-install.yaml b/tier-0/kernel-install.yaml new file mode 100644 index 0000000..2948d12 --- /dev/null +++ b/tier-0/kernel-install.yaml @@ -0,0 +1,24 @@ +# Configuration to enable kernel-install integration +postprocess: + - | + #!/usr/bin/env bash + set -xeuo pipefail + source /usr/lib/os-release + # Check if the ID is Fedora and VERSION_ID is 42 or higher + if [[ "$ID" == "fedora" && "$VERSION_ID" -ge 42 ]]; then + echo -e "# kernel-install will not try to run dracut and allow rpm-ostree to\n\ + # take over. Rpm-ostree will use this to know that it is responsible\n\ + # to run dracut and ensure that there is only one kernel in the image\n\ + layout=ostree" | tee /usr/lib/kernel/install.conf > /dev/null + fi + # By default dnf keeps multiple versions of the kernel, with this + # configuration we tell dnf to treat the kernel as everything else. + # https://dnf.readthedocs.io/en/latest/conf_ref.html#main-options + # Let's add the config to a distribution configuration file if dnf5 + # is used, we append to /etc/dnf/dnf.conf if not. + if [ -d "/usr/share/dnf5/libdnf.conf.d/" ]; then + echo -e "[main]\ninstallonlypkgs=''" >> /usr/share/dnf5/libdnf.conf.d/20-ostree-installonlypkgs.conf + else + echo "installonlypkgs=''" >> /etc/dnf/dnf.conf + fi + diff --git a/tier-0/manifest.yaml b/tier-0/manifest.yaml index 4892eb1..a531a15 100644 --- a/tier-0/manifest.yaml +++ b/tier-0/manifest.yaml @@ -21,6 +21,7 @@ include: - ostree.yaml - initramfs.yaml - basic-fixes.yaml + - kernel-install.yaml packages: # this is implied by dependencies but let's make it explicit