Skip to content
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

Longterm fedora kernel depends on different kernel-devel package #16742

Open
niclimcy opened this issue Nov 11, 2024 · 5 comments
Open

Longterm fedora kernel depends on different kernel-devel package #16742

niclimcy opened this issue Nov 11, 2024 · 5 comments
Labels
Component: Packaging custom packages Type: Defect Incorrect behavior (e.g. crash, hang)

Comments

@niclimcy
Copy link

System information

Type Version/Name
Distribution Name Fedora
Distribution Version 40
Kernel Version 6.6.59-200.fc40.x86_64
Architecture x86_64
OpenZFS Version 2.2.6

Describe the problem you're observing

rpm spec.in defines kernel-devel as required package: https://github.com/openzfs/zfs/blob/master/rpm/generic/zfs-dkms.spec.in#L33

However, relying on a longterm kernel package, the kernel-devel package name has a different name, kernel-longterm-devel.

Describe how to reproduce the problem

  1. Install kernel-longterm as per https://copr.fedorainfracloud.org/coprs/kwizart/kernel-longterm-6.6/
  2. Remove kernel-devel (as this tracks rolling release unsupported kernel)
  3. zfs and zfs-dkms are forced to uninstall

Include any warning/errors/backtraces from the system logs

niclim@fedora ~$ sudo dnf remove kernel-devel
Dependencies resolved.
===============================================================================================================================================================================
 Package                                   Architecture                        Version                                        Repository                                  Size
===============================================================================================================================================================================
Removing:
 kernel-devel                              x86_64                              6.10.3-200.fc40                                @@commandline                               71 M
 kernel-devel                              x86_64                              6.11.6-200.fc40                                @updates                                    75 M
Removing dependent packages:
 zfs                                       x86_64                              2.2.6-1.fc40                                   @@System                                   1.8 M
 zfs-dkms                                  noarch                              2.2.6-1.fc40                                   @@System                                    57 M

Transaction Summary
===============================================================================================================================================================================
Remove  4 Packages

Freed space: 206 M
Is this ok [y/N]:
@niclimcy niclimcy added the Type: Defect Incorrect behavior (e.g. crash, hang) label Nov 11, 2024
@behlendorf behlendorf added the Component: Packaging custom packages label Nov 20, 2024
@JMOdero
Copy link

JMOdero commented Dec 15, 2024

Different circumstances but similar issue reported HERE.

I'm using Fedora Linux Asahi Remix 40 (Server Edition) with kernel Linux 6.12.1-404.asahi.fc40.aarch64+16k bare metal on an M1 mac mini.

Apple silicon macs use 16k pages so they use kernel-16k-devel instead of kernel-devel. A work around for ZFS 2.2.7-1 is posted HERE.

There needs to be a way for the the distro type to be recognized and the appropriate kernel-devel nomenclature to be selected. Or maybe it can be user selected somehow... other than a manual find/replace in various files.

@AllKind
Copy link
Contributor

AllKind commented Dec 16, 2024

I'm no fedora user, but reading this: https://rpm-software-management.github.io/rpm/manual/boolean_dependencies.html

Something like this using boolean operators should in theory work:

Requires:      ((kernel-devel >= @ZFS_META_KVER_MIN@, kernel-devel <= @[email protected]) or (kernel-longerm-devel >= @ZFS_META_KVER_MIN@, kernel-longterm-devel <= @[email protected]))
Requires(post): ((kernel-devel >= @ZFS_META_KVER_MIN@, kernel-devel <= @[email protected]) or (kernel-longerm-devel >= @ZFS_META_KVER_MIN@, kernel-longterm-devel <= @[email protected]))
Conflicts:      ((kernel-devel < @ZFS_META_KVER_MIN@, kernel-devel > @[email protected]) or (kernel-longterm-devel < @ZFS_META_KVER_MIN@, kernel-longterm-devel > @[email protected]))

@JMOdero
Copy link

JMOdero commented Dec 19, 2024

I'm no fedora user, but reading this: https://rpm-software-management.github.io/rpm/manual/boolean_dependencies.html

Something like this using boolean operators should in theory work:

Requires:      ((kernel-devel >= @ZFS_META_KVER_MIN@, kernel-devel <= @[email protected]) or (kernel-longerm-devel >= @ZFS_META_KVER_MIN@, kernel-longterm-devel <= @[email protected]))
Requires(post): ((kernel-devel >= @ZFS_META_KVER_MIN@, kernel-devel <= @[email protected]) or (kernel-longerm-devel >= @ZFS_META_KVER_MIN@, kernel-longterm-devel <= @[email protected]))
Conflicts:      ((kernel-devel < @ZFS_META_KVER_MIN@, kernel-devel > @[email protected]) or (kernel-longterm-devel < @ZFS_META_KVER_MIN@, kernel-longterm-devel > @[email protected]))

I don't think all those parenthesis will work...
error: line 33: Unknown rich dependency op 'kernel-devel': Requires: ((kernel-devel >= 4.18, kernel-devel <= 6.12.999) or (kernel-16k-devel >= 4.18, kernel-16k-devel <= 6.12.999))

I went with this...
kernel-devel >= @ZFS_META_KVER_MIN@, kernel-devel <= @[email protected] or kernel-16k-devel >= @ZFS_META_KVER_MIN@, kernel-16k-devel <= @[email protected]

The compiler was happier...

Processing files: zfs-dkms-2.2.7-1.fc40.noarch
Provides: zfs-dkms = 2.2.7-1.fc40 zfs-kmod = 2.2.7
Requires(interp): /bin/sh /bin/sh /bin/sh
Requires(rpmlib): rpmlib(CompressedFileNames) <= 3.0.4-1 rpmlib(FileDigests) <= 4.6.0-1 rpmlib(PayloadFilesHavePrefix) <= 4.0-1
Requires(pre): /bin/sh dkms >= 2.2.0.3
Requires(post): /bin/sh diffutils dkms >= 2.2.0.3 gcc kernel-16k-devel >= 4.18 kernel-16k-devel <= 6.12.999 kernel-devel >= 4.18 kernel-devel <= 6.12.999 make or perl
Requires(preun): /bin/sh dkms >= 2.2.0.3
Obsoletes: spl-dkms <= 2.2.7

Unfortunately I already have 2.2.7 installed and I don't think you can run Asahi Linux in a vm, so I will have to wait for the next zfs release to test this out fully. Thanks for the nudge in what I hope is the right direction.

@JMOdero
Copy link

JMOdero commented Dec 21, 2024

Unfortunately I tested the two boolean instructions that were discussed, and I couldn't install either. The only thing that worked was changing kernel-devel to kernel-16k-devel in all the spec files. Everything worked once I did that. I didn't have to do anything else.

I don't know. There seems like there is something there with the boolean operation. I just need to figure out the right syntax.

niclimcy have you tried going into the "rpm" directory and replacing "kernel-devel" with "kernel-longterm-devel" in all the .spec files? It's clumsy, but I think you may like the result. Try it and let us know.

Download the tarball. Open/expand it, and edit the .spec files. Then .configure. Then compile and install. It worked for my 16k page file issue.

@niclimcy
Copy link
Author

Unfortunately I tested the two boolean instructions that were discussed, and I couldn't install either. The only thing that worked was changing kernel-devel to kernel-16k-devel in all the spec files. Everything worked once I did that. I didn't have to do anything else.

I don't know. There seems like there is something there with the boolean operation. I just need to figure out the right syntax.

niclimcy have you tried going into the "rpm" directory and replacing "kernel-devel" with "kernel-longterm-devel" in all the .spec files? It's clumsy, but I think you may like the result. Try it and let us know.

Download the tarball. Open/expand it, and edit the .spec files. Then .configure. Then compile and install. It worked for my 16k page file issue.

This is not a solution. It will definitely work but not a solution for all red hat systems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Packaging custom packages Type: Defect Incorrect behavior (e.g. crash, hang)
Projects
None yet
Development

No branches or pull requests

4 participants