[Nix-dev] Building linux kernle with manual-config.nix

Shea Levy shea at shealevy.com
Wed Mar 12 12:06:31 CET 2014


By the way, [1] should fix the bad error message you were seeing once
merged.

[1]: https://github.com/NixOS/nix/pull/223

On Wed, Mar 12, 2014 at 02:43:16PM +0400, Sergey Mironov wrote:
> Thanks, I understand. I decided to enable the support for modules in
> my kernel for now.
> 
> Here is a new wiki section regarding the topic:
> https://nixos.org/wiki/How_to_tweak_Linux_kernel_config_options
> 
> Regards,
> Sergey
> 
> 
> 
> 2014-03-07 13:06 GMT+04:00 Shea Levy <shea at shealevy.com>:
> > Hey Sergey,
> >
> > On Fri, Mar 07, 2014 at 12:17:50PM +0400, Sergey Mironov wrote:
> >> Hi. I am trying to build my own minimalistic kernel with `buildLinux'
> >> defined in kernel/manual-config.nix. I've written the wrapper
> >> expression as follows:
> >>
> >> # linuxHandMade.nix
> >> { stdenv, fetchurl, buildLinux } :
> >>
> >> buildLinux rec {
> >>
> >>   version = "3.10.28";
> >>
> >>   src = fetchurl {
> >>     url = "mirror://kernel/linux/kernel/v3.x/linux-${version}.tar.xz";
> >>     sha256 = "1blzvr3qywi8wxgl28zsn5djwgvw70yh3i6qjh2sz3zk9gnpd6mq";
> >>   };
> >>
> >>   configfile = ./linux-config;
> >>
> >>   allowImportFromDerivation = true;
> >> }
> >>
> >> where ./linux-config is the .config I have built manually by unpacking
> >> kernel sources and doing 'make menuconfig'. Everything was OK until I
> >> disabled the loadable modules support. The ./linux-config now contains
> >> "# CONFIG_MODULES is not set" and kernel/manual-config.nix doesn't
> >> work. The error is quite obscure:
> >>
> >> $ nix-build econat.nix -A linuxHandMade  --show-trace
> >> error: while evaluating `callPackageWith' at
> >> `/home/grwlf/proj/nixpkgs-econat/lib/customisation.nix:95:35':
> >> while evaluating `makeOverridable' at
> >> `/home/grwlf/proj/nixpkgs-econat/lib/customisation.nix:56:24':
> >> while evaluating an anonymous function at
> >> `/home/grwlf/proj/nixpkgs-econat/econat/apps/kernel.nix:1:1':
> >> while evaluating an anonymous function at
> >> `/home/grwlf/proj/nixpkgs-econat/pkgs/os-specific/linux/kernel/manual-config.nix:13:4':
> >> while evaluating `mkDerivation' at
> >> `/home/grwlf/proj/nixpkgs-econat/pkgs/stdenv/generic/default.nix:55:24':
> >> while evaluating `addPassthru' at
> >> `/home/grwlf/proj/nixpkgs-econat/lib/customisation.nix:100:22':
> >> while evaluating an anonymous function at
> >> `/nix/store/mf69pq5r5948h2q4wj4zfx69rn6zcfk4-nix-1.6.1/share/nix/corepkgs/derivation.nix:4:1':
> >> value is null while a list was expected
> >>
> >
> > That error is rubbish, and we'll fix that, but currently NixOS is not
> > intended to support non-modular kernels. See [1] for where the
> > restriction is specified. Lifting that would take only a little bit of
> > work, just no one has gotten around to it.
> >
> > Cheers,
> > Shea
> >
> > [1]: https://github.com/NixOS/nixpkgs/blob/6572708d3914a07a1c58f6162b999925ee3d695e/nixos/modules/system/boot/kernel.nix#L289
> >>
> >> I think I've already entered the purely-tested areas of Nixos but
> >> still could anybody give me a clue of what may go wrong?
> >>
> >> Regards,
> >> Sergey
> >> _______________________________________________
> >> nix-dev mailing list
> >> nix-dev at lists.science.uu.nl
> >> http://lists.science.uu.nl/mailman/listinfo/nix-dev


More information about the nix-dev mailing list