kernel-install: Write layout=ostree to both install.conf and drop-in

Write the layout=ostree configuration to both /usr/lib/kernel/install.conf
and /usr/lib/kernel/install.conf.d/00-bootc-kernel-layout.conf
for defense-in-depth.

The drop-in ensures the setting persists when systemd-udev overwrites
install.conf during upgrades, while having both paths maintains
compatibility with any tooling that reads the original location.

The original install.conf path can be removed after a release cycle
of rpm-ostree, once all consumers are updated to use the drop-in and
have rpm-ostree changes.

Resolves: RHEL-128312
Assisted-by: OpenCode (Opus 4.5)
Signed-off-by: Joseph Marrero Corchado <jmarrero@redhat.com>
This commit is contained in:
Joseph Marrero 2026-01-12 20:04:33 -05:00
commit c188a85beb

View file

@ -8,7 +8,7 @@ postprocess:
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.d/00-kernel-layout.conf > /dev/null
layout=ostree" | tee /usr/lib/kernel/install.conf /usr/lib/kernel/install.conf.d/00-bootc-kernel-layout.conf > /dev/null
# 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