Friday, December 04, 2020

OpenBSD on Raspberry Pi 4

Hi!

I've managed to install OpenBSD 6.8 (and newer snapshots) on a Pi4 (not
Pi400!) on a USB stick without the need for a SD card or a TTL serial
interface adapter as noted in the official installation notes for arm64.

Here is what I did:

Download miniroot68.img and write it to a sd card.
Mount the msdos partition and copy the EFI (and subdirectories) to a
temporary location.
Unmount the msdos partition and delete it (the one provided is to small)
Create a new msdos partition, format it and mount it.
Download the latest release from https://github.com/pftf/RPi4 (I've tested
v1.21)
Unpack it to the msdos partition, and copy the EFI directory back.
Unmount msdos partition and insert the USB stick in your Pi, and boot it.

Press ESC during boot so you get into the UEFI settings.
Go to Device Manager -> Raspberry Pi Configuration -> Advanced Configuration
Disable 3GB memory limit and change System Table Selection from ACPI to
Device Tree.
Save (F10) and ctrl-alt-delete

At OpenBSD boot prompt
set tty fb0
boot

ACPI also seems to work (as in as it boots), but I get more devices are
marked as "not configured" in dmesg. People way smarter than me can
probably comment on why this happens.

Go through installation as normal. When reboot, enter the shell and do a
"echo set tty fb0 > /mnt/etc/boot.conf"
Reboot and shutdown the Pi. Disconnect the USB drive and connect it to
another computer, and unpack the EFI files again, as the old filesystem is
deleted during install. They will also get overwritten during sysupgrade,
so be aware.

The msdos partition on miniroot68.img is too small to fit the UEFI files,
so that's the reason why you have to remove it. Fortunately there's 16MB of
free space at the beginning of the image you can use.

Not sure why, but the screen/text during installation (and upgrade) isn't
full screen. But when running the normal kernel it is.
Xorg also works. For reasons I don't understand you won't be asked to
choose keyboard layout. during installation.

I've tested this on both a 4GB model and 8GB model. Pi400 does not work
with the UEFI boot yet, but when it does OpenBSD will most probably work as
well.

No comments:

Post a Comment