After jsg@ mentioned that booting a Raspberry Pi 3 from a USB device
might be
possible, I decided to find out how deep the rabbit hole is.
As it turns out,
it's currently a bit convoluted, but it can be made
to work with OpenBSD.
First off, USB boot support is just now getting fully ironed out.
You'll need
to update the firmware on your Pi to make it work. I
installed the latest
(2017-03-02) Raspbian image to an SD card and
booted the Pi from that. While
booted in Raspbian, update the
firmware:

sudo apt-get update
sudo apt-get
install rpi-update
sudo rpi-update

It's then necessary to actually enable USB
boot support. Add the
following 2 lines to /boot/config.txt to enable USB boot
mode and set
a 5-second timeout to allow time for USB device initialization:
program_usb_boot_mode=1
program_usb_boot_timeout=1

NOTE: Apparently these
variables are set in the Pi's OTP memory, which
means once they're set, they
can't ever be unset.

Reboot for the changes to take effect. At this point the
Pi should be
ready to support USB booting.

While you still have a working
Raspbian install, grab a copy of the
/boot/bootcode.bin and /boot/start.elf
files for later use; apparently
we need these special versions of those two
files for USB boot
support. At this point we're done with Raspbian and can
shut it down
to install OpenBSD.

Next, write the OpenBSD miniroot60.fs to an
SD card, plug in your USB
drive, and boot the Pi. You should be greeted with
the usual OpenBSD
installer, and you should be able to install to your USB
drive
(probably sd0). Once the installer is done, run 'halt', unplug the Pi,
and remove the SD card and USB drive.

To make your USB drive bootable, you'll
need to plug it into another
system and mount its 'i' partition (the FAT32
boot partition) to make
a few changes. Replace the bootcode.bin and start.elf
files with the
ones from Raspbian, and add the u-boot.bin file from the 'i'
partition
of your miniroot60.fs SD card.

With those changes made, your Pi
should be able to boot OpenBSD
directly from a USB drive with no SD card
needed. Note that it seems
to take around 10 seconds for the Pi to reach the
OpenBSD bootloader
and fire up the kernel.

Hope this information is helpful
to someone...

-- 
 Joe Gidi
 j...@entropicblur.com

 "You cannot buy skill."
-- Ross Seyfried

Reply via email to