aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoseph Mingrone <jrm@FreeBSD.org>2026-05-28 22:05:48 +0000
committerJoseph Mingrone <jrm@FreeBSD.org>2026-06-03 18:21:22 +0000
commita20df639517c1ca99c5145d9e00293ec008a8391 (patch)
tree500254a05b8193131ee3d6cd56bb41b943c8b458
parent281839ef4bfaec79b65b5d834c7e000763fa5a97 (diff)
sysutils/rpi-usbboot: Raspberry Pi USB device provisioning tool
Reviewed by: emaste Tested by: emaste Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D57317
-rw-r--r--sysutils/Makefile1
-rw-r--r--sysutils/rpi-usbboot/Makefile22
-rw-r--r--sysutils/rpi-usbboot/distinfo3
-rw-r--r--sysutils/rpi-usbboot/files/patch-Makefile18
-rw-r--r--sysutils/rpi-usbboot/files/patch-main.c11
-rw-r--r--sysutils/rpi-usbboot/pkg-descr5
-rw-r--r--sysutils/rpi-usbboot/pkg-plist7
7 files changed, 67 insertions, 0 deletions
diff --git a/sysutils/Makefile b/sysutils/Makefile
index b4bc8334a6df..b6113c665988 100644
--- a/sysutils/Makefile
+++ b/sysutils/Makefile
@@ -1187,6 +1187,7 @@
SUBDIR += root-tail
SUBDIR += rovclock
SUBDIR += rpi-firmware
+ SUBDIR += rpi-usbboot
SUBDIR += rset
SUBDIR += rshim-user-space
SUBDIR += rsnapshot
diff --git a/sysutils/rpi-usbboot/Makefile b/sysutils/rpi-usbboot/Makefile
new file mode 100644
index 000000000000..bea00832c647
--- /dev/null
+++ b/sysutils/rpi-usbboot/Makefile
@@ -0,0 +1,22 @@
+PORTNAME= rpi-usbboot
+DISTVERSION= 20260603
+CATEGORIES= sysutils
+
+MAINTAINER= jrm@FreeBSD.org
+COMMENT= Raspberry Pi USB device provisioning tool
+WWW= https://github.com/raspberrypi/usbboot
+
+LICENSE= APACHE20
+LICENSE_FILE= ${WRKSRC}/LICENSE
+
+USES= gmake pkgconfig
+
+USE_GITHUB= yes
+GH_ACCOUNT= raspberrypi
+GH_PROJECT= usbboot
+GH_TAGNAME= 58c1051777998637083b9d7d8b8700dabf97d468
+
+ALL_TARGET= rpiboot
+MAKE_ARGS= INSTALL_PREFIX=${PREFIX} PKG_VER=${DISTVERSION}
+
+.include <bsd.port.mk>
diff --git a/sysutils/rpi-usbboot/distinfo b/sysutils/rpi-usbboot/distinfo
new file mode 100644
index 000000000000..4693fe32ab13
--- /dev/null
+++ b/sysutils/rpi-usbboot/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1780510799
+SHA256 (raspberrypi-usbboot-20260603-58c1051777998637083b9d7d8b8700dabf97d468_GH0.tar.gz) = 0826b38b1e07069edf73df0027a75e2dbe49ca09d8f9be86b10a6767c03aa9c7
+SIZE (raspberrypi-usbboot-20260603-58c1051777998637083b9d7d8b8700dabf97d468_GH0.tar.gz) = 126865434
diff --git a/sysutils/rpi-usbboot/files/patch-Makefile b/sysutils/rpi-usbboot/files/patch-Makefile
new file mode 100644
index 000000000000..e642d987385f
--- /dev/null
+++ b/sysutils/rpi-usbboot/files/patch-Makefile
@@ -0,0 +1,18 @@
+--- Makefile.orig 2026-05-27 13:41:12 UTC
++++ Makefile
+@@ -1,6 +1,3 @@
+-BUILD_DATE ?= $(shell date "+%Y/%m/%d")
+-PKG_VER=$(shell if [ -f debian/changelog ]; then grep rpiboot debian/changelog | head -n1 | sed 's/.*(\(.*\)).*/\1/g'; else echo local; fi)
+-GIT_VER=$(shell git rev-parse HEAD 2>/dev/null | cut -c1-8 || echo "")
+ HAVE_XXD=$(shell xxd -v >/dev/null 2>/dev/null && echo y)
+ INSTALL_PREFIX?=/usr
+ ifeq ($(OS),Windows_NT)
+@@ -10,7 +7,7 @@ rpiboot: main.c bootfiles.c decode_duid.c fmemopen.c m
+ endif
+
+ rpiboot: main.c bootfiles.c decode_duid.c fmemopen.c msd/bootcode.h msd/start.h msd/bootcode4.h
+- $(CC) -Wall -Wextra -g $(CPPFLAGS) $(CFLAGS) -o $@ main.c bootfiles.c decode_duid.c `pkg-config --cflags --libs libusb-1.0` -DGIT_VER="\"$(GIT_VER)\"" -DPKG_VER="\"$(PKG_VER)\"" -DBUILD_DATE="\"$(BUILD_DATE)\"" -DDEFAULT_MSG_DIR=\"$(DEFAULT_MSG_DIR)\" $(LDFLAGS)
++ $(CC) $(CPPFLAGS) $(CFLAGS) -o $@ main.c bootfiles.c decode_duid.c `pkg-config --cflags --libs libusb-1.0` -DPKG_VER="\"$(PKG_VER)\"" -DDEFAULT_MSG_DIR=\"$(DEFAULT_MSG_DIR)\" $(LDFLAGS)
+
+ ifeq ($(HAVE_XXD),y)
+ %.h: %.bin
diff --git a/sysutils/rpi-usbboot/files/patch-main.c b/sysutils/rpi-usbboot/files/patch-main.c
new file mode 100644
index 000000000000..9a8ec3d9e11c
--- /dev/null
+++ b/sysutils/rpi-usbboot/files/patch-main.c
@@ -0,0 +1,11 @@
+--- main.c.orig 2026-06-03 17:54:41 UTC
++++ main.c
+@@ -480,7 +480,7 @@ void print_version(void)
+
+ void print_version(void)
+ {
+- printf("RPIBOOT: build-date %s pkg-version %s %s\n", BUILD_DATE, PKG_VER, GIT_VER);
++ printf("RPIBOOT: FreeBSD package version %s\n", PKG_VER);
+ }
+
+ void get_options(int argc, char *argv[])
diff --git a/sysutils/rpi-usbboot/pkg-descr b/sysutils/rpi-usbboot/pkg-descr
new file mode 100644
index 000000000000..e3cf303a7a9c
--- /dev/null
+++ b/sysutils/rpi-usbboot/pkg-descr
@@ -0,0 +1,5 @@
+The rpiboot tool provides a file server for loading software into memory
+on a Raspberry Pi for provisioning. By default, it boots the device
+with firmware that makes it appear to the host as a USB mass-storage
+device. The host operating system then treats it as a standard USB
+drive, allowing the filesystem to be accessed.
diff --git a/sysutils/rpi-usbboot/pkg-plist b/sysutils/rpi-usbboot/pkg-plist
new file mode 100644
index 000000000000..3472f330909a
--- /dev/null
+++ b/sysutils/rpi-usbboot/pkg-plist
@@ -0,0 +1,7 @@
+bin/rpiboot
+share/rpiboot/mass-storage-gadget64/boot.img
+share/rpiboot/mass-storage-gadget64/bootfiles.bin
+share/rpiboot/mass-storage-gadget64/config.txt
+share/rpiboot/msd/bootcode.bin
+share/rpiboot/msd/bootcode4.bin
+share/rpiboot/msd/start.elf