From cdabe1007c89cb92aff1b378831784c19873bc07 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Janne=20He=C3=9F?= Date: Mon, 25 May 2020 00:24:10 +0200 Subject: [PATCH] raspberrypi-eeprom: Init at 2020-10-05 --- .../linux/raspberrypi-eeprom/default.nix | 56 +++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 + 2 files changed, 58 insertions(+) create mode 100644 pkgs/os-specific/linux/raspberrypi-eeprom/default.nix diff --git a/pkgs/os-specific/linux/raspberrypi-eeprom/default.nix b/pkgs/os-specific/linux/raspberrypi-eeprom/default.nix new file mode 100644 index 000000000000..ff9c8f4ce8b4 --- /dev/null +++ b/pkgs/os-specific/linux/raspberrypi-eeprom/default.nix @@ -0,0 +1,56 @@ +{ stdenvNoCC, lib, fetchFromGitHub, makeWrapper +, python3, binutils-unwrapped, findutils, kmod, pciutils, raspberrypi-tools +}: +stdenvNoCC.mkDerivation { + pname = "raspberrypi-eeprom"; + version = "unstable-2020-10-05"; + + src = fetchFromGitHub { + owner = "raspberrypi"; + repo = "rpi-eeprom"; + rev = "718820bcebd21d4a619fa262d9b9cf3acbf110f8"; + sha256 = "1277jsiyv34dqpandva8kxy1s0y5ql344pl9gk84avzp1mqjnv4g"; + }; + + buildInputs = [ python3 ]; + nativeBuildInputs = [ makeWrapper ]; + + postPatch = '' + # Don't try to verify md5 signatures from /var/lib/dpkg and + # fix path to the configuration. + substituteInPlace rpi-eeprom-update \ + --replace 'IGNORE_DPKG_CHECKSUMS=$LOCAL_MODE' 'IGNORE_DPKG_CHECKSUMS=1' \ + --replace '/etc/default' '/etc' + ''; + + installPhase = '' + mkdir -p $out/bin $out/share/rpi-eeprom + + cp rpi-eeprom-config rpi-eeprom-update $out/bin + cp -r firmware/{beta,critical,old,stable} $out/share/rpi-eeprom + cp -r firmware/vl805 $out/bin + ''; + + fixupPhase = '' + patchShebangs $out/bin + wrapProgram $out/bin/rpi-eeprom-update \ + --set FIRMWARE_ROOT $out/share/rpi-eeprom \ + ${lib.optionalString stdenvNoCC.isAarch64 "--set VCMAILBOX ${raspberrypi-tools}/bin/vcmailbox"} \ + --prefix PATH : "${lib.makeBinPath ([ + binutils-unwrapped + findutils + kmod + pciutils + (placeholder "out") + ] ++ lib.optionals stdenvNoCC.isAarch64 [ + raspberrypi-tools + ])}" + ''; + + meta = with lib; { + description = "Installation scripts and binaries for the closed sourced Raspberry Pi 4 EEPROMs"; + homepage = "https://www.raspberrypi.org/documentation/hardware/raspberrypi/booteeprom.md"; + license = with licenses; [ bsd3 unfreeRedistributableFirmware ]; + maintainers = with maintainers; [ das_j ]; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index c74f2249fc89..546a57c70139 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -18529,6 +18529,8 @@ in raspberrypifw = callPackage ../os-specific/linux/firmware/raspberrypi {}; raspberrypiWirelessFirmware = callPackage ../os-specific/linux/firmware/raspberrypi-wireless { }; + raspberrypi-eeprom = callPackage ../os-specific/linux/raspberrypi-eeprom {}; + raspberrypi-tools = callPackage ../os-specific/linux/firmware/raspberrypi/tools.nix {}; regionset = callPackage ../os-specific/linux/regionset { };