2024-10-24 18:03:10 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
stdenv,
|
|
|
|
fetchFromGitHub,
|
2024-10-27 09:05:58 +00:00
|
|
|
gitUpdater,
|
2024-10-24 18:03:10 +00:00
|
|
|
libusb1,
|
|
|
|
pkg-config,
|
|
|
|
}:
|
2018-04-05 04:23:16 +00:00
|
|
|
|
2021-07-30 23:50:18 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2020-12-25 02:15:53 +00:00
|
|
|
pname = "rpiboot";
|
2024-10-24 18:08:45 +00:00
|
|
|
version = "20240926-102326";
|
2018-04-05 04:23:16 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "raspberrypi";
|
|
|
|
repo = "usbboot";
|
2023-01-18 14:49:38 +00:00
|
|
|
rev = version;
|
2024-10-24 18:08:45 +00:00
|
|
|
hash = "sha256-9m7PAw1WNQlfqOr5hDXrCsZlZLBmvoGUT58NN2cVolw=";
|
2018-04-05 04:23:16 +00:00
|
|
|
};
|
|
|
|
|
2023-01-18 14:49:38 +00:00
|
|
|
buildInputs = [ libusb1 ];
|
|
|
|
nativeBuildInputs = [ pkg-config ];
|
2018-04-05 04:23:16 +00:00
|
|
|
|
|
|
|
patchPhase = ''
|
|
|
|
sed -i "s@/usr/@$out/@g" main.c
|
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out/bin
|
|
|
|
mkdir -p $out/share/rpiboot
|
|
|
|
cp rpiboot $out/bin
|
2024-10-24 18:09:15 +00:00
|
|
|
cp -r msd firmware eeprom-erase mass-storage-gadget* recovery* secure-boot* rpi-imager-embedded $out/share/rpiboot
|
2018-04-05 04:23:16 +00:00
|
|
|
'';
|
|
|
|
|
2024-10-27 09:05:58 +00:00
|
|
|
passthru.updateScript = gitUpdater { };
|
|
|
|
|
2024-10-24 18:14:11 +00:00
|
|
|
meta = {
|
2020-04-01 01:11:51 +00:00
|
|
|
homepage = "https://github.com/raspberrypi/usbboot";
|
2024-10-04 19:35:12 +00:00
|
|
|
changelog = "https://github.com/raspberrypi/usbboot/blob/${version}/debian/changelog";
|
2021-07-30 23:50:18 +00:00
|
|
|
description = "Utility to boot a Raspberry Pi CM/CM3/CM4/Zero over USB";
|
2024-03-19 02:14:51 +00:00
|
|
|
mainProgram = "rpiboot";
|
2024-10-24 18:14:11 +00:00
|
|
|
license = lib.licenses.asl20;
|
|
|
|
maintainers = with lib.maintainers; [
|
2024-10-24 18:03:10 +00:00
|
|
|
cartr
|
|
|
|
flokli
|
2024-10-24 18:14:33 +00:00
|
|
|
stv0g
|
2024-10-24 18:03:10 +00:00
|
|
|
];
|
|
|
|
platforms = [
|
|
|
|
"aarch64-linux"
|
|
|
|
"aarch64-darwin"
|
|
|
|
"armv7l-linux"
|
|
|
|
"armv6l-linux"
|
|
|
|
"x86_64-linux"
|
|
|
|
"x86_64-darwin"
|
|
|
|
];
|
2018-04-05 04:23:16 +00:00
|
|
|
};
|
|
|
|
}
|