raspberrypi / usbboot

Raspberry Pi USB booting code, moved from tools repository
Apache License 2.0
910 stars 229 forks source link

Directory overlay support #23

Closed burtyb closed 6 years ago

burtyb commented 6 years ago

Option "-o" allows rpiboot to send files to the devices based on its USB Path. Option "-mX" allows the delay time to be increased to reduce CPU usage "-m500" would set the default of 500 msec.

Using "... -o -d /example" preloads bootcode.bin from "/example/bootcode.bin" as normal. But when loading other files such as cmdline.txt it first checks to see if the file exists in the overlay directory so for example top left USB port on a Pi 3 has a USB path "1-1.2" so it first tries to load "/example/1-1.2/cmdline.txt" if this isn't found it will falls back to loading "/example/cmdline.txt".

I'm currently using this to boot Pi Zeros in the Cluster HAT with USB Gadget Ethernet + nfsroot where using the overlay allows using specific kernel options to set a static IP address, nfsroot paths, etc.

burtyb commented 6 years ago

I've updated the code to use the more regular "-m 500" command line option format.

ghollingworth commented 6 years ago

Have you tested this on Mac, PC and Raspberry Pi ?

burtyb commented 6 years ago

I've tested on PC (Windows 7 with cygwin) and Raspberry Pi 3 (Raspbian Stretch) but I don't own any Apple products so I'm unable to test on Mac.