From 9808443bdd62a97cd7526972cb517e10b3696acd Mon Sep 17 00:00:00 2001 From: Steffen Vogel Date: Thu, 24 Oct 2024 20:02:36 +0200 Subject: [PATCH 1/6] rpiboot: migrate to by-name --- .../misc/rpiboot/default.nix => by-name/rp/rpiboot/package.nix} | 0 pkgs/top-level/all-packages.nix | 2 -- 2 files changed, 2 deletions(-) rename pkgs/{development/misc/rpiboot/default.nix => by-name/rp/rpiboot/package.nix} (100%) diff --git a/pkgs/development/misc/rpiboot/default.nix b/pkgs/by-name/rp/rpiboot/package.nix similarity index 100% rename from pkgs/development/misc/rpiboot/default.nix rename to pkgs/by-name/rp/rpiboot/package.nix diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index e98ee48b794f..c8c1a35fbc86 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -11875,8 +11875,6 @@ with pkgs; rpPPPoE = callPackage ../tools/networking/rp-pppoe { }; - rpiboot = callPackage ../development/misc/rpiboot { }; - rpm = callPackage ../tools/package-management/rpm { python = python3; lua = lua5_4; From e01877fecb19fc7e9800039fb2328704c93c4fcc Mon Sep 17 00:00:00 2001 From: Steffen Vogel Date: Thu, 24 Oct 2024 20:03:10 +0200 Subject: [PATCH 2/6] rpiboot: format with nixfmt (RFC166) --- pkgs/by-name/rp/rpiboot/package.nix | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/pkgs/by-name/rp/rpiboot/package.nix b/pkgs/by-name/rp/rpiboot/package.nix index 53b8c0326b1b..641ed450c727 100644 --- a/pkgs/by-name/rp/rpiboot/package.nix +++ b/pkgs/by-name/rp/rpiboot/package.nix @@ -1,4 +1,10 @@ -{ lib, stdenv, fetchFromGitHub, libusb1, pkg-config }: +{ + lib, + stdenv, + fetchFromGitHub, + libusb1, + pkg-config, +}: stdenv.mkDerivation rec { pname = "rpiboot"; @@ -31,7 +37,17 @@ stdenv.mkDerivation rec { description = "Utility to boot a Raspberry Pi CM/CM3/CM4/Zero over USB"; mainProgram = "rpiboot"; license = licenses.asl20; - maintainers = with maintainers; [ cartr flokli ]; - platforms = [ "aarch64-linux" "aarch64-darwin" "armv7l-linux" "armv6l-linux" "x86_64-linux" "x86_64-darwin" ]; + maintainers = with maintainers; [ + cartr + flokli + ]; + platforms = [ + "aarch64-linux" + "aarch64-darwin" + "armv7l-linux" + "armv6l-linux" + "x86_64-linux" + "x86_64-darwin" + ]; }; } From 51c1e325094691818b82403cc9355a3bd3667e81 Mon Sep 17 00:00:00 2001 From: Steffen Vogel Date: Thu, 24 Oct 2024 20:08:45 +0200 Subject: [PATCH 3/6] rpiboot: 20221215-105525 -> 20240926-102326 --- pkgs/by-name/rp/rpiboot/package.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/by-name/rp/rpiboot/package.nix b/pkgs/by-name/rp/rpiboot/package.nix index 641ed450c727..338535c938ca 100644 --- a/pkgs/by-name/rp/rpiboot/package.nix +++ b/pkgs/by-name/rp/rpiboot/package.nix @@ -8,13 +8,13 @@ stdenv.mkDerivation rec { pname = "rpiboot"; - version = "20221215-105525"; + version = "20240926-102326"; src = fetchFromGitHub { owner = "raspberrypi"; repo = "usbboot"; rev = version; - hash = "sha256-Y77IrDblXmnpZleJ3zTyiGDYLZ7gNxASXpqUzwS1NCU="; + hash = "sha256-9m7PAw1WNQlfqOr5hDXrCsZlZLBmvoGUT58NN2cVolw="; }; buildInputs = [ libusb1 ]; From eceb047690b6bdfaf329921042851a3159e65605 Mon Sep 17 00:00:00 2001 From: Steffen Vogel Date: Thu, 24 Oct 2024 20:09:15 +0200 Subject: [PATCH 4/6] rpiboot: install more gadgets The usboot repo comes with a bunch of different gadgets which can be used to boot Raspberry Pis via a USB boot cable. Until now, we have only included the `msd` (Mass-storage device). However, this gadget is deprecated and has since been replaced by the `mass-storage-gadget`. Furthermore, there are now more gadgets like the one for configuring secure boot or update/recover RPi4/5 boot eeprom. This change installs the new gadgets under $out/usr/share/rpiboot. --- pkgs/by-name/rp/rpiboot/package.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/by-name/rp/rpiboot/package.nix b/pkgs/by-name/rp/rpiboot/package.nix index 338535c938ca..bec3b9217d57 100644 --- a/pkgs/by-name/rp/rpiboot/package.nix +++ b/pkgs/by-name/rp/rpiboot/package.nix @@ -28,7 +28,7 @@ stdenv.mkDerivation rec { mkdir -p $out/bin mkdir -p $out/share/rpiboot cp rpiboot $out/bin - cp -r msd $out/share/rpiboot + cp -r msd firmware eeprom-erase mass-storage-gadget* recovery* secure-boot* rpi-imager-embedded $out/share/rpiboot ''; meta = with lib; { From e59dcc1eb9c6f6301d22cde075a73767929a91c1 Mon Sep 17 00:00:00 2001 From: Steffen Vogel Date: Thu, 24 Oct 2024 20:14:11 +0200 Subject: [PATCH 5/6] rpiboot: remove 'with lib' usage --- pkgs/by-name/rp/rpiboot/package.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/by-name/rp/rpiboot/package.nix b/pkgs/by-name/rp/rpiboot/package.nix index bec3b9217d57..90c49b051be3 100644 --- a/pkgs/by-name/rp/rpiboot/package.nix +++ b/pkgs/by-name/rp/rpiboot/package.nix @@ -31,13 +31,13 @@ stdenv.mkDerivation rec { cp -r msd firmware eeprom-erase mass-storage-gadget* recovery* secure-boot* rpi-imager-embedded $out/share/rpiboot ''; - meta = with lib; { + meta = { homepage = "https://github.com/raspberrypi/usbboot"; changelog = "https://github.com/raspberrypi/usbboot/blob/${version}/debian/changelog"; description = "Utility to boot a Raspberry Pi CM/CM3/CM4/Zero over USB"; mainProgram = "rpiboot"; - license = licenses.asl20; - maintainers = with maintainers; [ + license = lib.licenses.asl20; + maintainers = with lib.maintainers; [ cartr flokli ]; From 108e1f1eff15815ed91e6eacb704a68d67db8da6 Mon Sep 17 00:00:00 2001 From: Steffen Vogel Date: Thu, 24 Oct 2024 20:14:33 +0200 Subject: [PATCH 6/6] rpiboot: add stv0g as maintainer --- pkgs/by-name/rp/rpiboot/package.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/pkgs/by-name/rp/rpiboot/package.nix b/pkgs/by-name/rp/rpiboot/package.nix index 90c49b051be3..424132d6361a 100644 --- a/pkgs/by-name/rp/rpiboot/package.nix +++ b/pkgs/by-name/rp/rpiboot/package.nix @@ -40,6 +40,7 @@ stdenv.mkDerivation rec { maintainers = with lib.maintainers; [ cartr flokli + stv0g ]; platforms = [ "aarch64-linux"