git.iko.soy/typeable/nixpkgs
on master help sign in
linux: build dtbs in parallel (#106846)

linux: build DTBs in buildPhase, install with everything else This improves build speed, especially on machines with lots of cores such as the aarch64 community box and hydra builders.

commitdd5f07afca27571e567cd902c2e64409e4a485be authorLinus Heckemann <git@sphalerite.org> dateThu 14 Oct 2021, 19:41 (5 years ago) parent4f292fe
1 file changed+8−6
pkgs/os-specific/linux/kernel/manual-config.nix+8−6
pkgs/os-specific/linux/kernel/manual-config.nix+8−6
@@ -56,6 +56,7 @@ let
5656 # Dependencies that are required to build kernel modules
5757 moduleBuildDependencies = optional (lib.versionAtLeast version "4.14") libelf;
5858
59+
5960 installkernel = writeTextFile { name = "installkernel"; executable=true; text = ''
6061 #!${stdenv.shell} -e
6162 mkdir -p $4
@@ -88,6 +89,8 @@ let
8889
8990 isModular = config.isYes "MODULES";
9091
92+ buildDTBs = kernelConf.DTB or false;
93+
9194 installsFirmware = (config.isEnabled "FW_LOADER") &&
9295 (isModular || (config.isDisabled "FIRMWARE_IN_KERNEL")) &&
9396 (lib.versionOlder version "4.14");
@@ -175,15 +178,16 @@ let
175178 "KBUILD_BUILD_VERSION=1-NixOS"
176179 kernelConf.target
177180 "vmlinux" # for "perf" and things like that
178− ]
179− ++ optional isModular "modules"
181+ ] ++ optional isModular "modules"
182+ ++ optional buildDTBs "dtbs"
180183 ++ extraMakeFlags;
181184
182185 installFlags = [
183186 "INSTALLKERNEL=${installkernel}"
184187 "INSTALL_PATH=$(out)"
185188 ] ++ (optional isModular "INSTALL_MOD_PATH=$(out)")
186− ++ optional installsFirmware "INSTALL_FW_PATH=$(out)/lib/firmware";
189+ ++ optional installsFirmware "INSTALL_FW_PATH=$(out)/lib/firmware"
190+ ++ optionals buildDTBs ["dtbs_install" "INSTALL_DTBS_PATH=$(out)/dtbs"];
187191
188192 preInstall = ''
189193 installFlagsArray+=("-j$NIX_BUILD_CORES")
@@ -199,9 +203,7 @@ let
199203
200204 postInstall = (optionalString installsFirmware ''
201205 mkdir -p $out/lib/firmware
202− '') + (if (kernelConf.DTB or false) then ''
203− make $makeFlags "''${makeFlagsArray[@]}" dtbs dtbs_install INSTALL_DTBS_PATH=$out/dtbs
204− '' else "") + (if isModular then ''
206+ '') + (if isModular then ''
205207 mkdir -p $dev
206208 cp vmlinux $dev/
207209 if [ -z "''${dontStrip-}" ]; then