💾 Archived View for sdf.org › rg19 › core › 2023.11.23-obsd-pt-1.gmi captured on 2023-12-28 at 16:43:28. Gemini links have been rewritten to link to archived content

View Raw

More Information

-=-=-=-=-=-=-

OpenBSD 7.4 Experiments Part 1: Installation and Exploration

By November of 2023, the Udoo Bolt v8 running Void Linux was having networking issues. It would disappear completely from the network and be unresponsive to ping and SSH. As a file server, it was pretty useless... The quirks and slow behaviour of NetBSD on the Pi Zero W were getting old, and the attempts to run FreeBSD on the Pi were a miserable failure as it always insisted on USB for the console, NOT the UART pins. I've tried everything I could think of to make it use the UART pins, always to no avail. This is just as well since it wouldn't detect the Ethernet hat anyway, while enabling a driver that might make it work was pointless since I couldn't even use the damn thing without a keyboard and monitor attached, or SSH from the Bolt (and completely defeating the point).

I gave up and bought a Raspberry Pi 4 since it is known to have Ethernet support under FreeBSD. I figured a faster processor would be nice for building Go programs. I'll keep it short and say that while I was able to use the UART serial pins for the terminal, there was a major issue that I could NOT solve; SSL certificates. For no apparent reason at all, any program that relied on SSL would fail to validate the certificates, DESPITE having installed the ca-root-nss package. The only exception was pkg itself, and no amount of searching the internet turned up a solution. Oh there were other issues too. The output of 'stty' showed a console speed of just 9600 in tmux, while setting it to 115200 to match the speed of the UART did little to help. This meant having artifacts appear when clearing the screen, while scrolling was also not very smooth at times. I don't know if it was vim or the console itself, but these issues would persist no matter what I tried.

I was failrly disappointed and put NetBSD on the Pi 4 since it was the only thing I could think of. While this worked for a bit, I still couldn't get past the issues with Void Linux going missing. I need my files! Then I remembered OpenBSD, the one system I thought was unfriendly because I really didn't give it a chance. I was desparate and sick of all the nonsense going on in Linux land, so I bought a Thinkpad T490 and decided to experiment with OpenBSD again. Unlike my previous adventures, this time I would actually try to learn the system instead of rushing in with expectations and failing with disappointment. No more shall I blame failure on the tools when my own bias was the cause.

Installation on the Raspberry Pi 4 Model B

I was happy to learn that OpenBSD supports arm64, so while I waited for the new laptop to arrive, I thought I'd test it on the Pi 4. First off, installation was kind of unusual. The instructions were to load the 'miniroot74.img' file onto the SD card, then put the 'install74.img' file onto a flash drive. With both devices plugged in, the system is booted. I've never "installed" an OS on a Pi quite like this before...

Thankfully the serial console was set up by default, so no configuration was needed there. Installation was simple enough by selecting the base and other packages from the flash drive using the default parameters for disk, partition and directory locations. It is worth noting that installation goes by quite quickly, even on the Pi. Unfortunately networking was notworking during this stage. The bse0 ethernet interface was failing DHCP autoconfiguration, while the bwfm0 wifi interface failed to load the required firmware. These issues persisted even after installation, much to my frustration. Searching the web turned up an article with a similar issue, and a link to firmware drivers for network devices. All I had to do was download the right firmware and install from a flash drive. Simple!

Networking, Post-Install

Once installed, I downloaded the file 'bwfm-firmware-20200316.1.3p3.tgz' from http://firmware.openbsd.org/firmware/7.4/ and formatted the flash drive under Void Linux. First I ran 'cfdisk' to delete all existing partitions and make just one with type 'w95 FAT32', writing the changes to disk. Then I ran 'mkfs.vfat /dev/sda1' to format the partition before mounting it and storing the firmware file.

On OpenBSD, I ran 'systcl hw.disknames' to find out which device was the flash drive (sd1 in this case), then as root I ran 'disklabel sd1' to find out which partition to use (partition i). I then ran 'mount /dev/sd1i /mnt' and moved to that directory before running 'pkg_add -i <firmware_file>'. At last, I created /etc/hostname.bwfm0 with these contents;

join <ssid> wpakey <passwd>

inet autoconf

Once that was done, I rebooted the system to make sure everything was set up. Sure enough, running 'ifconfig' shows that I now have an IP address on bwfm0! All of this took maybe 30 minutes in total, where most of that time was spent reading the OpenBSD FAQ and search results.

Time and Date

During installation, the timezone was set to 'America/New_York'. While ntpd was in fact running on startup, the date was a month behind and the time was around half an hour ahead. Running the following command as root and rebooting was able to fix it;

'ln -fs /usr/share/zoneinfo/EST5EDT /etc/localtime'

Later I would learn that a reboot was probably unnecessary, as I could have done 'rcctl restart ntpd' instead. FreeBSD had issues with nptd on the Pi; it wouldn't start at all, even if manually invoked on the command line.

Exploration

I was pleased to find that tmux is already installed by default, but it still displays some artifacts when clearing the screen just like on NetBSD/FreeBSD, though 'stty' shows a console speed of 115200 with or without tmux running. The default value of TERM was 'vt220', which was left alone since installation recommended this if using 'xterm'. Since the modified Geoff Graham terminal has full xterm support, it was thought to be just fine. So far it seems to be working alright, but 'stty rows 30' is still required after startup to get 30 rows in tmux by default. Scroll speed and keyboard repeat rates are good right out of the box, unlike previous experiments on the T430.

The official documentation for OpenBSD is the man pages, but the FAQ is also of great help when starting out. It's true what they say; OpenBSD really does have excellent man pages, and within the hour I'd make more progress than all previous experiments, though I'm certain that previous experience on NetBSD played a part since by now I've learned a number of command differences between Linux and BSD. Like NetBSD there is a post-install email with some useful tips such as reading the 'afterboot' manpage. There is even a 'help' command for users who are new to unix or BSD in general. In spite of all this, I've somehow managed to believe OpenBSD was user-unfriendly in the past. I could not have been more wrong...

Software

The default C compiler is OpenBSD clang version 13.0.0, while gcc was NOT installed (thankfully).

Installing w3m was strangely slow but working just fine, no SSL errors or UTF-8 quirks. I was greatly relieved and proceeded to install vim without X11 support, since all of the Xorg-related packages had been left out during installation. This too was rather slow, but it starts up quickly on the Pi 4, unlike vim-tiny on NetBSD running on the Pi Zero W. Maybe the uSD card is faster?

Much to my surprise, running 'pkg_add go' would install go-1.21.1 without any problems finding the specific package. This was nice for both having a newer version of Go and not having to search a long list of package names. Of course installing it was quite slow due to the sheer size, but this wasn't an issue. Lua 5.3.6 was installed right after this and was almost instantaneous. Since only one version of Go was available, there was no need to use a version number in the command. However, Lua requires calling 'lua53' since there are multiple versions available. The tcc compiler was installed without issues as well, whereas on NetBSD it had to be built from source (using gcc...) I was able to build amfora in just a few minutes, though it took a while to download the many dependencies.

After running this system for a few days and getting to know it a little more, it seemed time to experiment with installing on the Udoo Bolt. Again...

Installation on the Udoo Bolt v8

Prior experiments before version 7 would install just fine but fail to boot, hanging when trying to run the multiprocessor kernel. Imagine my surprise when it booted successfully this time! Ethernet was working out of the box and wifi firmware was downloaded post-install, plus some other firmware. Sadly this meant obliterating the primary copy of all my files on the NVMe drive, but there were backups available in case this failed.

The previous Void installation was still on the eMMC drive which didn't show up during installation, so there was still something to fall back on. The console was sluggish with low keyboard repeat rates, but it used a sensible resolution on the 8" 1024x768 display connected via HDMI. The output was 85x32, a strange value but it works. The downside is that it's a little hard to read at times, so I try not to look at it much.

Eventually I got the Bolt configured with an external SSD hosting OpenBSD, while the NVMe drive would be the backup, but trying to mount the filesystem from the Pi using SSHFS revealed a problem; the Bolt was not responding to SSH or ping. Again... The only way to make it work is to generate external network traffic from the Bolt, like running 'pkg_info -Q [some random package]. Only then will it become visible again. I'm starting to think it's the modem, though I couldn't find any relevent settings to fix this. As long as there is traffic between the Bolt and another machine on the network, all is well. If there's no traffic for several minutes, it disappears. Testing another router is not an option at this time, so I'm stuck with this one annoying quirk that probably isn't even something I can ever fix.

Installation on the Thinkpad T490

When the new laptop arrived, I briefly tried FreeBSD 13.2 since I'd previously had good experiences with it on the T430. I didn't think the experiment would last long, and I was right. The backlight was not supported at all, while the wifi firmware was also missing for some reason. It was deleted in less than an hour.

The next step was to install OpenBSD with all of the file sets, including X. Using xenodm to start X was set to 'yes' during installation. This works well, showing the boot sequence in a console before a graphical login screen appears. The default window manager is fvwm while the default terminal is xterm. Wifi and other firmware was installed automatically, so I was able to get wireless networking up and running quickly. Even better, the backlight is supported right out of the box! Even suspend works when closing the lid.

Strangely the ALT key doesn't seem to work properly in tmux, which is a major pain in the ass as it's the same story on the Bolt, though it works when using SSH from the Pi. It would soon be found that this is not a universal issue, but is specific to either xterm or fvwm. I hate xterm anyway, and I don't care for fvwm all that much.

Initial Impressions

After two weeks, I've come to appreciate the minimalism and simplicity that it offers. It really is a nice system once you get to know it. Coming from Linux, it was a very rough start during the early experiments, but reading the FAQ and the excellent man pages will go a long way. Prior use of other BSD systems will also help since there are significant differences that Linux users might struggle with at first.

This entire experience has been a major shift in ways I never expected, but in a good way that has led to far less stress and more productive use of the computer. For the first time in a long time, I feel right at home. Linux is mostly in the past for me now, but I cannot say that I've moved on completely. There are still some things to figure out regarding Blender and some other graphical tools. But that's a project for another time.

Home

Core Dump Index