Any news on OpenBSD? (Update: it works now)

Yes, as of last night, it is possible to run OpenBSD on MNT Reform, thanks to the work of bluerise, cinap_lenrek and sigrid.

Currently you need to do some manual steps to try it out, which will be automated further in the future. Here’s a recipe that assumes you are booting your normal system from eMMC. If your Reform is set to boot from SD card, adjust some steps (we can actually make a fully automatic SD card image later, or someone can help out?).

(Edit: swapped step 1 and 2, that way it makes more sense).

1. Get OpenBSD for aarch64

Get an OpenBSD aarch64 image. For testing I used miniroot72.img from Index of /pub/OpenBSD/snapshots/arm64/

And flash it to SD card (you can also go with a USB stick, but haven’t tested for now):

dd if=miniroot72.img of=/dev/sdx status=progress

2. Build and flash our latest u-boot with support for graphical console and keyboard:

git clone https://source.mnt.re/reform/reform-boundary-uboot
cd reform-boundary-uboot
cp mntreform-config .config
./build.sh

This will yield flash.bin. On your Reform, install it on eMMC (Warning: this might make your Reform unbootable from eMMC if something is done wrong, and will need to be recovered via SD card):

echo 0 > /sys/class/block/mmcblk0boot0/force_ro
dd if=flash.bin of=/dev/mmcblk0boot0 bs=1024 seek=33
echo 1 > /sys/class/block/mmcblk0boot0/force_ro

To flash u-boot to an SD card instead, do:

dd if=flash.bin of=/dev/sdx bs=1024 seek=33

(where sdx has to be replaced with your SD card device.)

3. Place a modified DTB file

There’s a hang related to PCIe in the OpenBSD boot process that needs to be fixed. For now, we use a DTB with disabled PCIe. You can download it here: openbsd-support/imx8mq-mnt-reform2.dtb · master · Reform / reform-boundary-uboot · GitLab

Mount the boot partition of your OpenBSD SD card and copy the imx8mq-mnt-reform2.dtb file onto it.

4. Boot it

Reboot your Reform. You should see an MNT logo and some u-boot output. Interrupt the boot process with a keypress. This will get you to the u-boot console.

Perform these steps to load the modified DTB and boot OpenBSD from the SD card (Edit: sorry, kernel and fdt addresses were swapped here):

load mmc 1:1 $fdt_addr_r imx8mq-mnt-reform2.dtb
load mmc 1:1 $kernel_addr_r efi/boot/bootaa64.efi
bootefi $kernel_addr_r $fdt_addr_r 

Normally this can work automatically (because we support distroboot) but we have to manually load the modified DTB for now.

This will launch the OpenBSD bootloader. We have to set a variable so quickly press space when the boot> prompt appears.

Then enter:

set tty fb0

And press enter again to boot.

8 Likes