Kernel-install integration with dnf and rpm-ostree coming to bootc images

With the release of Fedora 41, dnf can be used on Container builds to install packages in image mode build as most of us are accustomed to in package mode Fedora. However installing, upgrading or downgrading kernels could only still be managed with rpm-ostree.

With rpm-ostree 2025.2 this changes! This release of rpm-ostree provides kernel-install integration. A image mode container with rpm-ostree 2025.2 and a couple of configuration files will allow admins and power users to use DNF to manage their Kernel.

Today you can try the official bootc rawhide image: quay.io/fedora/fedora-bootc:rawhide which has the config files added on: tier-0: add kernel-install integration config (!62) · Merge requests · fedora / bootc / Base Images · GitLab

and the latest rpm-ostree which includes these PRs:

If we don’t find any significant issues, this should also be enabled in the bootc fedora 41 images in the next week or so.

In case members of the community want to test on your own Fedora 41 environments you can apply the rpm-ostree upgrade:

https://bodhi.fedoraproject.org/updates/FEDORA-2025-95492f42d2

and

the config changes shown in:

I also have built a custom image quay.io/jmarrero_rh/fedora-bootc:kernel-install-41 that includes the changes that you can use to test while the official Fedora-bootc:41 is updated.

Once the fedora-bootc 41 image has been updated I will remove my custom one.

An example of a Containerfile using this feature is a simple as:


FROM quay.io/jmarrero_rh/fedora-bootc:kernel-install-41

RUN sudo dnf -y upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2025-2d3a101e1b

Please report any issues in https://github.com/coreos/rpm-ostree/issues

4 Likes

FYI, we are still investigating a potential issue with this feature in kernel-install: integration by jmarrero · Pull Request #5135 · coreos/rpm-ostree · GitHub. It will be enabled in Rawhide for the Atomic Desktops once this is cleared up and we’ve merged: PR#608: common: Add kernel-install integration config - workstation-ostree-config - Pagure.io.

Is that the same issue discussed here kernel-install: integration by jmarrero · Pull Request #5135 · coreos/rpm-ostree · GitHub ? If so it’s fixed in Release v2025.2 · coreos/rpm-ostree · GitHub (using that at build time).

I tested quay.io/jmarrero_rh/fedora-bootc:kernel-install-41 with the kernel-6.12.11-200.fc41. Then I noticed that the installed version was rpm-ostree-2025.1-1.fc41.x86_64. I created an image from quay.io/jmarrero_rh/fedora-bootc:kernel-install-41 with rpm-ostree-2025.2-1.fc41.x86_64 and tested the kernel-6.12.11-200.fc41 again. At least on my side, both versions rpm-ostree-2025.1-1.fc41.x86_64 and rpm-ostree-2025.2-1.fc41.x86_64 were able to upgrade the kernel.

1 Like

Looks like all concerns in kernel-install: integration by jmarrero · Pull Request #5135 · coreos/rpm-ostree · GitHub are resolved. Thanks!

We are investigating: 2342078 – dnf errors relating to kernel-install when updating kernel, rpm-ostree-2025.2-1 is installed which seems to affect some package based systems at boot time. Which might delay this a bit.

1 Like

In a nutshell if you want to test this in a bootc image, you need:

For example, starting from a CentOS Stream 9 image:

FROM quay.io/centos-bootc/centos-bootc:stream9

RUN <<EORUN
set -xeuo pipefail
arch=$(arch)
dnf -y upgrade https://composes.stream.centos.org/development/CentOS-Stream-9-20250203.d.0/compose/AppStream/${arch}/os/Packages/rpm-ostree-{,libs-}2025.4-1.el9.${arch}.rpm
if ! grep -q layout=ostree /usr/lib/kernel/install.conf; then
  echo layout=ostree >> /usr/lib/kernel/install.conf
fi

# Replace the kernel here
dnf -y upgrade kernel 

ls -ald /usr/lib/modules/*

dnf clean all
bootc container lint
EORUN

In addition to CentOS Stream 9, I also tested the following Containerfile for Fedora 41.

FROM quay.io/fedora/fedora-bootc:41

RUN <<EORUN
set -xeuo pipefail
# rpm-ostree-2025.4-2.fc41
dnf -y upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2025-4c48f77d75
if ! grep -q layout=ostree /usr/lib/kernel/install.conf; then
  echo layout=ostree >> /usr/lib/kernel/install.conf
fi

# Replace the kernel here
# kernel-6.12.12-200.fc41
dnf -y upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2025-d00af34217

ls -ald /usr/lib/modules/*

dnf clean all
bootc container lint
EORUN

Both images build successfully and boots in VM.