2020-10-20 17:27:49 +00:00
|
|
|
{ stdenvNoCC, lib, fetchFromGitHub, makeWrapper
|
2020-12-29 15:07:52 +00:00
|
|
|
, python3, binutils-unwrapped, findutils, kmod, pciutils, libraspberrypi
|
2020-10-20 17:27:49 +00:00
|
|
|
}:
|
2021-06-04 09:07:49 +00:00
|
|
|
stdenvNoCC.mkDerivation rec {
|
2020-10-20 17:27:49 +00:00
|
|
|
pname = "raspberrypi-eeprom";
|
2022-12-28 21:21:41 +00:00
|
|
|
version = "2022.12.07-138a1";
|
2020-10-20 17:27:49 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "raspberrypi";
|
|
|
|
repo = "rpi-eeprom";
|
2022-09-09 14:08:57 +00:00
|
|
|
rev = "v${version}";
|
2022-12-28 21:21:41 +00:00
|
|
|
hash = "sha256-/Q9zj/Hn/8S7bF1CN6ZCg705VYU+QUagNr4RNgZl+oA=";
|
2020-10-20 17:27:49 +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 \
|
2021-06-04 09:07:49 +00:00
|
|
|
--replace 'IGNORE_DPKG_CHECKSUMS=''${LOCAL_MODE}' 'IGNORE_DPKG_CHECKSUMS=1' \
|
2020-10-20 17:27:49 +00:00
|
|
|
--replace '/etc/default' '/etc'
|
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out/bin $out/share/rpi-eeprom
|
|
|
|
|
2022-03-05 16:20:37 +00:00
|
|
|
cp rpi-eeprom-config rpi-eeprom-update rpi-eeprom-digest $out/bin
|
2020-10-20 17:27:49 +00:00
|
|
|
cp -r firmware/{beta,critical,old,stable} $out/share/rpi-eeprom
|
2021-08-27 14:25:00 +00:00
|
|
|
cp -P firmware/default firmware/latest $out/share/rpi-eeprom
|
2020-10-20 17:27:49 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
fixupPhase = ''
|
|
|
|
patchShebangs $out/bin
|
2021-08-25 08:27:29 +00:00
|
|
|
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
|
|
|
|
kmod
|
|
|
|
pciutils
|
|
|
|
(placeholder "out")
|
|
|
|
] ++ lib.optionals stdenvNoCC.isAarch64 [
|
|
|
|
libraspberrypi
|
|
|
|
])}"
|
|
|
|
done
|
2020-10-20 17:27:49 +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 ];
|
|
|
|
};
|
|
|
|
}
|