diff options
author | Florian Klink <flokli@flokli.de> | 2024-04-23 13:40:43 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-04-23 13:40:43 +0300 |
commit | 3d92f49c0cfae31c6f6396427dde75d9dfce5d31 (patch) | |
tree | e6684de1960609df82d004da6f82d8521dc64335 | |
parent | 62731445bddc226d2b09c1e2b714cf2dc0c18b67 (diff) | |
parent | 27843dd41023e012eb68b92fcd27296452476ac9 (diff) |
Merge pull request #303370 from MatthewCroughan/mc/rkbin-rkboot-loaders
rkboot: init
-rw-r--r-- | pkgs/by-name/rk/rkbin/package.nix | 2 | ||||
-rw-r--r-- | pkgs/by-name/rk/rkboot/package.nix | 43 |
2 files changed, 44 insertions, 1 deletions
diff --git a/pkgs/by-name/rk/rkbin/package.nix b/pkgs/by-name/rk/rkbin/package.nix index 9ccff94a4e4b..5579703daca0 100644 --- a/pkgs/by-name/rk/rkbin/package.nix +++ b/pkgs/by-name/rk/rkbin/package.nix @@ -31,6 +31,6 @@ stdenv.mkDerivation { homepage = "https://github.com/rockchip-linux/rkbin"; license = licenses.unfreeRedistributable; maintainers = with maintainers; [ thefossguy ]; - platforms = [ "aarch64-linux" ]; + platforms = lib.platforms.all; }; } diff --git a/pkgs/by-name/rk/rkboot/package.nix b/pkgs/by-name/rk/rkboot/package.nix new file mode 100644 index 000000000000..5e71406967a6 --- /dev/null +++ b/pkgs/by-name/rk/rkboot/package.nix @@ -0,0 +1,43 @@ +{ stdenv +, lib +, rkbin +, box64 +}: + +stdenv.mkDerivation { + name = "rkboot"; + + src = rkbin.src; + + postPatch = '' + substituteInPlace RKBOOT/*.ini --replace 'PATH=' 'PATH=rkboot/' + ''; + + buildPhase = '' + mkdir rkboot + for i in $(ls ./RKBOOT/*.ini) + do + # The proprietary, statically linked binaries to perform boot_merge are + # x86_64 only. Though we use box64 to emulate if building on aarch64-linux + ${lib.optionalString stdenv.isAarch64 "${lib.getExe box64}"} ./tools/boot_merger "$i" || true + done + ''; + + installPhase = '' + mkdir -p $out + if [ -z "$(ls -A rkboot)" ]; then + echo "Error: The 'rkboot' directory is empty." + exit 1 + else + mv rkboot $out/bin + fi + ''; + + meta = with lib; { + description = "Rockchip proprietary SPL bootloader blobs"; + homepage = "https://github.com/rockchip-linux/rkbin"; + license = licenses.unfreeRedistributable; + maintainers = with maintainers; [ matthewcroughan ]; + platforms = [ "x86_64-linux" "aarch64-linux" ]; + }; +} |