¶What I did Plug the network cable, the HDMI screen and the USB keyboard to the HC4. And turn it on.

Remove Petitboot from the internal HC4 eMMC. Booting OpenBSD from Petitboot is not possible as of today. Booting OpenBSD requires using U-boot. When the Petitboot prompt appears, select Exit to shell and issue:

# flash_eraseall /dev/mtd0
# flash_eraseall /dev/mtd1
# flash_eraseall /dev/mtd2
# flash_eraseall /dev/mtd3

Then, turn the HC4 off. If you wish / need to restore Petitboot, check at the end of this post for a recovery procedure.

A few steps are required to get a bootable OpenBSD installer. They involve both the stock OpenBSD installer and the U-boot binary image. The setup can be done from any computer, I used my OpenBSD laptop. Insert the MicroSD card into the computer, copy the OpenBSD installer onto it. Then add some bits from the U-boot image.

# dd if=/ev/zero of=/dev/sda bs=1M status=progress
# dd if=miniroot75.img of=/dev/sda bs=1M status=progress
504+0 records in
504+0 records out
528482304 bytes transferred in 118.498 secs (4459824 bytes/sec)

# dd if=u-boot.bin.sd.bin of=/dev/sda bs=512 skip=1 seek=1 status=progress

2227+1 records in
2227+1 records out
1140592 bytes transferred in 3.278 secs (347929 bytes/sec)

# dd if=u-boot.bin.sd.bin of=/dev/sda bs=1 count=444 status=progress
444+0 records in
444+0 records out
444 bytes transferred in 0.005 secs (82760 bytes/sec)

The OpenBSD installer seem to expect you to use a serial console with arm64 machine. Hopefully, the HC4 can use an HDMI screen and a USB keyboard for operating. This requires telling the installer to rather use the framebuffer to print stuff.

# mount /dev/sda4 /mnt
mount: /mnt: unknown filesystem type 'ufs'.
root@opi516G:/home/alexlai/Downloads# mount /dev/sda1 /mnt
root@opi516G:/home/alexlai/Downloads# cat /mnt/config.txt 
arm_64bit=1
enable_uart=1
dtoverlay=disable-bt
kernel=u-boot.bin
root@opi516G:/home/alexlai/Downloads# mkdir /mnt/etc
root@opi516G:/home/alexlai/Downloads# echo "set tty fb0" > /mnt/etc/boot.conf

Remove Petitboot from the internal HC4 eMMC. Booting OpenBSD from Petitboot is not possible as of today. Booting OpenBSD requires using U-boot. When the Petitboot prompt appears, select Exit to shell and issue:

# flash_eraseall /dev/mtd0
# flash_eraseall /dev/mtd1
# flash_eraseall /dev/mtd2
# flash_eraseall /dev/mtd3

uart-2 , I used raspi 3 model B

# cu -s 115200 -l /dev/ttyU0   ---> erase char shift+backspace
cdn.openbsd.org --> http server

Take the MicroSD card out of the HC4 and plug it back to the computer. Then copy the U-boot image on it:

# dd if=Téléchargements/u-boot.bin.sd.bin of=/dev/sd2c bs=1M

The OpenBSD installer seem to expect you to use a serial console with arm64 machine. Hopefully, the HC4 can use an HDMI screen and a USB keyboard for operating. This requires telling the installer to rather use the framebuffer to print stuff.

# mount /dev/sd2a /mnt/usb 
# mkdir /mnt/usb/etc
# echo "set tty fb0" > /mnt/usb/etc/boot.conf
# umount /mnt/usb