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

@@ -16,17 +16,14 @@
, hostPlatform
}:
let
inputsFun = ubootName : [ perl cpio ]
++ stdenv.lib.optional (ubootName != null) ubootTools;
makeUInitrdFun = ubootName : (ubootName != null);
in
stdenv.mkDerivation {
stdenv.mkDerivation rec {
name = "initrd";
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.
objects = map (x: x.object) contents;

View File

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

View File

@@ -224,8 +224,8 @@ stdenv.mkDerivation ((drvAttrs config stdenv.platform (kernelPatches ++ nativeKe
enableParallelBuilding = true;
nativeBuildInputs = [ perl bc nettools openssl gmp libmpc mpfr ] ++ optional (stdenv.platform.uboot != null)
ubootTools;
nativeBuildInputs = [ perl bc nettools openssl gmp libmpc mpfr ]
++ optional (stdenv.platform.kernelTarget == "uImage") ubootTools;
hardeningDisable = [ "bindnow" "format" "fortify" "stackprotector" "pic" ];
@@ -244,10 +244,6 @@ stdenv.mkDerivation ((drvAttrs config stdenv.platform (kernelPatches ++ nativeKe
karch = cp.kernelArch;
# !!! uboot has messed up cross-compiling, nativeDrv builds arm tools on x86,
# 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;
nativeBuildInputs = optional (cp.kernelTarget == "uImage") ubootTools;
};
})