Skip to content

[RDY] kernel doc: explain how to configure custom kernel#29944

Merged
dezgeg merged 1 commit intoNixOS:masterfrom
teto:shell_doc
Jun 8, 2018
Merged

[RDY] kernel doc: explain how to configure custom kernel#29944
dezgeg merged 1 commit intoNixOS:masterfrom
teto:shell_doc

Conversation

@teto
Copy link
Member

@teto teto commented Sep 30, 2017

Motivation for this change

compiling kernel is currently hard, hopefully it will improve overtime. (for instance:

 nix-build <nixpkgs> --arg crossSystem '(import <nixpkgs/lib>).systems.examples.aarch64-multiplatform' -iA lin

$ nix-build -A linux_mptcp --arg 'localSystem' 'let lib = (import <nixpkgs/lib>); in lib.recursiveUpdate (lib.systems.elaborate { system = builtins.currentSystem; }) { platform = test-platform; }' '<nixpkgs>' --show-trace

)
Until then here is some doc.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option build-use-sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • Linux
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Fits CONTRIBUTING.md.

@GrahamcOfBorg GrahamcOfBorg added 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux. labels Nov 29, 2017
@teto teto mentioned this pull request Jan 19, 2018
8 tasks
@Ericson2314 Ericson2314 changed the title |wip] zsh doc: precise environment.shellAliases [wip] zsh doc: precise environment.shellAliases Jan 19, 2018
@Ericson2314 Ericson2314 added 2.status: work-in-progress 8.has: documentation This PR adds or changes documentation labels Jan 19, 2018
@teto teto force-pushed the shell_doc branch 2 times, most recently from 1fab0f1 to 57b35b1 Compare January 22, 2018 02:55
@teto teto mentioned this pull request Jan 22, 2018
8 tasks
@teto teto changed the title [wip] zsh doc: precise environment.shellAliases [wip] kernel doc: explain how to configure custom kernel Jan 22, 2018
@teto
Copy link
Member Author

teto commented Jan 22, 2018

My intent is to document the current way of customizing kernels but I would rather improve the situation.

@Ericson2314 I am very eager to ease kernel customization. My main question that remains unanswered (#2296): nixos generates first the config and then restarts the process (unpacking/patching) for the kernel compilation. Would it be ok to generate the config on the go instead ? Or does that break some workflow ?

@Ericson2314
Copy link
Member

@teto I haven't really looked at it, but I'm rather found of the idea of configuring in a separate step. Configuring is rarely as deterministic as we want it to be, and this silos it off from the rest. That would especially be good in a future with the intensional store.

But do feel free to improve before documenting :)

@teto
Copy link
Member Author

teto commented Jan 25, 2018

I prepare a patch that makes kernel overrides easier (i.e., moves fields out of platform), yet I lose my way when it comes to override hostPlatform from an overlay

  test-platform =  {
    name="zizou";
    kernelAutoModules = false;
    kernelExtraConfig = mptcpKernelExtraConfig ;
    ignoreConfigErrors = true;
    kernelPreferBuiltin = true;
  };

  # builtins.currentSystem returns "x86_64-linux"
  test-localSystem = let system = super.lib.systems.elaborate { system = builtins.currentSystem; };
   in super.lib.recursiveUpdate (system) { platform = system.platform // test-platform; };

  my_kernel = linux_mptcp.override ({
      modDirVersion="4.9.60-00010-g5a1ca10181c6";
      name="mptcp-local";
     # it doesn't seem used
      hostPlatform=test-localSystem;

In nix-repl:
my_kernel.configfile.platformName still prints "pc" while I expect "zizou".
I am trying to investigate what I do wrong but feel free to bump in if you have a solution :)

@Ericson2314
Copy link
Member

Ericson2314 commented Jan 25, 2018

@teto don't override hostPlatform on a derivation. That's not good. Just go straight to moving the config out of hostPlatform altogether, like you want it to be.

@teto teto mentioned this pull request Jan 28, 2018
8 tasks
@teto teto changed the title [wip] kernel doc: explain how to configure custom kernel [RFC] kernel doc: explain how to configure custom kernel May 14, 2018
@GrahamcOfBorg GrahamcOfBorg added the 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS label May 14, 2018
@teto
Copy link
Member Author

teto commented May 14, 2018

@Ericson2314 I pushed an update that I hope to be ok. I dropped the references to hostPlaform overriding since there are not necessary anymore. I am not that familiar with docbook so I might have used wrong tags.

Copy link
Member

@Ericson2314 Ericson2314 left a comment

Choose a reason for hiding this comment

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

Look good to me. @dezgeg or @vcunat you know more about this. What do you think?

Copy link
Contributor

Choose a reason for hiding this comment

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

I would title this Building a customized kernel or something like that.

Copy link
Member Author

Choose a reason for hiding this comment

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

is Customize your kernel ok ?

Copy link
Contributor

Choose a reason for hiding this comment

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

<filename>pkgs/os-specific/linux/kernel/generic.nix</filename>

Copy link
Contributor

Choose a reason for hiding this comment

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

There are various places missing spaces around the = in this example.

Copy link
Member Author

Choose a reason for hiding this comment

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

should be fixed

@dezgeg
Copy link
Contributor

dezgeg commented May 15, 2018

Seems good overall. I gave some minor comments.

Presents the options available (linuxManualConfig versus overriding
extraConfig, ignoreConfigErrors, autoModules, kernelPreferBuiltin.

For advanced hostPlatform customization refer to the commands shared by ericson1234 at
NixOS#33813 but it is too advanced to
put in the doc.
@teto
Copy link
Member Author

teto commented May 15, 2018

i pushed an update that should address the comments.

@teto teto changed the title [RFC] kernel doc: explain how to configure custom kernel [RDY] kernel doc: explain how to configure custom kernel May 17, 2018
@teto
Copy link
Member Author

teto commented Jun 7, 2018

Does that seem ok :> ?

@dezgeg dezgeg merged commit eb7e0d4 into NixOS:master Jun 8, 2018
@dezgeg
Copy link
Contributor

dezgeg commented Jun 8, 2018

Yes, looks good. Sorry this fell through the cracks.

@teto
Copy link
Member Author

teto commented Jun 8, 2018

sure no problem. If I can get around to complete/merge #41393 I'll update the doc accordingly.

@teto teto deleted the shell_doc branch June 8, 2018 07:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: documentation This PR adds or changes documentation 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants