Linux kernel: Difference between revisions

Sdht0 (talk | contribs)
Copy edit
Sdht0 (talk | contribs)
Line 150: Line 150:
{{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'}}


== Embedded Linux Cross-compile xconfig and menuconfig ==
== Embedded Linux Cross-compile ==


This section details the on how to get an environment that can be used to configure and cross-compile the kernel for embedded Linux development. The kernel source won't come from nix unpack phase but rather gotten externally(such as from the chip vendor github). So first clone the kernel source, then use the shell.nix below to set up the dev environment(example below is for aarch64):
To configure and cross-compile Linux kernels for embedded development, often distributed separately instead of using the stock kernel, you can setup a development environment as shown below:  


<syntaxHighlight lang=nix>
{{file|shell.nix|nix|<nowiki>
let
let
   pkgs = import <nixpkgs> { };
   pkgs = import <nixpkgs> { };
Line 180: Line 180:
   '';
   '';
}).env
}).env
</syntaxHighlight>
</nowiki>}}


Finally, cd to the kernel source dir and do development normally.
Clone the kernel sources, enter the environment using {{ic|nix-shell}}, and then do development normally.


== make menuconfig ==
== make menuconfig ==