platforms.nix: Clean up more 'uboot' legacy

For a while now, the only thing the 'uboot' attribute does is to tell
whether to add ubootTools to kernel/initrd builds. That can be
determined with platform.kernelTarget == "uImage" just as well.
This commit is contained in:
Tuomas Tynkkynen 2017-11-05 16:58:14 +02:00
parent 14f232d812
commit 0d9f2f0bb4
4 changed files with 8 additions and 30 deletions

View File

@ -2,7 +2,6 @@
rec { rec {
pcBase = { pcBase = {
name = "pc"; name = "pc";
uboot = null;
kernelHeadersBaseConfig = "defconfig"; kernelHeadersBaseConfig = "defconfig";
kernelBaseConfig = "defconfig"; kernelBaseConfig = "defconfig";
# Build whatever possible as a module, if not stated in the extra config. # Build whatever possible as a module, if not stated in the extra config.
@ -50,9 +49,6 @@ rec {
kernelTarget = "uImage"; kernelTarget = "uImage";
# TODO reenable once manual-config's config actually builds a .dtb and this is checked to be working # TODO reenable once manual-config's config actually builds a .dtb and this is checked to be working
#kernelDTB = true; #kernelDTB = true;
# XXX can be anything non-null, pkgs actually only cares if it is set or not
uboot = "pogoplug4";
}; };
sheevaplug = { sheevaplug = {
@ -162,9 +158,6 @@ rec {
''; '';
kernelMakeFlags = [ "LOADADDR=0x0200000" ]; kernelMakeFlags = [ "LOADADDR=0x0200000" ];
kernelTarget = "uImage"; kernelTarget = "uImage";
uboot = "sheevaplug";
# Only for uboot = uboot :
ubootConfig = "sheevaplug_config";
kernelDTB = true; # Beyond 3.10 kernelDTB = true; # Beyond 3.10
gcc = { gcc = {
arch = "armv5te"; arch = "armv5te";
@ -251,7 +244,6 @@ rec {
LATENCYTOP y LATENCYTOP y
''; '';
kernelTarget = "zImage"; kernelTarget = "zImage";
uboot = null;
gcc = { gcc = {
arch = "armv6"; arch = "armv6";
fpu = "vfp"; fpu = "vfp";
@ -342,7 +334,6 @@ rec {
XEN? n XEN? n
''; '';
kernelTarget = "zImage"; kernelTarget = "zImage";
uboot = null;
}; };
scaleway-c1 = armv7l-hf-multiplatform // { scaleway-c1 = armv7l-hf-multiplatform // {
@ -374,7 +365,6 @@ rec {
kernelMakeFlags = [ "LOADADDR=0x10800000" ]; kernelMakeFlags = [ "LOADADDR=0x10800000" ];
kernelTarget = "uImage"; kernelTarget = "uImage";
kernelDTB = true; kernelDTB = true;
uboot = true; #XXX: any non-null value here is needed so that mkimage is present to build kernelTarget uImage
gcc = { gcc = {
cpu = "cortex-a9"; cpu = "cortex-a9";
fpu = "neon"; fpu = "neon";
@ -464,7 +454,6 @@ rec {
FTRACE n FTRACE n
''; '';
kernelTarget = "vmlinux"; kernelTarget = "vmlinux";
uboot = null;
gcc = { gcc = {
arch = "loongson2f"; arch = "loongson2f";
abi = "n32"; abi = "n32";
@ -477,7 +466,6 @@ rec {
kernelAutoModules = false; kernelAutoModules = false;
kernelExtraConfig = ""; # TBD kernel config kernelExtraConfig = ""; # TBD kernel config
kernelTarget = "zImage"; kernelTarget = "zImage";
uboot = null;
}; };
armv7l-hf-multiplatform = { armv7l-hf-multiplatform = {
@ -489,7 +477,6 @@ rec {
kernelDTB = true; kernelDTB = true;
kernelAutoModules = true; kernelAutoModules = true;
kernelPreferBuiltin = true; kernelPreferBuiltin = true;
uboot = null;
kernelTarget = "zImage"; kernelTarget = "zImage";
kernelExtraConfig = '' kernelExtraConfig = ''
# Fix broken sunxi-sid nvmem driver. # Fix broken sunxi-sid nvmem driver.
@ -552,7 +539,6 @@ rec {
# which our initrd builder can't currently do easily. # which our initrd builder can't currently do easily.
USB_XHCI_TEGRA m USB_XHCI_TEGRA m
''; '';
uboot = null;
kernelTarget = "Image"; kernelTarget = "Image";
gcc = { gcc = {
arch = "armv8-a"; arch = "armv8-a";

View File

@ -16,17 +16,14 @@
, hostPlatform , hostPlatform
}: }:
let stdenv.mkDerivation rec {
inputsFun = ubootName : [ perl cpio ]
++ stdenv.lib.optional (ubootName != null) ubootTools;
makeUInitrdFun = ubootName : (ubootName != null);
in
stdenv.mkDerivation {
name = "initrd"; name = "initrd";
builder = ./make-initrd.sh; builder = ./make-initrd.sh;
nativeBuildInputs = inputsFun hostPlatform.platform.uboot;
makeUInitrd = makeUInitrdFun hostPlatform.platform.uboot; makeUInitrd = hostPlatform.platform.kernelTarget == "uImage";
nativeBuildInputs = [ perl cpio ]
++ stdenv.lib.optional makeUInitrd ubootTools;
# !!! should use XML. # !!! should use XML.
objects = map (x: x.object) contents; objects = map (x: x.object) contents;

View File

@ -29,7 +29,6 @@
, ... , ...
}: }:
assert stdenv.platform.name == "sheevaplug" -> stdenv.platform.uboot != null;
assert stdenv.isLinux; assert stdenv.isLinux;
let let

View File

@ -224,8 +224,8 @@ stdenv.mkDerivation ((drvAttrs config stdenv.platform (kernelPatches ++ nativeKe
enableParallelBuilding = true; enableParallelBuilding = true;
nativeBuildInputs = [ perl bc nettools openssl gmp libmpc mpfr ] ++ optional (stdenv.platform.uboot != null) nativeBuildInputs = [ perl bc nettools openssl gmp libmpc mpfr ]
ubootTools; ++ optional (stdenv.platform.kernelTarget == "uImage") ubootTools;
hardeningDisable = [ "bindnow" "format" "fortify" "stackprotector" "pic" ]; hardeningDisable = [ "bindnow" "format" "fortify" "stackprotector" "pic" ];
@ -244,10 +244,6 @@ stdenv.mkDerivation ((drvAttrs config stdenv.platform (kernelPatches ++ nativeKe
karch = cp.kernelArch; karch = cp.kernelArch;
# !!! uboot has messed up cross-compiling, nativeDrv builds arm tools on x86, nativeBuildInputs = optional (cp.kernelTarget == "uImage") ubootTools;
# crossDrv builds x86 tools on x86 (but arm uboot). If this is fixed, uboot
# can just go into buildInputs (but not nativeBuildInputs since cp.uboot
# may be different from stdenv.platform.uboot)
buildInputs = optional (cp.uboot != null) ubootTools.crossDrv;
}; };
}) })