[Nix-dev] How does the kernel get build? Because /usr/bin/perl is hardcoded in the kernel sources...

Bjørn Forsman bjorn.forsman at gmail.com
Thu Jun 30 23:04:02 CEST 2016


On 30 June 2016 at 22:40, Matthias Beyer <mail at beyermatthias.de> wrote:
> Hi nixos community,
>
> I wonder how the kernel is build with nix, as /usr/bin/perl is
> hardcoded in all scripts in the kernel source tree.
>
> Can someone point me to the appropriate file for how the build setup
> handles the kernel perl build infrastructure?
>
> I assume our setup somehow rewrites the shebang lines of all these
> files before invoking the build... but I'm not sure here. Maybe
> someone can point this out to me.

Correct:

https://github.com/NixOS/nixpkgs/blob/master/pkgs/os-specific/linux/kernel/manual-config.nix#L91-97

Digression, I wish:

* Someone brave send /usr/bin/$PROG => /usr/bin/env $PROG patches
upstream (assuming it doesn't hurt anyone)
* NixOS chroot builds to have /usr/bin/env. Having to patch perfectly
portable code to perform a build doesn't feel right IMHO.

- Bjørn


More information about the nix-dev mailing list