1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-11-20 12:42:24 +00:00

armTrustedFirmwareTools: init

This package currently contains fiptool, cert_create and sptool.
This commit is contained in:
Ben Wolsieffer 2019-12-05 16:16:06 -05:00
parent 593fbef6ec
commit b5ec2b5c63
2 changed files with 26 additions and 7 deletions

View file

@ -1,16 +1,16 @@
{ stdenv, fetchFromGitHub, pkgsCross, buildPackages }:
{ lib, stdenv, fetchFromGitHub, fetchpatch, openssl, pkgsCross, buildPackages }:
let
buildArmTrustedFirmware = { filesToInstall
, installDir ? "$out"
, platform
, platform ? null
, extraMakeFlags ? []
, extraMeta ? {}
, version ? "2.1"
, ... } @ args:
stdenv.mkDerivation ({
name = "arm-trusted-firmware-${platform}-${version}";
name = "arm-trusted-firmware${lib.optionalString (platform != null) "-${platform}"}-${version}";
inherit version;
src = fetchFromGitHub {
@ -25,16 +25,18 @@ let
# For Cortex-M0 firmware in RK3399
nativeBuildInputs = [ pkgsCross.arm-embedded.stdenv.cc ];
buildInputs = [ openssl ];
makeFlags = [
"CROSS_COMPILE=${stdenv.cc.targetPrefix}"
"PLAT=${platform}"
] ++ extraMakeFlags;
] ++ (lib.optional (platform != null) "PLAT=${platform}")
++ extraMakeFlags;
installPhase = ''
runHook preInstall
mkdir -p ${installDir}
cp ${stdenv.lib.concatStringsSep " " filesToInstall} ${installDir}
cp ${lib.concatStringsSep " " filesToInstall} ${installDir}
runHook postInstall
'';
@ -45,7 +47,7 @@ let
# Fatal error: can't create build/sun50iw1p1/release/bl31/sunxi_clocks.o: No such file or directory
enableParallelBuilding = false;
meta = with stdenv.lib; {
meta = with lib; {
homepage = https://github.com/ARM-software/arm-trusted-firmware;
description = "A reference implementation of secure world software for ARMv8-A";
license = licenses.bsd3;
@ -56,6 +58,22 @@ let
in {
inherit buildArmTrustedFirmware;
armTrustedFirmwareTools = buildArmTrustedFirmware rec {
extraMakeFlags = [
"HOSTCC=${stdenv.cc.targetPrefix}gcc"
"fiptool" "certtool" "sptool"
];
filesToInstall = [
"tools/fiptool/fiptool"
"tools/cert_create/cert_create"
"tools/sptool/sptool"
];
postInstall = ''
mkdir -p "$out/bin"
find "$out" -type f -executable -exec mv -t "$out/bin" {} +
'';
};
armTrustedFirmwareAllwinner = buildArmTrustedFirmware rec {
platform = "sun50i_a64";
extraMeta.platforms = ["aarch64-linux"];

View file

@ -15811,6 +15811,7 @@ in
inherit (callPackage ../misc/arm-trusted-firmware {})
buildArmTrustedFirmware
armTrustedFirmwareTools
armTrustedFirmwareAllwinner
armTrustedFirmwareQemu
armTrustedFirmwareRK3328