Repository navigation
fix(packaging): build DKMS modules when kernel headers are configured - #34
Merged
Merged
Conversation
bindeb-pkg's linux-headers package has no maintainer scripts. When apt
configures linux-image before linux-headers, the image's DKMS hook skips
the kernel ("kernel headers ... do not seem to be installed") and nothing
reruns it, so the kernel boots without its DKMS modules. A SmoothNAS box
upgraded to 7.2.14-83 that way booted without ZFS: its pool didn't
import and SMB and NFS failed on the shares stored on it.
Give the headers package a postinst that runs
/etc/kernel/header_postinst.d on configure, as Debian's headers packages
do. The build fails if bindeb-pkg ever ships its own headers postinst,
rather than silently overwriting it.
Test: make check-headers-dkms-order (a new release CI step) installs
openzfs-zfs-dkms, then linux-image alone, then linux-headers in a Debian
13 container. ZFS must be absent after the image (negative control) and
built for the kernel, with its vermagic, after the headers.
JBailes
force-pushed
the
fix/headers-rerun-dkms
branch
from
November 2, 2026 12:33
ffff8ca to
538003f
Compare
The new headers postinst builds DKMS modules when the headers are configured, and check-headers-dkms-order failed on amd64 doing it: dpkg could not configure linux-headers-7.2.15-86-smoothkernel. The headers ship a prebuilt tools/objtool/objtool, which links libelf.so.1 and runs in every x86 out-of-tree build, but bindeb-pkg declares no Depends, and neither dkms nor openzfs-zfs-dkms pulls libelf in. arm64 passed because it has no objtool. SmoothNAS boxes only worked because the smoothnas package depends on libelf-dev. - build-kernel.sh reads what each ELF tool in the headers package links and adds the matching Depends (libelf1t64 | libelf1, libssl3t64 | libssl3 for sign-file); a library with no package mapping fails the build instead of shipping a package that cannot build modules. - check-headers-dkms-order.sh no longer discards apt output: a failed step prints its apt/dpkg output, dkms status and every DKMS make.log, so the CI log says why. Its container stays minimal on purpose.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
bindeb-pkg's linux-headers package has no maintainer scripts. When apt configures linux-image before linux-headers, the image's DKMS hook skips the kernel ("kernel headers ... do not seem to be installed") and nothing reruns it, so the kernel boots without its DKMS modules. A SmoothNAS box upgraded to 7.2.14-83 that way booted without ZFS: its pool didn't import and SMB and NFS failed on the shares stored on it.
Give the headers package a postinst that runs
/etc/kernel/header_postinst.d on configure, as Debian's headers packages do. The build fails if bindeb-pkg ever ships its own headers postinst, rather than silently overwriting it.
Test: make check-headers-dkms-order (a new release CI step) installs openzfs-zfs-dkms, then linux-image alone, then linux-headers in a Debian 13 container. ZFS must be absent after the image (negative control) and built for the kernel, with its vermagic, after the headers.