Start | Anteckningar | Motorcyklar | Recept | Temperaturer

2023-06-07 Installing OpenBSD 7.2 on an x250 Thinkpad

I run MacOS on my laptop and a virtual Debian Linux in Digital Ocean, but no BSD. So what should I install?

FreeBSD installed flawlessly. No option to install a graphical environment, which felt ...old? I really liked the feel of everything and got quite far configuring/learning before I realized that suspend/resume doesn't work and seems to be a general problem on FreeBSD. That's not good enough for a laptop of today.

I don't remember what prevented me from running NetBSD on it a couple of years ago, but I remember thinking that even though I like its init system best, it's time to let go.

OpenBSD then... I associate obsd with angry mob culture and so much security measures in place you can't even create an etc.tar.gz as root. But at least it can suspend/resume.

Base installation

I wrote the install72.img to a memory stick, booted from it and more or less went with the defaults. The wifi card was detected, but needed a firmware driver so I installed over ethernet. Eu!

The solution to the firmware problem would normally be running # fw_update iwm But it was a Tuesday so I tried and googled for about an hour before giving up. The next day was a Wednesday so the wifi just decided to work.

GUI

Xorg got installed without any extra work and started with FVWM. It even worked with Swedish characters!

Let's install and setup Openbox

First of all, I installed (Vim and) Terminator and configured it to my liking: Change (monospace) font + size, no scrollbar, no blinking cursor, colors etc.

# pkg_add install vim terminator

Pew! Now we can work. First install the packages:

`# pkg_add openbox obconf

Then add example openbox configuration. The Terminator installation already created a ~/.config directory so I just copied it in there

$ cp -rp /usr/local/share/examples/openbox ~/.config/

`# pkg install openbox

Tint2 is a taskbar, obconf is the OpenBox configuration tool and conky is a system monitor for the desktop background.

The package obmenu used for creating/using OpenBox menus was deprecated due to being written in Python 2.7. I have yet to find a replacement.

Next we install Slim, a minimal but sufficient graphical login manager: # pkg install slim

Add Slim to rc.conf, but don't enable it just yet. We need to configure it first. Also enable dbus.

`# sysrc slim_enable="NO"

If you type something wrong here, like missing a quotation mark, you will end up with a troubled system upon next boot. Reboot when done with Openbox. If you end up booting read-only, just remount the root partition with "mount -u -o rw /", edit, save and reboot again.

Create an OpenBox config directory for the user and copy the system configuration there.

`$ mkdir -p ~/.config/openbox $ cp /usr/local/etc/xdg/openbox/* ~/.config/openbox`

Edit the autostart file and add things you'd like to start when logging in to the desktop. I added the following based on my preferences:

`tint2 & xterm -bg black -fg green -fa "Mono" -fs 7 -geometry +20+20 & xterm -bg black -fg green -fa "Mono" -fs 7 -geometry +20+20 & conky & xterm &`

Then you can test the setup by starting X Window System with OpenBox

$ startx

Time to start working on Slim.

# echo sessiondir /usr/local/share/xsessions/ >> /usr/local/etc/slim.conf

Add UTF-8 support to the xsession by editing /usr/local/share/xsessions/openbox.desktop and adding

Encoding=UTF-8

Now try it out by starting DBus (we enabled it above, but did not yet start it) and then Slim

`# service start dbus $ slim`

Unresolved issues

There's an unresolved issue with the screen backlight on this particular laptop model. I guess I can fight harder triggering xrander upon upon resume after sleep, when attaching/removing the power cable, accidentally touching the brightness buttons etc. This is very annoying!