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

linux: simplify and document kernel customisation #207095

Merged
merged 6 commits into from
Dec 27, 2022

Conversation

ncfavier
Copy link
Member

@ncfavier ncfavier commented Dec 21, 2022

Supersedes #178565, addresses #178476.

Fixes linuxKernel.customPackage { inherit (linux_6_1) src version; ... } failing because modDirVersion is set to 6.1 instead of 6.1.0 (although we should probably just get rid of customPackage...).

Rendered manual

Screenshot 2022-12-21 at 13-18-17 NixOS Manual

Pad a version string with zeros to match a given number of components.
@ncfavier
Copy link
Member Author

ncfavier commented Dec 21, 2022

cc @roberth for nixos/tests (see the next commit for motivation)

@K900
Copy link
Contributor

K900 commented Dec 21, 2022

The whole thing is very scuffed and desperately needs a rewrite, but this is an improvement.

Copy link
Member

@roberth roberth left a comment

Choose a reason for hiding this comment

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

I'll only comment on the nixos test related stuff.

The change is ok with me. I've kept it when converting from argument to option, but it seems like we don't need it, not in nixpkgs at least. Let's add a proper error message for it though, for outside use. See comment.

nixos/lib/testing/nodes.nix Show resolved Hide resolved
It's not used, doesn't build, and seems like the only reason to have
`manualConfig` take `stdenv` as an argument.
Reverts NixOS@7c7c83e which was
only needed for the minimal-kernel.nix test module and clutters the call site.

stdenv can still be overridden with `linuxManualConfig.override { stdenv = ...; }`.
Document the `linux.override` way first, then `linuxManualConfig`.

Add a `linux.configEnv` passthru attribute for quickly getting a
`make nconfig`-ready shell.
@roberth roberth mentioned this pull request Dec 22, 2022
13 tasks
@ncfavier ncfavier merged commit 3fc528f into NixOS:master Dec 27, 2022
@ncfavier ncfavier deleted the linux-custom-kernel branch December 27, 2022 16:10
@SaltyKitkat
Copy link
Contributor

I'm so appreciate that you provide such a detailed document about building a customized kernel.

Recently, I met some problem with building kernel with a different stdenv:

I can set the stdenv for the kernel itself, but I dont know how to set the stdenv for packages in kernelPackages since it's built by linuxPackagesFor. Would you please provide some idea to solve that?

@K900
Copy link
Contributor

K900 commented Nov 14, 2023

Please don't necro-bump PRs to ask questions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants