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
|
let
|
||||||
buildArmTrustedFirmware = { filesToInstall
|
buildArmTrustedFirmware = { filesToInstall
|
||||||
, installDir ? "$out"
|
, installDir ? "$out"
|
||||||
, platform
|
, platform ? null
|
||||||
, extraMakeFlags ? []
|
, extraMakeFlags ? []
|
||||||
, extraMeta ? {}
|
, extraMeta ? {}
|
||||||
, version ? "2.1"
|
, version ? "2.1"
|
||||||
, ... } @ args:
|
, ... } @ args:
|
||||||
stdenv.mkDerivation ({
|
stdenv.mkDerivation ({
|
||||||
|
|
||||||
name = "arm-trusted-firmware-${platform}-${version}";
|
name = "arm-trusted-firmware${lib.optionalString (platform != null) "-${platform}"}-${version}";
|
||||||
inherit version;
|
inherit version;
|
||||||
|
|
||||||
src = fetchFromGitHub {
|
src = fetchFromGitHub {
|
||||||
|
@ -25,16 +25,18 @@ let
|
||||||
# For Cortex-M0 firmware in RK3399
|
# For Cortex-M0 firmware in RK3399
|
||||||
nativeBuildInputs = [ pkgsCross.arm-embedded.stdenv.cc ];
|
nativeBuildInputs = [ pkgsCross.arm-embedded.stdenv.cc ];
|
||||||
|
|
||||||
|
buildInputs = [ openssl ];
|
||||||
|
|
||||||
makeFlags = [
|
makeFlags = [
|
||||||
"CROSS_COMPILE=${stdenv.cc.targetPrefix}"
|
"CROSS_COMPILE=${stdenv.cc.targetPrefix}"
|
||||||
"PLAT=${platform}"
|
] ++ (lib.optional (platform != null) "PLAT=${platform}")
|
||||||
] ++ extraMakeFlags;
|
++ extraMakeFlags;
|
||||||
|
|
||||||
installPhase = ''
|
installPhase = ''
|
||||||
runHook preInstall
|
runHook preInstall
|
||||||
|
|
||||||
mkdir -p ${installDir}
|
mkdir -p ${installDir}
|
||||||
cp ${stdenv.lib.concatStringsSep " " filesToInstall} ${installDir}
|
cp ${lib.concatStringsSep " " filesToInstall} ${installDir}
|
||||||
|
|
||||||
runHook postInstall
|
runHook postInstall
|
||||||
'';
|
'';
|
||||||
|
@ -45,7 +47,7 @@ let
|
||||||
# Fatal error: can't create build/sun50iw1p1/release/bl31/sunxi_clocks.o: No such file or directory
|
# Fatal error: can't create build/sun50iw1p1/release/bl31/sunxi_clocks.o: No such file or directory
|
||||||
enableParallelBuilding = false;
|
enableParallelBuilding = false;
|
||||||
|
|
||||||
meta = with stdenv.lib; {
|
meta = with lib; {
|
||||||
homepage = https://github.com/ARM-software/arm-trusted-firmware;
|
homepage = https://github.com/ARM-software/arm-trusted-firmware;
|
||||||
description = "A reference implementation of secure world software for ARMv8-A";
|
description = "A reference implementation of secure world software for ARMv8-A";
|
||||||
license = licenses.bsd3;
|
license = licenses.bsd3;
|
||||||
|
@ -56,6 +58,22 @@ let
|
||||||
in {
|
in {
|
||||||
inherit buildArmTrustedFirmware;
|
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 {
|
armTrustedFirmwareAllwinner = buildArmTrustedFirmware rec {
|
||||||
platform = "sun50i_a64";
|
platform = "sun50i_a64";
|
||||||
extraMeta.platforms = ["aarch64-linux"];
|
extraMeta.platforms = ["aarch64-linux"];
|
||||||
|
|
|
@ -15811,6 +15811,7 @@ in
|
||||||
|
|
||||||
inherit (callPackage ../misc/arm-trusted-firmware {})
|
inherit (callPackage ../misc/arm-trusted-firmware {})
|
||||||
buildArmTrustedFirmware
|
buildArmTrustedFirmware
|
||||||
|
armTrustedFirmwareTools
|
||||||
armTrustedFirmwareAllwinner
|
armTrustedFirmwareAllwinner
|
||||||
armTrustedFirmwareQemu
|
armTrustedFirmwareQemu
|
||||||
armTrustedFirmwareRK3328
|
armTrustedFirmwareRK3328
|
||||||
|
|
Loading…
Reference in a new issue