RFE: provide an akmod package
for RHEL-based distros, there is a middle-ground between zfs-dkms (everything compiled every time) and zfs-kmod (statically built packages that don't usually survive a RHEL minor upgrade): provide an akmod package.
Please allow me to provide an example with NVidia proprietary drivers on RHEL (from either Megativo17 or rpmfusionorg):
The repo (here negativo17) provides 3 packages: akmod-nvidia : akmod source of the nvidia driver: dkms-nvidia : dkms source of the nvidia set of drivers kmod-nvidia : static rpm for kABI-compatible loading
All of these are mutually exclusive. When installed, the akmod rpm will build a version of the nvidia drivers for the current kernel -AND- it will also package them as a kmod which is then injected into the RHEL-like distro.
Here a RHEL8.10 machine where only akmod-nvidia is installed:
# rpm -q kmod-nvidia dkms-nvidia akmod-nvidia
package kmod-nvidia is not installed
package dkms-nvidia is not installed
akmod-nvidia-565.77-1.el8.x86_64There is a fresh kmod-nvidia- rpm installed:
# rpm -qa kmod-nvidia*
kmod-nvidia-4.18.0-553.el8_10-565.77-1.el8.x86_64
# modinfo -F filename nvidia
/lib/modules/4.18.0-553.34.1.el8_10.x86_64/extra/nvidia/nvidia.ko.xz
# rpm -qf /lib/modules/4.18.0-553.34.1.el8_10.x86_64/extra/nvidia/nvidia.ko.xz
kmod-nvidia-4.18.0-553.el8_10-565.77-1.el8.x86_64
# rpm -ql kmod-nvidia-4.18.0-553.el8_10-565.77-1.el8.x86_64
/lib/modules/4.18.0-553.34.1.el8_10.x86_64/extra
/lib/modules/4.18.0-553.34.1.el8_10.x86_64/extra/nvidia
/lib/modules/4.18.0-553.34.1.el8_10.x86_64/extra/nvidia/nvidia-drm.ko.xz
/lib/modules/4.18.0-553.34.1.el8_10.x86_64/extra/nvidia/nvidia-modeset.ko.xz
/lib/modules/4.18.0-553.34.1.el8_10.x86_64/extra/nvidia/nvidia-peermem.ko.xz
/lib/modules/4.18.0-553.34.1.el8_10.x86_64/extra/nvidia/nvidia-uvm.ko.xz
/lib/modules/4.18.0-553.34.1.el8_10.x86_64/extra/nvidia/nvidia.ko.xz
/usr/lib/.build-id
/usr/lib/.build-id/09
/usr/lib/.build-id/09/1d8b8c1b4ce72d1b2c33c5d0002405851a4688
/usr/lib/.build-id/48
/usr/lib/.build-id/48/b8f77095299017a7e0ba745a76dac5cf6b0817
/usr/lib/.build-id/8b
/usr/lib/.build-id/8b/de4f40dfaa043d03ea61137cb20b1304cbb28d
/usr/lib/.build-id/d3
/usr/lib/.build-id/d3/212c3b6a82e6d3a6be9e195575897ba3f3d150
/usr/lib/.build-id/fd
/usr/lib/.build-id/fd/c0cbcd4718432c138335842b9f6a3eae344531The appropriate kmod-nvidia- module got built when the system rebooted into RHEL for the first time with the akmod rpm installed. There are several advantages to this approach:
- thanks to akmod, this makes the nvidia driver better equipped to survive a minor upgrade on RHEL-like distros (RHELx.y to RHELx.y+1)
- Since the akmod rpm ultimately produces other rpms the binary modules produced are: 1) with a checksum in the rpmdb and 2) redistributable to systems with the kernel version but without a compiler.
- multiple kmod-nvidia- can coexist on the same system (similar to what dkms-nvidia does but unlike kmod-nvidia ).
RPMfusion has info on akmods here: https://rpmfusion.org/Packaging/KernelModules/Akmods
Here is an example from negativo17's repo:
akmod SPEC file: https://github.com/negativo17/nvidia-kmod/blob/master/nvidia-kmod.spec regular SPEC file: https://github.com/negativo17/kmod-nvidia/blob/master/kmod-nvidia.spec
Source: openzfs/zfs