pkgsrc-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

CVS commit: pkgsrc/misc/raspberrypi-usbboot



Module Name:    pkgsrc
Committed By:   khorben
Date:           Tue Mar 31 13:57:50 UTC 2026

Added Files:
        pkgsrc/misc/raspberrypi-usbboot: DESCR Makefile PLIST distinfo
        pkgsrc/misc/raspberrypi-usbboot/patches: patch-Makefile
            patch-fmemopen.c

Log Message:
misc: import raspberrypi-usbboot version 1.0

This contains the Raspberry Pi USB device boot software known as rpiboot. 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. An operating system image can be written to the device using the
Raspberry Pi Imager.

On Compute Module 4 and newer devices, rpiboot is also used to update the
bootloader SPI flash EEPROM.

Tested on macOS/amd64 and NetBSD/amd64.


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 pkgsrc/misc/raspberrypi-usbboot/DESCR \
    pkgsrc/misc/raspberrypi-usbboot/Makefile \
    pkgsrc/misc/raspberrypi-usbboot/PLIST \
    pkgsrc/misc/raspberrypi-usbboot/distinfo
cvs rdiff -u -r0 -r1.1 pkgsrc/misc/raspberrypi-usbboot/patches/patch-Makefile \
    pkgsrc/misc/raspberrypi-usbboot/patches/patch-fmemopen.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Added files:

Index: pkgsrc/misc/raspberrypi-usbboot/DESCR
diff -u /dev/null pkgsrc/misc/raspberrypi-usbboot/DESCR:1.1
--- /dev/null   Tue Mar 31 13:57:50 2026
+++ pkgsrc/misc/raspberrypi-usbboot/DESCR       Tue Mar 31 13:57:50 2026
@@ -0,0 +1,10 @@
+This contains the Raspberry Pi USB device boot software known as rpiboot. 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. An operating system image can be written to the device using the
+Raspberry Pi Imager.
+
+On Compute Module 4 and newer devices, rpiboot is also used to update the
+bootloader SPI flash EEPROM.
Index: pkgsrc/misc/raspberrypi-usbboot/Makefile
diff -u /dev/null pkgsrc/misc/raspberrypi-usbboot/Makefile:1.1
--- /dev/null   Tue Mar 31 13:57:50 2026
+++ pkgsrc/misc/raspberrypi-usbboot/Makefile    Tue Mar 31 13:57:50 2026
@@ -0,0 +1,28 @@
+# $NetBSD: Makefile,v 1.1 2026/03/31 13:57:50 khorben Exp $
+
+DISTNAME=      usbboot-1.0
+PKGNAME=       raspberrypi-${DISTNAME}
+CATEGORIES=    misc
+MASTER_SITES=  ${MASTER_SITE_GITHUB:=raspberrypi/}
+GITHUB_PROJECT=        usbboot
+GITHUB_TAG=    windows-v1.0
+
+MAINTAINER=    pkgsrc-users%NetBSD.org@localhost
+HOMEPAGE=      https://github.com/raspberrypi/usbboot
+COMMENT=       Raspberry Pi USB device boot
+LICENSE=       apache-2.0
+
+USE_LANGUAGES= c
+USE_TOOLS+=    gmake pkg-config
+
+BUILD_DEPENDS+=        vim-share-[0-9]*:../../editors/vim-share
+BUILD_TARGET=  rpiboot
+
+MAKE_FLAGS+=   DESTDIR=${DESTDIR}
+MAKE_FLAGS+=   INSTALL_PREFIX=${PREFIX}
+MAKE_FLAGS+=   GIT_VER=${GITHUB_TAG}
+MAKE_FLAGS+=   PKG_VER=${PKGVERSION}
+AUTO_MKDIRS=   yes
+
+.include "../../devel/libusb1/buildlink3.mk"
+.include "../../mk/bsd.pkg.mk"
Index: pkgsrc/misc/raspberrypi-usbboot/PLIST
diff -u /dev/null pkgsrc/misc/raspberrypi-usbboot/PLIST:1.1
--- /dev/null   Tue Mar 31 13:57:50 2026
+++ pkgsrc/misc/raspberrypi-usbboot/PLIST       Tue Mar 31 13:57:50 2026
@@ -0,0 +1,8 @@
+@comment $NetBSD: PLIST,v 1.1 2026/03/31 13:57:50 khorben Exp $
+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
Index: pkgsrc/misc/raspberrypi-usbboot/distinfo
diff -u /dev/null pkgsrc/misc/raspberrypi-usbboot/distinfo:1.1
--- /dev/null   Tue Mar 31 13:57:50 2026
+++ pkgsrc/misc/raspberrypi-usbboot/distinfo    Tue Mar 31 13:57:50 2026
@@ -0,0 +1,7 @@
+$NetBSD: distinfo,v 1.1 2026/03/31 13:57:50 khorben Exp $
+
+BLAKE2s (usbboot-1.0.tar.gz) = 02e024234b5bd33ecf6955e94ff1aee2176c409b36a20b657acae38cccb5383d
+SHA512 (usbboot-1.0.tar.gz) = 3653fe3c15c5f98998e3dfcbd4e028ab02f450616f5f0f26a75e5f8dd79a9759794fa4bbf718fca08417071e1cdfd2a46706cb2f4ef8cd0d39b7c3936b176906
+Size (usbboot-1.0.tar.gz) = 127060298 bytes
+SHA1 (patch-Makefile) = 8c9b8795674ea0466e245527c5b0ed77e9f76013
+SHA1 (patch-fmemopen.c) = 011a7ee5a974ba17907eafe1b38ef76c6b74d4a3

Index: pkgsrc/misc/raspberrypi-usbboot/patches/patch-Makefile
diff -u /dev/null pkgsrc/misc/raspberrypi-usbboot/patches/patch-Makefile:1.1
--- /dev/null   Tue Mar 31 13:57:50 2026
+++ pkgsrc/misc/raspberrypi-usbboot/patches/patch-Makefile      Tue Mar 31 13:57:50 2026
@@ -0,0 +1,39 @@
+$NetBSD: patch-Makefile,v 1.1 2026/03/31 13:57:50 khorben Exp $
+
+This adds support for DESTDIR.
+
+--- Makefile.orig      2026-01-22 16:28:50.000000000 +0000
++++ Makefile
+@@ -33,20 +33,20 @@ bin2c: bin2c.c
+ endif
+ 
+ install: rpiboot
+-      install -m 755 rpiboot $(INSTALL_PREFIX)/bin/
+-      install -d $(INSTALL_PREFIX)/share/rpiboot
+-      install -d $(INSTALL_PREFIX)/share/rpiboot/msd
+-      install -d $(INSTALL_PREFIX)/share/rpiboot/mass-storage-gadget64
+-      install -m 644 msd/bootcode.bin  $(INSTALL_PREFIX)/share/rpiboot/msd
+-      install -m 644 msd/bootcode4.bin $(INSTALL_PREFIX)/share/rpiboot/msd
+-      install -m 644 msd/start.elf  $(INSTALL_PREFIX)/share/rpiboot/msd
+-      install -m 644 mass-storage-gadget64/boot.img $(INSTALL_PREFIX)/share/rpiboot/mass-storage-gadget64
+-      install -m 644 mass-storage-gadget64/config.txt $(INSTALL_PREFIX)/share/rpiboot/mass-storage-gadget64
+-      install -m 644 mass-storage-gadget64/bootfiles.bin $(INSTALL_PREFIX)/share/rpiboot/mass-storage-gadget64
++      install -m 755 rpiboot $(DESTDIR)$(INSTALL_PREFIX)/bin/
++      install -d $(DESTDIR)$(INSTALL_PREFIX)/share/rpiboot
++      install -d $(DESTDIR)$(INSTALL_PREFIX)/share/rpiboot/msd
++      install -d $(DESTDIR)$(INSTALL_PREFIX)/share/rpiboot/mass-storage-gadget64
++      install -m 644 msd/bootcode.bin  $(DESTDIR)$(INSTALL_PREFIX)/share/rpiboot/msd
++      install -m 644 msd/bootcode4.bin $(DESTDIR)$(INSTALL_PREFIX)/share/rpiboot/msd
++      install -m 644 msd/start.elf  $(DESTDIR)$(INSTALL_PREFIX)/share/rpiboot/msd
++      install -m 644 mass-storage-gadget64/boot.img $(DESTDIR)$(INSTALL_PREFIX)/share/rpiboot/mass-storage-gadget64
++      install -m 644 mass-storage-gadget64/config.txt $(DESTDIR)$(INSTALL_PREFIX)/share/rpiboot/mass-storage-gadget64
++      install -m 644 mass-storage-gadget64/bootfiles.bin $(DESTDIR)$(INSTALL_PREFIX)/share/rpiboot/mass-storage-gadget64
+ 
+ uninstall:
+-      rm -f $(INSTALL_PREFIX)/bin/rpiboot
+-      rm -rf $(INSTALL_PREFIX)/share/rpiboot
++      rm -f $(DESTDIR)$(INSTALL_PREFIX)/bin/rpiboot
++      rm -rf $(DESTDIR)$(INSTALL_PREFIX)/share/rpiboot
+ 
+ clean:
+       rm -f rpiboot msd/*.h bin2c
Index: pkgsrc/misc/raspberrypi-usbboot/patches/patch-fmemopen.c
diff -u /dev/null pkgsrc/misc/raspberrypi-usbboot/patches/patch-fmemopen.c:1.1
--- /dev/null   Tue Mar 31 13:57:50 2026
+++ pkgsrc/misc/raspberrypi-usbboot/patches/patch-fmemopen.c    Tue Mar 31 13:57:50 2026
@@ -0,0 +1,35 @@
+$NetBSD: patch-fmemopen.c,v 1.1 2026/03/31 13:57:50 khorben Exp $
+
+Removes a confusion between the opaque type fpos_t and off_t.
+Fixes the build on NetBSD.
+
+--- fmemopen.c.orig    2026-01-22 16:28:50.000000000 +0000
++++ fmemopen.c
+@@ -53,7 +53,7 @@ static int writefn(void *handler, const 
+   return size;
+ }
+ 
+-static fpos_t seekfn(void *handler, fpos_t offset, int whence) {
++static off_t seekfn(void *handler, off_t offset, int whence) {
+   size_t pos;
+   fmem_t *mem = handler;
+ 
+@@ -83,7 +83,7 @@ static fpos_t seekfn(void *handler, fpos
+   }
+ 
+   mem->pos = pos;
+-  return (fpos_t)pos;
++  return (off_t)pos;
+ }
+ 
+ static int closefn(void *handler) {
+@@ -92,7 +92,8 @@ static int closefn(void *handler) {
+ }
+ 
+ FILE *fmemopen(void *buf, size_t size, const char *mode) {
+-  #pragma unused(mode)
++  (void) mode;
++
+   // This data is released on fclose.
+   fmem_t* mem = (fmem_t *) malloc(sizeof(fmem_t));
+ 



Home | Main Index | Thread Index | Old Index