OpenBSD 7.4, Raspberry Pi 3 model B+ Install Guide

microSD to USB adapter

ARM64 release directory, fileset descriptions.

Burn the miniroot to the microSD card, and the full disk image to the USB drive.

# cat miniroot74.img >/dev/sda
# cat install74.img >/dev/sdb

Create another partition on the USB drive using cfdisk with 500 megabytes of space (larger than necessary) of type W95 FAT32 (LBA). This is the same type as the FAT partition originally from install74.img.

# mkfs.fat /dev/sdb2
# mount /dev/sdb2 /mnt
# cp bwfm-firmware-20200316.1.3p3.tgz /mnt
# umount /mnt

To inspect the OpenBSD partition from the disk image:

# mount -r -t ufs -o ufstype=44bsd /dev/sda4 /mnt

Wire the USB-to-TTL cable to the Raspberry Pi. Plug the cable in, then use

$ screen /dev/ttyUSB0 115200

to connect to the serial cable. You may need to add your user to the uucp group or similar; check the permissions with

$ ls -l /dev/ttyUSB0

If Screen starts printing roguish messages, perhaps it thinks you play Nethack...

Then power on the Raspberry Pi. You can allow the U-Boot Hit any key to stop autoboot prompt to expire, but at OpenBSD's boot> prompt you must interrupt it.

Our idea is this: the microSD (miniroot74.img) and the USB (install74.img) both contain an OpenBSD bootloader that U-Boot will recognize. We'll use the microSD's boot loader to boot the USB's kernel. That's the one with the full install media, which we use to install OpenBSD to the microSD card. After that the USB drive is unnecessary and you can repurpose it for another computer.

disks: sd0* sd1
>> OpenBSD/arm64 BOOTAA64 1.18
boot> boot sd1a:/bsd

You can also use commands like

boot> ls sd0a:/

to examine the filesystem. For me, sd0 was the microSD card and sd1 the USB drive.

Now read the ARM-specific INSTALL file and the FAQ's installation entry. Installation is straightforward, but here are a couple notes:

You can now reboot fully from the SD card. Here are some final touches to consider.

If you're not going to add your hostname to DNS (e.g., sappho.sigxcpu.com), you should make it resolve locally by adding to /etc/hosts:

127.0.0.1 sappho.sigxcpu.com
::1 sappho.sigxcpu.com

To disable the slow relinking of system libraries on boot, add this to /etc/rc.conf.local (see rc.conf(8)):

library_aslr=NO

To connect to WiFi, you first need to get the firmware files onto your Pi. They're on the USB, in a new FAT32 partition, but you have to add the partition to the disklabel of the OpenBSD partition (see disklabel(8)).

# disklabel -e sd1

Within vi, you can use the following incantation:

:r !disklabel -d sd1 | grep j:

Then maneuver the line right below i:, write the changes, and exit.

# mount /dev/sd1j /mnt
# fw_update /mnt/bwfm-firmware-20200316.1.3p3.tgz

Now you can connect to WiFi using the regular ifconfig method.