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:
parent
593fbef6ec
commit
b5ec2b5c63
|
@ -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"];
|
||||
|
|
|
@ -15811,6 +15811,7 @@ in
|
|||
|
||||
inherit (callPackage ../misc/arm-trusted-firmware {})
|
||||
buildArmTrustedFirmware
|
||||
armTrustedFirmwareTools
|
||||
armTrustedFirmwareAllwinner
|
||||
armTrustedFirmwareQemu
|
||||
armTrustedFirmwareRK3328
|
||||
|
|
Loading…
Reference in a new issue