Skip to contentSkip to conversation

raspberrypi-usbboot: new package

PATCH Superseded Thomas Petazzoni 3 participants 4 messages Dec 5, 2016 – Dec 6, 2016 Broadcom BCM2711/BCM2835 Arm architecture

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 raspberrypi-usbboot: new package

This new package currently installs the "rpiboot" utility, which is needed to access via USB mass storage the built-in eMMC of Raspberry Pi compute modules.

---
Changes since v1:
- Use the separate https://github.com/raspberrypi/usbboot repository, which contains just the rpiboot tool, and which according to
https://github.com/raspberrypi/tools/issues/71 is not the official upstream.
- Add hash file.
- Add reference to the upstream pull request for the patches.

---
 package/Config.in.host                             |   1 +
 ...001-Makefile-allow-passing-CFLAGS-LDFLAGS.patch |  28 +++++
 .../0002-Makefile-add-DESTDIR-support.patch        |  49 ++++++++
 ...rk-logic-to-find-def1-def2-and-def3-files.patch | 127 +++++++++++++++++++++
 package/raspberrypi-usbboot/Config.in.host         |  12 ++
 .../raspberrypi-usbboot/raspberrypi-usbboot.hash   |   2 +
 package/raspberrypi-usbboot/raspberrypi-usbboot.mk |  21 ++++
 7 files changed, 240 insertions(+)
 create mode 100644 package/raspberrypi-usbboot/0001-Makefile-allow-passing-CFLAGS-LDFLAGS.patch
 create mode 100644 package/raspberrypi-usbboot/0002-Makefile-add-DESTDIR-support.patch
 create mode 100644 package/raspberrypi-usbboot/0003-main.c-rework-logic-to-find-def1-def2-and-def3-files.patch
 create mode 100644 package/raspberrypi-usbboot/Config.in.host
 create mode 100644 package/raspberrypi-usbboot/raspberrypi-usbboot.hash
 create mode 100644 package/raspberrypi-usbboot/raspberrypi-usbboot.mk
package/Config.in.host +1 -0
index 3b115c5..3c8998e 100644
@@ -35,6 +35,7 @@ menu "Host utilities"
 	source "package/patchelf/Config.in.host"
 	source "package/pwgen/Config.in.host"
 	source "package/qemu/Config.in.host"
+	source "package/raspberrypi-usbboot/Config.in.host"
 	source "package/sam-ba/Config.in.host"
 	source "package/squashfs/Config.in.host"
 	source "package/sunxi-tools/Config.in.host"
package/raspberrypi-usbboot/0001-Makefile-allow-passing-CFLAGS-LDFLAGS.patch new file +28 -0
new file mode 100644
index 0000000..cdab607
@@ -0,0 +1,28 @@
+From 5b015e67af27679f4ca8f7f5f2f71020ec054b0c Mon Sep 17 00:00:00 2001
+From: Thomas Petazzoni <[email protected]>
+Date: Fri, 2 Dec 2016 23:09:44 +0100
+Subject: [PATCH] Makefile: allow passing CFLAGS/LDFLAGS
+
+This might be needed to pass some custom CFLAGS/LDFLAGS when building
+rpiboot.
+
+Submitted-upstream: https://github.com/raspberrypi/usbboot/pull/2
+Signed-off-by: Thomas Petazzoni <[email protected]>
+---
+ Makefile | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/Makefile b/Makefile
+index 3e7d1e4..d9a7220 100755
+--- a/Makefile
++++ b/Makefile
+@@ -1,5 +1,5 @@
+ rpiboot: main.c
+-	$(CC) -g -o $@ $< -lusb-1.0
++	$(CC) -g $(CFLAGS) -o $@ $< -lusb-1.0 $(LDFLAGS)
+ 
+ install: rpiboot
+ 	cp rpiboot /usr/bin
+-- 
+2.7.4
+
package/raspberrypi-usbboot/0002-Makefile-add-DESTDIR-support.patch new file +49 -0

49 lines not on this page · raw message

package/raspberrypi-usbboot/0003-main.c-rework-logic-to-find-def1-def2-and-def3-files.patch new file +127 -0

127 lines not on this page · raw message

package/raspberrypi-usbboot/Config.in.host new file +12 -0
new file mode 100644
index 0000000..dce2fcc
@@ -0,0 +1,12 @@
+config BR2_PACKAGE_HOST_RASPBERRYPI_USBBOOT
+	bool "host raspberrypi-usbboot"
+	depends on BR2_arm
+	help
+	  This package builds and install the "rpiboot" tool for the
+	  host machine. This tool allows to boot the Broadcom BCM
+	  processor used in the RaspberryPi to boot over USB, and have
+	  it expose a USB mass storage device in order to reflash the
+	  built-in storage of the RaspberryPi (useful for the eMMC
+	  built into the Compute module).
+
+	  https://github.com/raspberrypi/usbboot
package/raspberrypi-usbboot/raspberrypi-usbboot.hash new file +2 -0
new file mode 100644
index 0000000..94860a9
@@ -0,0 +1,2 @@
+# Locally calculated
+sha256 a8893f8a10522bd58866eb34e7f0d7731c43200d585f122681f428cdef76e676 raspberrypi-usbboot-f4e3f0f9a3c64d846ba53ec3367e33a4f9a7d051.tar.gz
package/raspberrypi-usbboot/raspberrypi-usbboot.mk new file +21 -0
new file mode 100644
index 0000000..7018617
@@ -0,0 +1,21 @@
+################################################################################
+#
+# raspberrypi-usbboot
+#
+################################################################################
+
+RASPBERRYPI_USBBOOT_VERSION = f4e3f0f9a3c64d846ba53ec3367e33a4f9a7d051
+RASPBERRYPI_USBBOOT_SITE = $(call github,raspberrypi,usbboot,$(RASPBERRYPI_USBBOOT_VERSION))
+
+HOST_RASPBERRYPI_USBBOOT_DEPENDENCIES = host-libusb
+
+define HOST_RASPBERRYPI_USBBOOT_BUILD_CMDS
+	$(HOST_MAKE_ENV) $(MAKE) $(HOST_CONFIGURE_OPTS) -C $(@D)
+endef
+
+define HOST_RASPBERRYPI_USBBOOT_INSTALL_CMDS
+	$(HOST_MAKE_ENV) $(MAKE) $(HOST_CONFIGURE_OPTS) -C $(@D) \
+		DESTDIR=$(HOST_DIR) install
+endef
+
+$(eval $(host-generic-package))
Signature · 1 line
2.7.4
#1 lore raw

PATCH v2 1/1 raspberrypi-usbboot: new package

Hi Thomas,

Quoted 11 lines · Thomas Petazzoni

This new package currently installs the "rpiboot" utility, which is needed to access via USB mass storage the built-in eMMC of Raspberry Pi compute modules.

---
Changes since v1:
- Use the separate https://github.com/raspberrypi/usbboot repository, which contains just the rpiboot tool, and which according to
https://github.com/raspberrypi/tools/issues/71 is not the official upstream.

s/not/now/?

baruch

Signature · 3 lines
     http://baruch.siach.name/blog/                  ~. .~   Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
   - baruch at tkos.co.il - tel: +972.52.368.4656, http://www.tkos.co.il -
#2 lore raw

PATCH v2 1/1 raspberrypi-usbboot: new package

Hello,

Quoted 13 lines · Baruch Siach
Quoted 11 lines · Thomas Petazzoni

This new package currently installs the "rpiboot" utility, which is needed to access via USB mass storage the built-in eMMC of Raspberry Pi compute modules.

---
Changes since v1:
- Use the separate https://github.com/raspberrypi/usbboot repository, which contains just the rpiboot tool, and which according to
https://github.com/raspberrypi/tools/issues/71 is not the official upstream.

Quoted 1 line

s/not/now/?

Yes, indeed.

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
#3 lore raw

PATCH v2 1/1 raspberrypi-usbboot: new package

In reply to Thomas Petazzoni

package/raspberrypi-usbboot/Config.in.host line 3

Quoted 11 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Thomas" == Thomas Petazzoni <[email protected]> writes:

This new package currently installs the "rpiboot" utility, which is needed to access via USB mass storage the built-in eMMC of Raspberry Pi compute modules.

package/raspberrypi-usbboot/Config.in.host new file +3 -0
+config BR2_PACKAGE_HOST_RASPBERRYPI_USBBOOT
+	bool "host raspberrypi-usbboot"
+	depends on BR2_arm

For rpi3 it might be good to add || BR2_aarch64, but that can be done later.

Committed, thanks.

Signature · 1 line
Bye, Peter Korsgaard