Skip to content

protect_running_kernel should default to false in a container #1703

@jmarrero

Description

@jmarrero

As part of the rpm-ostree and bootc images integration with kernel-install which enables users to use DNF to install, remove and replace kernels on container builds, we found that when the host kernel and the container kernel version matches the transaction gets blocked by protect_running_kernel default of True from removing the current kernel in the container image.

This is problematic on ostree/bootc systems as we can only have one kernel.

For now we have set it to False on our images configs, but this could have unintended consecuenses when someone enables a usroverlay as @cgwalters shared here: https://gitlab.com/fedora/bootc/base-images/-/merge_requests/149#note_2398660893

On that topic...something to bear in mind here is of course changes like this will affect dnf on the client side today too. So presumably this makes it even easier to do bootc usroverlay and accidentally dnf remove kernel or whatever. Which mostly will break dynamically loading modules, so not that big of a deal, and f course the great thing is, that change goes away on reboot.

While this is non-fatal I think the correct approach would be for DNF to be aware if it's running on a ostree/bootc container and if so default protect_running_kernel to False.

c.c. @evan-goode

Metadata

Metadata

Assignees

No one assigned

    Labels

    TriagedSomeone on the DNF 5 team has read the issue and determined the next steps to takechanges requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions