Skip to content

packaging: ship the build and source links in linux-headers - #196

Merged
Bjordis Collaku (bjordiscollaku) merged 1 commit into
mainfrom
fix/headers-own-build-links
Nov 25, 2026
Merged

Bjordis Collaku (bjordiscollaku) merged 1 commit into
mainfrom
fix/headers-own-build-links

Conversation

@bjordiscollaku

@bjordiscollaku Bjordis Collaku (bjordiscollaku) commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

dkms cannot build modules against our kernels when only the headers are installed:

Error! Your kernel headers for kernel 7.3.0+qcom-7.3-20261118-g808b7899155b
cannot be found at /lib/modules/<kver>/build or /lib/modules/<kver>/source.

/usr/lib/modules/<kver>/build and source are shipped by linux-image-<kver>, so they exist only while the image is installed. Debian ships them in linux-headers-<kver>, and that is what dkms and any module build environment installing the headers alone rely on.

The headers package also has no postinst, so dkms's /etc/kernel/header_postinst.d hook never runs: headers installed after the image build nothing until dkms is run by hand.

Move both links into linux-headers-<kver> and add a postinst that runs linux-run-hooks headers postinst, as Debian's does, depending on linux-base for it. Add Breaks/Replaces on linux-image-<kver> (<< same version) so a rebuild of the same kernel release can take the links over, and ${shlibs:Depends} for the compiled tools under scripts/.

Also drop the make headers_install step debian/README.md still lists for the headers package; d869521 removed it from debian/rules.

Built natively on arm64 from qcom-7.3-20261118 and validated in a clean Debian trixie container against kgsl-dkms 2.0.1 from qli:

  • headers alone: links present and owned by linux-headers, dkms build succeeds (fails with the published packages)
  • headers installed after the image: kgsl built and installed by the new postinst
  • upgrade from the published 0qli1 image and headers: no file conflict, links owned by linux-headers, dkms build succeeds
  • published image plus new headers: Replaces takes the links over, apt resolves Breaks by upgrading the image
  • purging the headers removes both links

Closes: #194

dkms cannot build modules against our kernels when only the headers are
installed:

  Error! Your kernel headers for kernel 7.3.0+qcom-7.3-20261118-g808b7899155b
  cannot be found at /lib/modules/<kver>/build or /lib/modules/<kver>/source.

/usr/lib/modules/<kver>/build and source are shipped by linux-image-<kver>,
so they exist only while the image is installed. Debian ships them in
linux-headers-<kver>, and that is what dkms and any module build
environment installing the headers alone rely on.

The headers package also has no postinst, so dkms's
/etc/kernel/header_postinst.d hook never runs: headers installed after the
image build nothing until dkms is run by hand.

Move both links into linux-headers-<kver> and add a postinst that runs
"linux-run-hooks headers postinst", as Debian's does, depending on
linux-base for it. Add Breaks/Replaces on linux-image-<kver> (<< same
version) so a rebuild of the same kernel release can take the links over,
and ${shlibs:Depends} for the compiled tools under scripts/.

Also drop the make headers_install step debian/README.md still lists for
the headers package; d869521 removed it from debian/rules.

Built natively on arm64 from qcom-7.3-20261118 and validated in a clean
Debian trixie container against kgsl-dkms 2.0.1 from qli:

 - headers alone: links present and owned by linux-headers, dkms build
   succeeds (fails with the published packages)
 - headers installed after the image: kgsl built and installed by the
   new postinst
 - upgrade from the published 0qli1 image and headers: no file conflict,
   links owned by linux-headers, dkms build succeeds
 - published image plus new headers: Replaces takes the links over,
   apt resolves Breaks by upgrading the image
 - purging the headers removes both links

Closes: #194
Signed-off-by: Bjordis Collaku <bcollaku@qti.qualcomm.com>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@bjordiscollaku
Bjordis Collaku (bjordiscollaku) merged commit 93a9484 into main Nov 25, 2026
65 checks passed
@bjordiscollaku
Bjordis Collaku (bjordiscollaku) deleted the fix/headers-own-build-links branch November 25, 2026 05:34

This branch was previously deployed

1 inactive deployment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

header packages fail to install /usr/lib/modules/$KVER, dkms unusable

2 participants