Skip to content

linuxPackages.system76{,-io}: install modules through modules_install - #575724

Merged
SuperSandro2000 merged 2 commits into
NixOS:masterfrom
yzhou216:system76-modules-install
Oct 21, 2026
Merged

SuperSandro2000 merged 2 commits into
NixOS:masterfrom
yzhou216:system76-modules-install

Conversation

@yzhou216

@yzhou216 yzhou216 commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

linuxPackages.system76 and linuxPackages.system76-io copy their modules into $out by hand, bypassing the Kbuild module installation. Since #571181, kernelModuleMakeFlags makes Kbuild sign each module with kmodigest during modules_install, which also writes <module>.ko.cer next to it, and aggregateModules merges the certificates of all external modules into modules.cer. The hand-copied modules have no certificates, so building a NixOS system with hardware.system76.enableAll fails:

cat: misc/system76-thelio-io.ko.cer: No such file or directory
cat: misc/system76-io.ko.cer: No such file or directory
cat: misc/system76.ko.cer: No such file or directory

Neither upstream Makefile has an install target, so both packages now call the Kbuild modules_install target directly, as @emilazy suggested for zenpower in #575192 (comment). Kbuild strips, signs, and compresses the modules and writes their certificates. The modules stay under misc/, and DEPMOD=true leaves depmod to aggregateModules.

INSTALL_MOD_STRIP=1 keeps the modules stripped. They used to be installed uncompressed, so the stdenv strip phase removed their debug information, but they are now compressed during installation, before that phase runs. Without it, system76.ko.xz grows from about 15 KB to 131 KB on 7.3-rc7.

Ref #575192

Testing

On x86_64-linux, I built config.system.modulesTree of a minimal NixOS configuration with hardware.system76.enableAll = true for linuxPackages (6.18.57) and linuxPackages_latest (7.2.11):

  • On master (0f871d2), both fail with the error above.
  • With this PR, both build. Every System76 module is signed, stripped, and compressed, and its certificate is merged into modules.cer.

The same change, applied as an override in my own configuration, also fixes its module tree build with linuxPackages_testing (7.3-rc7).

cc @ahoneybun

This PR was prepared with Claude (claude-opus-5-5); I reviewed and tested the changes myself.

Things done

The install phase copied system76.ko into the output by hand, bypassing
the Kbuild module installation.  Since NixOS#571181, kernelModuleMakeFlags
makes Kbuild sign each module with kmodigest during modules_install,
which also writes a certificate next to the module, and aggregateModules
merges the certificates of all external modules into modules.cer.  The
hand-copied module has neither, so building a NixOS system with
hardware.system76.enableAll fails:

    cat: misc/system76.ko.cer: No such file or directory

The upstream Makefile has no install target, so call the Kbuild
modules_install target directly, as suggested for zenpower in NixOS#575192.
It strips, signs, and compresses the module and writes its certificate.
Keep the module under misc and leave depmod to aggregateModules.  Set
INSTALL_MOD_STRIP=1, as compression now happens before the strip phase,
which used to remove the debug information.  The hwdb file moves to
postInstall.

Assisted-by: Claude (claude-opus-5-5)
The install phase copied system76-io.ko and system76-thelio-io.ko into
the output by hand, bypassing the Kbuild module installation.
Since NixOS#571181, kernelModuleMakeFlags makes Kbuild sign each module with
kmodigest during modules_install, which also writes a certificate next
to the module, and aggregateModules merges the certificates of all
external modules into modules.cer.  The hand-copied modules have
neither, so building a NixOS system with hardware.system76.enableAll
fails:

    cat: misc/system76-thelio-io.ko.cer: No such file or directory
    cat: misc/system76-io.ko.cer: No such file or directory

The upstream Makefile has no install target, so call the Kbuild
modules_install target directly, as suggested for zenpower in NixOS#575192.
It strips, signs, and compresses the modules and writes their
certificates.  Keep the modules under misc and leave depmod to
aggregateModules.  Set INSTALL_MOD_STRIP=1, as compression now happens
before the strip phase, which used to remove the debug information.

Assisted-by: Claude (claude-opus-5-5)
@yzhou216
yzhou216 force-pushed the system76-modules-install branch from 9da9b3c to 8043407 Compare October 18, 2026 19:32
@nixpkgs-ci
nixpkgs-ci Bot requested a review from ahoneybun October 18, 2026 19:39
@nixpkgs-ci nixpkgs-ci Bot added 10.rebuild-linux: 11-100 This PR causes between 11 and 100 packages to rebuild on Linux. 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. llm-assisted Contributions that include code generation with LLMs labels Oct 18, 2026
@ahoneybun

Copy link
Copy Markdown
Contributor

@yzhou216 can you share the steps that you used for testing this? I'm on 26.05 currently with whatever kernel is from the latest tag.

@SuperSandro2000

Copy link
Copy Markdown
Member

The failure only happens on unstable because of changes in the general kernel module infrastructure to support reproducible signing.

@nixpkgs-ci nixpkgs-ci Bot added the 12.approvals: 1 This PR was reviewed and approved by one person. label Oct 20, 2026
@yzhou216
yzhou216 requested review from Defelo and iamanaws October 20, 2026 20:04
@iamanaws

Copy link
Copy Markdown
Member

@yzhou216 please don't spam with review requests, Sandro (a commiter) already reviewed and approved the PR, be patient

@iamanaws
iamanaws removed their request for review October 20, 2026 20:32

@ahoneybun ahoneybun left a comment

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.

Always good to see less manual steps and some automation!

@nixpkgs-ci nixpkgs-ci Bot added 12.approvals: 2 This PR was reviewed and approved by two persons. 12.approved-by: package-maintainer This PR was reviewed and approved by a maintainer listed in any of the changed packages. and removed 12.approvals: 1 This PR was reviewed and approved by one person. labels Oct 20, 2026
@SuperSandro2000
SuperSandro2000 added this pull request to the merge queue Oct 21, 2026
Merged via the queue into NixOS:master with commit e4d4e51 Oct 21, 2026
36 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 11-100 This PR causes between 11 and 100 packages to rebuild on Linux. 12.approvals: 2 This PR was reviewed and approved by two persons. 12.approved-by: package-maintainer This PR was reviewed and approved by a maintainer listed in any of the changed packages. llm-assisted Contributions that include code generation with LLMs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants