Skip to content

RPM: Hold back incompatible kernel packages on Fedora #17271

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 30, 2025

Conversation

tonyhutter
Copy link
Contributor

@tonyhutter tonyhutter commented Apr 24, 2025

Motivation and Context

Closes: #17265

Description

A user reported that when your upgrade your kernel packages on Fedora with ZFS installed, only the kernel-devel package gets held back to the ZFS-supported version, but not the other kernel packages. So if ZFS only supports the 6.13 kernel, Fedora will still happily upgrade the kernel RPMs to 6.14, but hold back kernel-devel at 6.13, for example.
This commit includes version checks for the 'kernel' dependency, typically provided by the 'kernel-core' package.

Original-patch-by: @jkool702

How Has This Been Tested?

I tested this on Fedora 41:

  1. Downgrade kernel packages from 6.13 -> 6.11
  2. Install zfs-2.3.0 (supports up to 6.12 kernel)
  3. Remove ZFS repo so it doesn't update past zfs-2.3.0
  4. Ran dnf update and verified it only held back kernel-devel, and not the other kernel packages.
  5. Added this commit to zfs-2.3.0 source and rebuilt dkms packages
  6. Installed new modified zfs-2.3.0 packages.
  7. Ran a dnf update and saw it hold back everything:
$ sudo dnf update
Updating and loading repositories:
Repositories loaded.
Problem 1: installed package zfs-dkms-2.3.0-1_g80884de7e.fc41.noarch conflicts with kernel-modules-core > 6.12.999 provided by kernel-modules-core-6.13.12-200.fc41.x86_64 from updates
  - cannot install the best update candidate for package kernel-modules-core-6.11.11-300.fc41.x86_64
  - problem with installed package
 Problem 2: installed package zfs-dkms-2.3.0-1_g80884de7e.fc41.noarch conflicts with kernel > 6.12.999 provided by kernel-core-6.13.12-200.fc41.x86_64 from updates
  - installed package zfs-dkms-2.3.0-1_g80884de7e.fc41.noarch conflicts with kernel-core > 6.12.999 provided by kernel-core-6.13.12-200.fc41.x86_64 from updates
  - installed package zfs-2.3.0-1_g80884de7e.fc41.x86_64 requires zfs-kmod = 2.3.0, but none of the providers can be installed
  - cannot install the best update candidate for package kernel-core-6.11.11-300.fc41.x86_64
  - problem with installed package
 Problem 3: installed package zfs-2.3.0-1_g80884de7e.fc41.x86_64 requires zfs-kmod = 2.3.0, but none of the providers can be installed
  - installed package zfs-dkms-2.3.0-1_g80884de7e.fc41.noarch conflicts with kernel > 6.12.999 provided by kernel-core-6.13.12-200.fc41.x86_64 from updates
  - installed package zfs-dkms-2.3.0-1_g80884de7e.fc41.noarch conflicts with kernel-core > 6.12.999 provided by kernel-core-6.13.12-200.fc41.x86_64 from updates
  - installed package zfs-dracut-2.3.0-1_g80884de7e.fc41.noarch requires zfs >= 2.3.0, but none of the providers can be installed
  - cannot install the best update candidate for package kernel-core-6.11.4-301.fc41.x86_64
  - problem with installed package
 Problem 4: installed package zfs-2.3.0-1_g80884de7e.fc41.x86_64 requires zfs-kmod = 2.3.0, but none of the providers can be installed
  - installed package zfs-dkms-2.3.0-1_g80884de7e.fc41.noarch conflicts with kernel-devel > 6.12.999 provided by kernel-devel-6.13.12-200.fc41.x86_64 from updates
  - installed package zfs-test-2.3.0-1_g80884de7e.fc41.x86_64 requires zfs(x86-64) = 2.3.0-1_g80884de7e.fc41, but none of the providers can be installed
  - cannot install the best update candidate for package kernel-devel-6.11.4-301.fc41.x86_64
  - problem with installed package

Package                                                                 Arch             Version                                                                  Repository                                    Size
Skipping packages with conflicts:
 kernel-core                                                            x86_64           6.13.12-200.fc41                                                         updates                                   75.3 MiB
 kernel-devel                                                           x86_64           6.13.12-200.fc41                                                         updates                                   77.8 MiB
 kernel-modules-core                                                    x86_64           6.13.12-200.fc41                                                         updates                                   37.8 MiB

Nothing to do.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Performance enhancement (non-breaking change which improves efficiency)
  • Code cleanup (non-breaking change which makes code smaller or more readable)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Library ABI change (libzfs, libzfs_core, libnvpair, libuutil and libzfsbootenv)
  • Documentation (a change to man pages or other documentation)

Checklist:

@tonyhutter tonyhutter added Type: Building Indicates an issue related to building binaries Component: Packaging custom packages and removed Type: Building Indicates an issue related to building binaries labels Apr 24, 2025
@jkool702
Copy link

jkool702 commented Apr 25, 2025

EDIT now that ive actually tested it.

I think that we might actually need something more like tonyhutter@f606c29 to have DNF work reasonably. Use "Requires" and "Conflicts" for the kernel packages zfs actually requires, and just use "Conflicts" for most things it'll prevent ther new kernel packages from installing without breaking DNF and will not cause zfs-dkms to needlessly pull

Details of "why" are in #17265 (#17265 (comment)), but basically Im hoping that by just using "Conflicts" for most things it'll prevent the incompatable new kernel packages from installing without breaking DNF and will not cause zfs-dkms to needlessly pull in all the kernel subpackages.

Ive tested this and it seemingly makes everything work like it should on 2.3.1 with an available kernel 6.14.3 update. See #17265 (comment) for a more details.

@jkool702
Copy link

jkool702 commented Apr 25, 2025

@tonyhutter - I made a PR with the changes described in my last comment to the tonyhutter/zfs branch that is the source of this PR.

@tonyhutter
Copy link
Contributor Author

It's more of a formality, but I will need to add these for RHEL8 (RHEL9 uses kernel-modules-core):

Requires:       kernel-modules >= @ZFS_META_KVER_MIN@, kernel-modules-core <= @[email protected]
Requires(post): kernel-modules >= @ZFS_META_KVER_MIN@, kernel-modules-core <= @[email protected]
Conflicts:      kernel-modules < @ZFS_META_KVER_MIN@, kernel-modules-core > @[email protected]

Let me do that and retest.

@tonyhutter tonyhutter force-pushed the fedora-kernel-conflict branch 2 times, most recently from 2addcea to 1fbe3d7 Compare April 28, 2025 21:57
@tonyhutter
Copy link
Contributor Author

I ended up refactoring this PR to just add...

Requires:       kernel >= @ZFS_META_KVER_MIN@, kernel <= @[email protected]
Requires(post): kernel >= @ZFS_META_KVER_MIN@, kernel <= @[email protected]
Conflicts:      kernel < @ZFS_META_KVER_MIN@, kernel > @[email protected]

... and nothing else. The 'kernel' dependency is typically provided by the 'kernel-core' package. That should be all we need to build the dkms packages on EL and Fedora. I'm pretty convinced this minimalist route is the best way to go. The alternative is add Conflicts lines for every kernel related package, even though ZFS doesn't require them, which seems wrong, and requires constant whack-a-mole whenever distros add a new kernel-* package.

@jkool702
Copy link

@tonyhutter - I see the appeal of the minamalist route. im less convinced, but this in probably a reasonable initial change to make.

I guess my thoughts are that is that its less about "what zfs needs" and more about "not letting the system install stuff that will be broken as a direct result of things zfs is blocking". This is an incompatable kernel, and so (sort of by definition) zfs wont have what it needs until there is an update for zfs that supports the new kernel.

In many ways, the existing behavior is the minimalist route - zfs blocks only what is needed to prevent building potentially broken zfs kernel modules and leaves everything else alone. And, ignoring everything other than zfs, it achieved this goal quite well. The issues caused werent really "problems with zfs", but were "problems from installing a kernel that couldnt build new modules on a system that uses locally-compiled kernel modules".

I feel like blocking kernel-core but not blocking the rest of the kernel packages is sort of just trading one "problem stemming from a partially installed kernel" for another. Granted, installing things like kernel-modules-extra for kernels that arent installed on the system is probably a less severe problem. However...I cant think of many situations where these modules would be useful (exclusing for kernel developers), but I can think of a few where they might cause issues (e.g., with anything that assumes that the existance of /lib/modules/$kver means that kernel $kver is installed).

That said, not having to constantly update the list of kernel subpackages to block and notr blocking stuff zfs never uses are both a big plus, and it should be much better than the current situation, and having something like kernel-modules-extra update early mightr not cause any big problems, so...just blocking kernel is probably a reasonable initial change.

@tonyhutter
Copy link
Contributor Author

I guess my thoughts are that is that its less about "what zfs needs" and more about "not letting the system install stuff that will be broken as a direct result of things zfs is blocking".

You might have some stray kernel-related packages like kernel-docs get installed, but it's not going to break anything. If something did break, then that means the distro packages don't have the correct dependencies in their spec file.

In many ways, the existing behavior is the minimalist route - zfs blocks only what is needed to prevent building potentially broken zfs kernel modules and leaves everything else alone.

The kernel-modules-core package requires a kernel (via Requires: kernel-uname-r = <kernel version>), so it stands to reason that our ZFS dkms kernel module package should require one as well. That just makes sense logically too. The user is going to want to build AND load the module, so it needs to require both kernel-devel and kernel.

Granted, installing things like kernel-modules-extra for kernels that arent installed on the system is probably a less severe problem. However...I cant think of many situations where these modules would be useful (exclusing for kernel developers), but I can think of a few where they might cause issues (e.g., with anything that assumes that the existance of /lib/modules/$kver means that kernel $kver is installed).

I don't think this would be the case. The modules* packages requre a specific kernel. Here's what I see on Fedora 41:

$ rpm -q kernel-modules --requires | grep kernel
kernel-modules-core-uname-r = 6.11.4-301.fc41.x86_64
kernel-uname-r = 6.11.4-301.fc41.x86_64

$ rpm -q kernel-modules-core --requires | grep kernel
kernel-uname-r = 6.11.11-300.fc41.x86_64
kernel-uname-r = 6.11.4-301.fc41.x86_64

$ rpm -q kernel-modules-extra --requires | grep kernel
kernel-modules-core-uname-r = 6.11.4-301.fc41.x86_64
kernel-modules-uname-r = 6.11.4-301.fc41.x86_64
kernel-uname-r = 6.11.4-301.fc41.x86_64

@jkool702
Copy link

I rebuilt the zfs-dkms rpm using the zfs-2.3-release branch with the patch you propose (using Requires + Conflicts for kervel-devel and kernel, but no other kernel packages explicitly listed). Running dnf update currently gives me the following

Problem 1: installed package zfs-dkms-2.3.1-1.fc41.noarch conflicts with kernel > 6.13.999 provided by kernel-6.14.4-200.fc41.x86_64 from updates
  - cannot install the best update candidate for package zfs-dkms-2.3.1-1.fc41.noarch
  - cannot install the best update candidate for package kernel-6.12.15-200.fc41.x86_64
 Problem 2: problem with installed package
  - installed package zfs-dkms-2.3.1-1.fc41.noarch conflicts with kernel > 6.13.999 provided by kernel-6.14.4-200.fc41.x86_64 from updates
  - package zfs-dkms-2.3.1-1.fc41.noarch from localrepo-all conflicts with kernel > 6.13.999 provided by kernel-6.14.4-200.fc41.x86_64 from updates
  - package zfs-dkms-2.3.1-1.fc41.noarch from localrepo-built conflicts with kernel > 6.13.999 provided by kernel-6.14.4-200.fc41.x86_64 from updates
  - package zfs-dkms-2.3.1-1.fc41.noarch from localrepo-built-41 conflicts with kernel > 6.13.999 provided by kernel-6.14.4-200.fc41.x86_64 from updates
  - package zfs-dkms-2.3.1-1.fc41.noarch from localrepo-built-41-noarch conflicts with kernel > 6.13.999 provided by kernel-6.14.4-200.fc41.x86_64 from updates
  - cannot install the best update candidate for package kernel-6.13.11-200.fc41.x86_64

Package                                                                                                       Arch                   Version                                                                                                       Repository                                                          Size
Removing:
 kernel-modules                                                                                               x86_64                 6.12.15-200.fc41                                                                                              updates                                                         62.4 MiB
 kernel-modules-core                                                                                          x86_64                 6.12.15-200.fc41                                                                                              updates                                                         37.1 MiB
 kernel-modules-extra                                                                                         x86_64                 6.12.15-200.fc41                                                                                              updates                                                          2.7 MiB
 kernel-modules-internal                                                                                      x86_64                 6.12.15-200.fc41                                                                                              updates                                                          1.2 MiB
Removing dependent packages:
 kernel                                                                                                       x86_64                 6.12.15-200.fc41                                                                                              updates                                                          0.0   B
 kernel-core                                                                                                  x86_64                 6.12.15-200.fc41                                                                                              updates                                                         73.5 MiB
 kmod-nvidia-6.12.15-200.fc41.x86_64                                                                          x86_64                 3:570.144-1.fc41                                                                                              @commandline                                                   131.6 MiB
Upgrading:
 egl-x11                                                                                                      x86_64                 1.0.1-1.fc41                                                                                                  updates                                                        165.6 KiB
   replacing egl-x11                                                                                          x86_64                 1.0.1~20250324git0558d54-5.fc41                                                                               updates                                                        165.6 KiB
 kernel-cross-headers                                                                                         x86_64                 6.14.3-200.fc41                                                                                               updates                                                         39.3 MiB
   replacing kernel-cross-headers                                                                             x86_64                 6.13.3-200.fc41                                                                                               updates                                                         39.0 MiB
 kernel-doc                                                                                                   noarch                 6.14.4-200.fc41                                                                                               updates                                                        217.8 MiB
   replacing kernel-doc                                                                                       noarch                 6.13.12-200.fc41                                                                                              updates                                                        218.8 MiB
 kernel-headers                                                                                               x86_64                 6.14.3-200.fc41                                                                                               updates                                                          6.5 MiB
   replacing kernel-headers                                                                                   x86_64                 6.13.3-200.fc41                                                                                               updates                                                          6.5 MiB
 kernel-tools                                                                                                 x86_64                 6.14.4-200.fc41                                                                                               updates                                                          2.2 MiB
   replacing kernel-tools                                                                                     x86_64                 6.13.12-200.fc41                                                                                              updates                                                        950.2 KiB
 kernel-tools-libs                                                                                            x86_64                 6.14.4-200.fc41                                                                                               updates                                                         34.3 KiB
   replacing kernel-tools-libs                                                                                x86_64                 6.13.12-200.fc41                                                                                              updates                                                         34.3 KiB
 kernel-tools-libs-devel                                                                                      x86_64                 6.14.4-200.fc41                                                                                               updates                                                          1.4 MiB
   replacing kernel-tools-libs-devel                                                                          x86_64                 6.13.12-200.fc41                                                                                              updates                                                          7.9 KiB
 perf                                                                                                         x86_64                 6.14.4-200.fc41                                                                                               updates                                                         10.8 MiB
   replacing perf                                                                                             x86_64                 6.13.12-200.fc41                                                                                              updates                                                         10.8 MiB
 python3-perf                                                                                                 x86_64                 6.14.4-200.fc41                                                                                               updates                                                          8.4 MiB
   replacing python3-perf                                                                                     x86_64                 6.13.12-200.fc41                                                                                              updates                                                          8.8 MiB
 teamviewer                                                                                                   x86_64                 15.65.4-0                                                                                                     teamviewer                                                     393.8 MiB
   replacing teamviewer                                                                                       x86_64                 15.64.3-0                                                                                                     teamviewer                                                     391.9 MiB
 wayland-protocols-devel                                                                                      noarch                 1.44-1.fc41                                                                                                   updates                                                        953.3 KiB
   replacing wayland-protocols-devel                                                                          noarch                 1.43-1.fc41                                                                                                   updates                                                        926.8 KiB
Installing:
 kernel-modules                                                                                               x86_64                 6.14.4-200.fc41                                                                                               updates                                                         64.7 MiB
 kernel-modules-core                                                                                          x86_64                 6.14.4-200.fc41                                                                                               updates                                                         38.7 MiB
 kernel-modules-extra                                                                                         x86_64                 6.14.4-200.fc41                                                                                               updates                                                          2.6 MiB
 kernel-modules-internal                                                                                      x86_64                 6.14.4-200.fc41                                                                                               updates                                                          1.5 MiB
Installing dependencies:
 kernel-uki-virt                                                                                              x86_64                 6.14.4-200.fc41                                                                                               updates                                                         68.2 MiB
Skipping packages with conflicts:
 kernel                                                                                                       x86_64                 6.14.4-200.fc41                                                                                               updates                                                          0.0   B

Looking into it, I think you also need to add a "Conflicts" for kernel-uki-virt. It seems that this package will provide the kernel-uname-r required by the kernel modules. Which is why dnf pulled tried to pull it in for me via "installing dependencies".

Ill re-test adding a Conflicts line for kernel-uki-virt and report back

@jkool702
Copy link

UPDATE: adding

Conflicts: kernel-uki-virt < @ZFS_META_KVER_MIN@, kernel-uki-virt > @[email protected]

on top of your patch seems to fix things. Running dnf update gives me


Problem 1: installed package zfs-dkms-2.3.1-1.fc41.noarch conflicts with kernel > 6.13.999 provided by kernel-6.14.4-200.fc41.x86_64 from updates
  - cannot install the best update candidate for package zfs-dkms-2.3.1-1.fc41.noarch
  - cannot install the best update candidate for package kernel-6.12.15-200.fc41.x86_64
 Problem 2: problem with installed package
  - installed package zfs-dkms-2.3.1-1.fc41.noarch conflicts with kernel > 6.13.999 provided by kernel-6.14.4-200.fc41.x86_64 from updates
  - package zfs-dkms-2.3.1-1.fc41.noarch from localrepo-all conflicts with kernel > 6.13.999 provided by kernel-6.14.4-200.fc41.x86_64 from updates
  - package zfs-dkms-2.3.1-1.fc41.noarch from localrepo-built conflicts with kernel > 6.13.999 provided by kernel-6.14.4-200.fc41.x86_64 from updates
  - package zfs-dkms-2.3.1-1.fc41.noarch from localrepo-built-41 conflicts with kernel > 6.13.999 provided by kernel-6.14.4-200.fc41.x86_64 from updates
  - package zfs-dkms-2.3.1-1.fc41.noarch from localrepo-built-41-noarch conflicts with kernel > 6.13.999 provided by kernel-6.14.4-200.fc41.x86_64 from updates
  - cannot install the best update candidate for package kernel-6.13.11-200.fc41.x86_64

Package                                                                                                       Arch                   Version                                                                                                       Repository                                                          Size
Upgrading:
 egl-x11                                                                                                      x86_64                 1.0.1-1.fc41                                                                                                  updates                                                        165.6 KiB
   replacing egl-x11                                                                                          x86_64                 1.0.1~20250324git0558d54-5.fc41                                                                               updates                                                        165.6 KiB
 kernel-cross-headers                                                                                         x86_64                 6.14.3-200.fc41                                                                                               updates                                                         39.3 MiB
   replacing kernel-cross-headers                                                                             x86_64                 6.13.3-200.fc41                                                                                               updates                                                         39.0 MiB
 kernel-doc                                                                                                   noarch                 6.14.4-200.fc41                                                                                               updates                                                        217.8 MiB
   replacing kernel-doc                                                                                       noarch                 6.13.12-200.fc41                                                                                              updates                                                        218.8 MiB
 kernel-headers                                                                                               x86_64                 6.14.3-200.fc41                                                                                               updates                                                          6.5 MiB
   replacing kernel-headers                                                                                   x86_64                 6.13.3-200.fc41                                                                                               updates                                                          6.5 MiB
 kernel-tools                                                                                                 x86_64                 6.14.4-200.fc41                                                                                               updates                                                          2.2 MiB
   replacing kernel-tools                                                                                     x86_64                 6.13.12-200.fc41                                                                                              updates                                                        950.2 KiB
 kernel-tools-libs                                                                                            x86_64                 6.14.4-200.fc41                                                                                               updates                                                         34.3 KiB
   replacing kernel-tools-libs                                                                                x86_64                 6.13.12-200.fc41                                                                                              updates                                                         34.3 KiB
 kernel-tools-libs-devel                                                                                      x86_64                 6.14.4-200.fc41                                                                                               updates                                                          1.4 MiB
   replacing kernel-tools-libs-devel                                                                          x86_64                 6.13.12-200.fc41                                                                                              updates                                                          7.9 KiB
 perf                                                                                                         x86_64                 6.14.4-200.fc41                                                                                               updates                                                         10.8 MiB
   replacing perf                                                                                             x86_64                 6.13.12-200.fc41                                                                                              updates                                                         10.8 MiB
 python3-perf                                                                                                 x86_64                 6.14.4-200.fc41                                                                                               updates                                                          8.4 MiB
   replacing python3-perf                                                                                     x86_64                 6.13.12-200.fc41                                                                                              updates                                                          8.8 MiB
 teamviewer                                                                                                   x86_64                 15.65.4-0                                                                                                     teamviewer                                                     393.8 MiB
   replacing teamviewer                                                                                       x86_64                 15.64.3-0                                                                                                     teamviewer                                                     391.9 MiB
 wayland-protocols-devel                                                                                      noarch                 1.44-1.fc41                                                                                                   updates                                                        953.3 KiB
   replacing wayland-protocols-devel                                                                          noarch                 1.43-1.fc41                                                                                                   updates                                                        926.8 KiB
Skipping packages with conflicts:
 kernel                                                                                                       x86_64                 6.14.4-200.fc41                                                                                               updates                                                          0.0   B

Transaction Summary:
 Upgrading:         11 packages
 Replacing:         11 packages
 Skipping:           1 package

You still get updated kernel docs + kernel tools + kernel headers + perf, but i dont think those will cause problems. Also it doesnt try to remove an old working kernel, so as far as dnf is concerned you arent installing a new kernel.

@tonyhutter
Copy link
Contributor Author

Looking into it, I think you also need to add a "Conflicts" for kernel-uki-virt. It seems that this package will provide the kernel-uname-r required by the kernel modules. Which is why dnf pulled tried to pull it in for me via "installing dependencies".

Ah that's annoying. Thanks for hunting down the issue though - I'll add in the kernel-uki-virt conflicts.

@jkool702
Copy link

jkool702 commented Apr 29, 2025

Ah that's annoying.

Yeah...I missed that the first go around too (when adding kernel + kernel-core as Requires and Conflicts didnt work).

That said, kernel-uki-virt seems to be Fedora's work-in-progress project for booting with unified kernel images. Id imagine that it isnt going anywhere and will probably start to get used more as the project gets everything ironed out (since GRUB-less UKI booting is fantastic).

you probably want both kernel and kernel-uki-virt listed as Conflicts, but for requires you probably want it to be "requires at least one of them". Perhaps for the Requires dependencies you want something like

Requires:       kernel-uname-r >= @ZFS_META_KVER_MIN@, kernel-uname-r <= @[email protected]
Requires(post): kernel-uname-r >= @ZFS_META_KVER_MIN@, kernel-uname-r <= @[email protected]

which (assuming it works like it did with the kernel modules packages) would allow either the standard kernel or kernel-uki-virt to satisfy it. (EDIT: assuming zfs works fine with kernel-uki-virt)

@tonyhutter
Copy link
Contributor Author

I think we can simplify all cases to just looking at kernel-uname-r:

Requires:       kernel-uname-r >= @ZFS_META_KVER_MIN@, kernel-uname-r <= @[email protected]
Requires(post): kernel-uname-r >= @ZFS_META_KVER_MIN@, kernel-uname-r <= @[email protected]
Conflicts:      kernel-uname-r < @ZFS_META_KVER_MIN@, kernel-uname-r > @[email protected]

@jkool702
Copy link

jkool702 commented Apr 29, 2025

I think we can simplify all cases to just looking at kernel-uname-r

I think this is the answer. As a bonus it is "futureproof" too, in the sense that if a 3rd core kernel package (beyond kernel and kernel-uki-virt) ever became available it wouldnt break things for ZFS.

EDIT: and I just had a realization that the entire point of the kernel-uname-r dependencies is to add dependencies based on the (uname -r style) kernel version. Looking at the dependencies it'll cover debug kernels too. This is the way.

@tonyhutter tonyhutter force-pushed the fedora-kernel-conflict branch from 1fbe3d7 to 495bab1 Compare April 29, 2025 21:46
A user reported that when your upgrade your kernel packages on Fedora
with ZFS installed, only the kernel-devel package gets held back to the
ZFS-supported version, but not the other kernel packages. So if ZFS only
supports the 6.13 kernel, Fedora will still happily upgrade the kernel
RPM to 6.14, but hold back kernel-devel at 6.13, for example.

This commit includes version checks for the 'kernel-uname-r' dependency,
typically provided by the 'kernel-core' package.

Closes: openzfs#17265

Original-patch-by: @jkool702
Signed-off-by: Tony Hutter <[email protected]>
@tonyhutter tonyhutter force-pushed the fedora-kernel-conflict branch from 495bab1 to 8eff9d4 Compare April 29, 2025 21:51
@tonyhutter
Copy link
Contributor Author

@jkool702 I pushed the kernel-uname-r change. Can I get an approval if you're happy with the the PR?

@jkool702
Copy link

@tonyhutter - it looks good to me, and worked correctly when I tested it. I rebuilt + installed the 2.3.1 zfs-dkms rpm with the kernel-uname-r change and can confirm it gives the desired behavior for dnf update - all the core kernel components are blocked and no old kernels are uninstalled. It lets through the kernel-dcos, kernel-[cross-]headers, kernel-tools and perf packages for the new/unsupported kernel, but I dont think those will cause any major issues (and if minor issues still arise from this we can revisit adding more conflicts in 2.3.3, but I dont think we'll need to).

Id be happy to give you an official approving review, but I dont have write access for openzfs/zfs.

@tonyhutter
Copy link
Contributor Author

@jkool702 if you click on the link to the commit in this PR, there's a green "Review changes" button at the top right:

image

Copy link

@jkool702 jkool702 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This commit fixes the issue on Fedora where DNF, when a kernel becaome available that wasnt compatible with the current ZFS version, DNF only blocked kernel-devel from installing and allowed the main kernel to still install. This caused many issues, since this kernel couldnt build any kmods (including for zfs) but still tried to, causing partial kernel installs.

With this change implemented, DNF now blocks kernel-devel and the core kernel packages for incompatible kernels from installing. I have tested this on a Fedora 41 install by reompiling the zfs 3.2.1 branch with this change and can confirm that dnf update now works as expected.

@behlendorf behlendorf added the Status: Accepted Ready to integrate (reviewed, tested) label Apr 30, 2025
@behlendorf behlendorf merged commit 81dec43 into openzfs:master Apr 30, 2025
16 of 17 checks passed
tonyhutter added a commit to tonyhutter/zfs that referenced this pull request Apr 30, 2025
A user reported that when your upgrade your kernel packages on Fedora
with ZFS installed, only the kernel-devel package gets held back to the
ZFS-supported version, but not the other kernel packages. So if ZFS only
supports the 6.13 kernel, Fedora will still happily upgrade the kernel
RPM to 6.14, but hold back kernel-devel at 6.13, for example.

This commit includes version checks for the 'kernel-uname-r' dependency,
typically provided by the 'kernel-core' package.

Original-patch-by: @jkool702
Reviewed-by: @jkool702
Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Tony Hutter <[email protected]>
Closes openzfs#17265
Closes openzfs#17271
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Packaging custom packages Status: Accepted Ready to integrate (reviewed, tested)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Hold back incompatible kernel packages on Fedora
3 participants