summary refs log tree commit diff
path: root/pkgs/os-specific/linux/kernel/manual-config.nix
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2023-05-21 08:45:12 +0000
committerAlyssa Ross <hi@alyssa.is>2023-05-22 08:44:17 +0000
commitfebe4776287fd81b9dc0fd88a8bcb686765c8a6b (patch)
treeb529b2e5647dfae8ac742d2b505b441335b5c007 /pkgs/os-specific/linux/kernel/manual-config.nix
parent0a501274a47e65609ca5f1c539dce74f20f719e2 (diff)
downloadnixpkgs-febe4776287fd81b9dc0fd88a8bcb686765c8a6b.tar
nixpkgs-febe4776287fd81b9dc0fd88a8bcb686765c8a6b.tar.gz
nixpkgs-febe4776287fd81b9dc0fd88a8bcb686765c8a6b.tar.bz2
nixpkgs-febe4776287fd81b9dc0fd88a8bcb686765c8a6b.tar.lz
nixpkgs-febe4776287fd81b9dc0fd88a8bcb686765c8a6b.tar.xz
nixpkgs-febe4776287fd81b9dc0fd88a8bcb686765c8a6b.tar.zst
nixpkgs-febe4776287fd81b9dc0fd88a8bcb686765c8a6b.zip
linux: default stdenv.hostPlatform.linux-kernel
With this change, we can do a reasonable default build of Linux for
configurations that do not have a corresponding platforms.nix entry,
and where the user has not explicitly specified the linux-kernel
values.  This allows us to do best effort builds for obscure
architectures (I tested a build for s390x).

The platformName binding has not been used since
70cb7050f5c ("Trying to make the linux kernels also cross-build."),
so I removed it.
Diffstat (limited to 'pkgs/os-specific/linux/kernel/manual-config.nix')
-rw-r--r--pkgs/os-specific/linux/kernel/manual-config.nix9
1 files changed, 5 insertions, 4 deletions
diff --git a/pkgs/os-specific/linux/kernel/manual-config.nix b/pkgs/os-specific/linux/kernel/manual-config.nix
index 4a623fda9be..9908d22c411 100644
--- a/pkgs/os-specific/linux/kernel/manual-config.nix
+++ b/pkgs/os-specific/linux/kernel/manual-config.nix
@@ -87,7 +87,8 @@ let
 
   isModular = config.isYes "MODULES";
 
-  kernelConf =  stdenv.hostPlatform.linux-kernel;
+  kernelConf = stdenv.hostPlatform.linux-kernel;
+  target = kernelConf.target or "vmlinux";
 
   buildDTBs = kernelConf.DTB or false;
 in
@@ -101,7 +102,7 @@ stdenv.mkDerivation ({
 
   depsBuildBuild = [ buildPackages.stdenv.cc ];
   nativeBuildInputs = [ perl bc nettools openssl rsync gmp libmpc mpfr zstd python3Minimal ]
-      ++ optional  (kernelConf.target == "uImage") buildPackages.ubootTools
+      ++ optional  (target == "uImage") buildPackages.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 ]
@@ -297,8 +298,8 @@ stdenv.mkDerivation ({
   # Some image types need special install targets (e.g. uImage is installed with make uinstall)
   installTargets = [
     (kernelConf.installTarget or (
-      /**/ if kernelConf.target == "uImage" then "uinstall"
-      else if kernelConf.target == "zImage" || kernelConf.target == "Image.gz" then "zinstall"
+      /**/ if target == "uImage" then "uinstall"
+      else if target == "zImage" || target == "Image.gz" then "zinstall"
       else "install"))
   ];