diff options
author | Samuel Dionne-Riel <samuel@dionne-riel.com> | 2024-04-11 20:03:53 -0400 |
---|---|---|
committer | K900 <me@0upti.me> | 2024-04-13 15:07:30 +0300 |
commit | 1504f79fdfc46f0070d8ce814f2de4fec97b87ea (patch) | |
tree | 12305db8c630a77a581e7cfb331ff502395113c3 /pkgs/os-specific | |
parent | 14b13525fc3cdf076743a89ad044ec46e73c8ed2 (diff) |
linuxManualConfig: Sometimes depend on ubootTools
This issue was (understandably) introduced with #262677.
Diffstat (limited to 'pkgs/os-specific')
-rw-r--r-- | pkgs/os-specific/linux/kernel/manual-config.nix | 30 |
1 files changed, 29 insertions, 1 deletions
diff --git a/pkgs/os-specific/linux/kernel/manual-config.nix b/pkgs/os-specific/linux/kernel/manual-config.nix index baf0231f13e16..5b222c4b45eff 100644 --- a/pkgs/os-specific/linux/kernel/manual-config.nix +++ b/pkgs/os-specific/linux/kernel/manual-config.nix @@ -59,6 +59,33 @@ let drvAttrs = config_: kernelConf: kernelPatches: configfile: let + # Folding in `ubootTools` in the default nativeBuildInputs is problematic, as + # it makes updating U-Boot cumbersome, since it will go above the current + # threshold of rebuilds + # + # To prevent these needless rounds of staging for U-Boot builds, we can + # limit the inclusion of ubootTools to target platforms where uImage *may* + # be produced. + # + # This command lists those (kernel-named) platforms: + # .../linux $ grep -l uImage ./arch/*/Makefile | cut -d'/' -f3 | sort + # + # This is still a guesstimation, but since none of our cached platforms + # coincide in that list, this gives us "perfect" decoupling here. + linuxPlatformsUsingUImage = [ + "arc" + "arm" + "csky" + "mips" + "powerpc" + "sh" + "sparc" + "xtensa" + ]; + needsUbootTools = + lib.elem stdenv.hostPlatform.linuxArch linuxPlatformsUsingUImage + ; + config = let attrName = attr: "CONFIG_" + attr; in { isSet = attr: hasAttr (attrName attr) config; @@ -106,7 +133,8 @@ let inherit src; depsBuildBuild = [ buildPackages.stdenv.cc ]; - nativeBuildInputs = [ perl bc nettools openssl rsync gmp libmpc mpfr zstd python3Minimal kmod ubootTools ] + nativeBuildInputs = [ perl bc nettools openssl rsync gmp libmpc mpfr zstd python3Minimal kmod ] + ++ optional needsUbootTools ubootTools ++ optional (lib.versionOlder version "5.8") libelf ++ optionals (lib.versionAtLeast version "4.16") [ bison flex ] ++ optionals (lib.versionAtLeast version "5.2") [ cpio pahole zlib ] |