diff options
Diffstat (limited to 'content/posts/2021-10-30-openbsd.smd')
-rw-r--r-- | content/posts/2021-10-30-openbsd.smd | 84 |
1 files changed, 84 insertions, 0 deletions
diff --git a/content/posts/2021-10-30-openbsd.smd b/content/posts/2021-10-30-openbsd.smd new file mode 100644 index 0000000..5551532 --- /dev/null +++ b/content/posts/2021-10-30-openbsd.smd @@ -0,0 +1,84 @@ +--- +.title = "OpenBSD", +.author = "Martin Ashby", +.date = @date("2021-10-30T20:25:43+01:00"), +.layout = "single.shtml", +.custom = {"comments": true}, +--- + +I've tried installing & using [OpenBSD](https://openbsd.org/) 7.0 on my Pinebook Pro. I've previously used OpenBSD on a small VPS just to try it out, and I was quite impressed. + +Unfortunately installing on the pinebook has been significantly more rocky than installing various linux flavours, and the performance isn't quite good enough for me to continue using it. I hope to revisit in future as I like the philosophy of the project. Support for the pinebook and aarch64 hardware in general seems quite new for OpenBSD so it's likely to continue to mature as more knowledgable users try it out and fix things. + +I'll write up my installation process, with gotchas, as there were a couple. + +## Prerequisites +I started with a pinebook running Manjaro ARM installed to the eMMC. I had a couple of 32GB micro SD cards available, a few USB mass storage devices to hand, and the [USB serial converter](https://pine64.com/product/pinebook-pinephone-pinetab-serial-console/) for the pinebook pro. I have another regular x86 laptop running Manjaro also, with SD card reader. The USB serial converter is necessary since the OpenBSD installer can't drive the display. + +I wanted OpenBSD installed to the eMMC device. + +## Process +0. Back up all your stuff. This process will wipe your entire pinebook. +1. Read the [official installation instructions](https://ftp.openbsd.org/pub/OpenBSD/snapshots/arm64/INSTALL.arm64) +2. Read [this blog post](https://xosc.org/pinebookpro.html) about installing on an older version. I find narratives like this easier to read and follow than the official docs. + +## Create the installer +3. Download all the files from [this FTP folder](https://ftp.openbsd.org/pub/OpenBSD/snapshots/arm64/). You need mostly all of them, [mirrors](https://www.openbsd.org/ftp.html) are available around the world. +4. Use dd to copy the install70.img to an empty SD card +``` +sudo dd if=install70.img of=/dev/mmcblk2 bs=4M conv=fsync status=progress +``` +5. Copy everything else from that folder to a standard USB memory stick. This is important because unless you have a USB ethernet, you won't be able to download those files during the installation process, as the WiFi chip isn't supported. +6. Download and unzip the [u-boot package](https://ftp.openbsd.org/pub/OpenBSD/snapshots/packages/aarch64/u-boot-aarch64-2021.10p0.tgz). The u-boot that Manjaro ARM installs isn't capable of booting OpenBSD. +7. Use dd to copy in the u-boot files to the appropriate location on the SD card +``` +sudo dd if=share/u-boot/pinebook-pro-rk3399/idbloader.img of=/dev/mmcblk2 seek=64 +sudo dd if=share/u-boot/pinebook-pro-rk3399/u-boot.itb of=/dev/mmcbkl2 seek=16384 +sync +``` +8. Download all the files from [this FTP folder](http://firmware.openbsd.org/firmware/7.0/) and copy them all to the standard USB memory stick in a subfolder (e.g. firmware). This is required additional non-free firmware to get the wifi working. + +## Wipe the eMMC +9. The u-boot that Manjaro ARM installs isn't capable of booting OpenBSD. It hangs on a line about 'ochi0' and won't proceed. So, you need to wipe u-boot off the eMMC before the installer will boot! To do this, take another micro SD card, write your favourite supported linux build for the pinebook pro, and use gparted to make a new parttion table for the eMMC card. + +## Enable USB serial interface +10. Turn off your Pinebook, follow the [disassembly guide](https://wiki.pine64.org/wiki/Pinebook_Pro#Mainboard_Switches_and_Buttons) and toggle the headphone / serial console switch. Put the case back together. Try not to lose the screws. + +## Install OpenBSD +11. Insert the SD card with OpenBSD. +12. Connect the USB serial to your headphone jack and another computer (mine is a x86 laptop running Manjaro) +13. Start up `screen` or similar program to connect to the serial interface +``` +sudo screen /dev/ttyUSB0 115200 +``` +14. Connect the USB mass storage device with other files on it. +15. Power on the pinebook. If everything went well, you should see OpenBSD installer prompt eventually in your screen session. +16. Follow the on-screen instructions to install. I had to choose a few non-default options: + +a. Change the install disk to sd1. You can use ? to show disk info, sd1 was the eMMC card for me. + +b. When prompted to install filesets, choose 'disk' rather than network, 'no' for 'is the disk already mounted' and 'sd2' for the disk. This corresponded to my USB mass storage device. + +17. When the install is complete, reboot. I had to hold the power button, it seems OpenBSD can't trigger the actual power off. You need to leave the SD card in, as u-boot isn't installed to the eMMC module! + +## Install firmware and u-boot +18. Power on the pinebook again. Login as root over your serial console connection. +19. Mount the USB mass storage, something like `mount /dev/sd2i /mnt`, and use [fw_update](https://man.openbsd.org/fw_update) with -p option to use the firmware files on the USB rather than try to get them from the internet. +20. Configure your wireless card by adding [/etc/hostname.bwfm0](https://man.openbsd.org/hostname.if.5) file with the following content +``` +nwid <network-ssid> wpakey <password> +inet autoconf +``` +21. Reboot. You should now have access to the internet to install stuff! +22. Install u-boot-aarch64 package `pkg_add u-boot-aarch64` and run through similar instructions as before to write the files to the appropriate place on the eMMC card this time. Note the files are stored in /usr/local/share... and the eMMC card is now something like /dev/rsd0! +23. Reboot again, this time removing the SD card. You should be able to boot without it now. + +## Enable graphics +24. Enable [xenodm](https://man.openbsd.org/xenodm.1) with `rcctl enable xenodm` +25. Reboot. You should now get graphical login! + +From here the OpenBSD manual pages and various guides/blogs should help you build the system you want. + +I installed gnome as my desktop, but this has proven too slow without hardware acceleration (which OpenBSD still lacks on Pinebook Pro) + +I hope these instructions were useful, if you have a comment or correction please let me know via martin (at) mfashby.net. |