nixpkgs/pkgs/os-specific/linux/raspberrypi-eeprom/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

60 lines
1.9 KiB
Nix
Raw Normal View History

2020-05-24 22:24:10 +00:00
{ stdenvNoCC, lib, fetchFromGitHub, makeWrapper
2023-10-01 08:32:19 +00:00
, python3, binutils-unwrapped, findutils, gawk, kmod, pciutils, libraspberrypi
2020-05-24 22:24:10 +00:00
}:
stdenvNoCC.mkDerivation rec {
2020-05-24 22:24:10 +00:00
pname = "raspberrypi-eeprom";
version = "2023.01.11-138c0";
2020-05-24 22:24:10 +00:00
src = fetchFromGitHub {
owner = "raspberrypi";
repo = "rpi-eeprom";
rev = "v${version}";
hash = "sha256-z3VyqdSkvxAgVmtMI/Is9qYrOeDXlyVLwHSSC2+AxcA=";
2020-05-24 22:24:10 +00:00
};
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' \
2020-05-24 22:24:10 +00:00
--replace '/etc/default' '/etc'
'';
installPhase = ''
mkdir -p $out/bin $out/share/rpi-eeprom
cp rpi-eeprom-config rpi-eeprom-update rpi-eeprom-digest $out/bin
2020-05-24 22:24:10 +00:00
cp -r firmware/{beta,critical,old,stable} $out/share/rpi-eeprom
cp -P firmware/default firmware/latest $out/share/rpi-eeprom
2020-05-24 22:24:10 +00:00
'';
fixupPhase = ''
patchShebangs $out/bin
for i in rpi-eeprom-update rpi-eeprom-config; do
wrapProgram $out/bin/$i \
--set FIRMWARE_ROOT $out/share/rpi-eeprom \
${lib.optionalString stdenvNoCC.isAarch64 "--set VCMAILBOX ${libraspberrypi}/bin/vcmailbox"} \
--prefix PATH : "${lib.makeBinPath ([
binutils-unwrapped
findutils
2023-10-01 08:32:19 +00:00
gawk
kmod
pciutils
(placeholder "out")
] ++ lib.optionals stdenvNoCC.isAarch64 [
libraspberrypi
])}"
done
2020-05-24 22:24:10 +00:00
'';
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 ];
};
}