Linux kernel: Difference between revisions

imported>Khoi
m add shell.nix for menuconfig and xconfig for cross compile page
imported>Khoi
Fixed ordering of section
Line 134: Line 134:
{{bc|note: keeping build directory '/tmp/nix-build-linux-config-4.19.0-mptcp_v0.94.1.drv-0'}}
{{bc|note: keeping build directory '/tmp/nix-build-linux-config-4.19.0-mptcp_v0.94.1.drv-0'}}
by opening {{ic|/tmp/nix-build-linux-config-4.19.0-mptcp_v0.94.1.drv-0/.attr-0}}.
by opening {{ic|/tmp/nix-build-linux-config-4.19.0-mptcp_v0.94.1.drv-0/.attr-0}}.
== make menuconfig ==
It is (currently) not possible to run <code>make menuconfig</code> in the checked out linux kernel sources. This is because <code>ncurses</code> is not part of your working environment when you start it with <code>nix-shell '<nixpkgs>' -A linuxPackages.kernel</code>.
This nix-shell hack adds ncurses as a build dependency to the kernel:
<syntaxHighlight lang=console>
$ nix-shell -E 'with import <nixpkgs> {}; linux.overrideAttrs (o: {nativeBuildInputs=o.nativeBuildInputs ++ [ pkg-config ncurses ];})'
[nix-shell] $ unpackPhase && cd linux-*
[nix-shell] $ patchPhase
[nix-shell] $ make menuconfig
</syntaxHighlight> (thanks to sphalerite)


== Cross-compile xconfig and menuconfig ==
== Cross-compile xconfig and menuconfig ==
Line 175: Line 164:
}
}
</syntaxHighlight>
</syntaxHighlight>
== make menuconfig ==
It is (currently) not possible to run <code>make menuconfig</code> in the checked out linux kernel sources. This is because <code>ncurses</code> is not part of your working environment when you start it with <code>nix-shell '<nixpkgs>' -A linuxPackages.kernel</code>.
This nix-shell hack adds ncurses as a build dependency to the kernel:
<syntaxHighlight lang=console>
$ nix-shell -E 'with import <nixpkgs> {}; linux.overrideAttrs (o: {nativeBuildInputs=o.nativeBuildInputs ++ [ pkg-config ncurses ];})'
[nix-shell] $ unpackPhase && cd linux-*
[nix-shell] $ patchPhase
[nix-shell] $ make menuconfig
</syntaxHighlight> (thanks to sphalerite)


== make xconfig ==
== make xconfig ==