-
-
Notifications
You must be signed in to change notification settings - Fork 14.1k
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
Documentation Issue: How to rebuild a kernel with a custom kernel config #178476
Comments
I believe the error is because you are trying to use just a kernel for kernelPackages, while that includes other things as well (e.g. an nvidia driver). See e.g. base = linuxPackages.kernel;
tinyLinuxPackages = linuxKernel.customPackage {
inherit (base) version src;
allowImportFromDerivation = false;
configfile = linuxConfig {
makeTarget = "tinyconfig";
src = base.src;
};
};
|
So how am I supposed to use the linuxPackages_custom_tinyconfig_kernel definiton to build my own kernel ? Because if I do a
in an overlay, I still get errors like this:
I'm therefore asking, again: can someone show me how to rebuild a kernel with a custom kernel config, in a nixos system, with the context regarding how to do it (e.g. specifying if it's in an overlay, and so on). Thanks |
Trying to make the doc a bit better in #207095 |
Context
Reading the manual, in particular https://nixos.org/manual/nixos/stable/index.html#sec-linux-config-customizing, I don't understand how to use the excerpt:
Seeing the
super
, I assume you have to use it in an overlay, e.g. :which complains about
linuxKernel
not being defined, e.gerror: undefined variable 'linuxKernel'
, so I replacelinuxKernel
withsuper.linuxKernel
.I then use
boot.kernelPackages = pkgs.custom-kernel;
to use this kernel package, which gives me this error:I tried adding lib to the inherited variables, next to
hostPlatform
, but I then get this error:At this point I stopped trying to recompile the kernel with a custom config because it seems I misunderstood how to recompile a customized kernel.
I also tried following the wiki, in particular, https://nixos.wiki/wiki/Linux_kernel#Booting_a_kernel_from_a_custom_source, without much success (the config was not taken into account).
Question
How are you supposed to recompile a nixos linux kernel using a custom
.config
file ? Can the doc be improved with more details on the procedure ?Technical details
Please run
nix-shell -p nix-info --run "nix-info -m"
and paste the result.The text was updated successfully, but these errors were encountered: