pages/blog/openbsd-hp-envy.md (view raw)
1---
2template:
3url: openbsd-hp-envy
4title: OpenBSD on the HP Envy 13
5subtitle: I put a blowfish in my laptop this week
6date: 2020-04-17
7---
8
9My existing KISS install broke because I thought it would be a great
10idea to have [apk-tools](https://github.com/alpinelinux/apk-tools)
11alongside the `kiss` package manager. It's safe to say, that did not end
12well---especially when I installed, and then removed a package. With
13a semi-broken install that I didn't feel like fixing, I figured I'd give
14OpenBSD a try. And I did.
15
16## installation and setup
17
18Ran into some trouble booting off the USB initially, turned out to be
19a faulty stick. Those things aren't built to last, sadly. Flashed a new
20stick, booted up. Setup was pleasant, very straightforward. Didn't
21really have to intervene much.
22
23After booting in, I was greeted with a very archaic looking FVWM
24desktop. It's not the prettiest thing, and especially annoying to work
25with when you don't have your mouse setup, i.e. no tap-to-click.
26
27I needed wireless, and my laptop doesn't have an Ethernet port. USB
28tethering just works, but the connection kept dying. I'm not sure why.
29Instead, I downloaded the [iwm(4)](http://man.openbsd.org/iwm.4)
30firmware from [here](http://firmware.openbsd.org/firmware/6.6/), loaded
31it up on a USB stick and copied it over to `/etc/firmware`. After that,
32it was as simple as running
33[fw_update(1)](http://man.openbsd.org/fw_update.1)
34and the firmware is auto-detected and loaded. In fact, if you have working
35Internet, `fw_update` will download the required firmware for you, too.
36
37Configuring wireless is painless and I'm so glad to see that there's no
38`wpa_supplicant` horror to deal with. It's as simple as:
39
40```
41$ doas ifconfig iwm0 nwid YOUR_SSID wpakey YOUR_PSK
42```
43
44Also see [hostname.if(5)](http://man.openbsd.org/hostname.if.5) to make
45this persist. After that, it's only a matter of specifying your desired
46SSID, and `ifconfig` will automatically auth and procure an IP lease.
47
48```
49$ doas ifconfig iwm0 nwid YOUR_SSID
50```
51
52By now I was really starting to get exasperated by FVWM, and decided to
53switch to something nicer. I tried building 2bwm (my previous WM), but
54that failed. I didn't bother trying to figure this out, so I figured I'd
55give [cwm(1)](http://man.openbsd.org/cwm.1) a shot. Afterall, people
56sing high praises of it.
57
58And boy, is it good. The config is a breeze, and actually pretty
59powerful. [Here's mine](https://github.com/icyphox/dotfiles/blob/master/home/.cwmrc).
60cwm also has a built-in launcher, so dmenu isn't necessary anymore.
61Refer to [cwmrc(5)](https://man.openbsd.org/cwmrc.5) for all the config
62options.
63
64Touchpad was pretty simple to setup too---OpenBSD has
65[wsconsctl(8)](http://man.openbsd.org/wsconsctl.8), which lets you set
66your tap-to-click, mouse acceleration etc. However, more advanced
67configuration can be achieved by getting Xorg to use the Synaptics
68driver. Just add a `70-synaptics.conf` to `/etc/X11/xorg.conf.d` (make
69the dir if it doesn't exist), containing:
70
71```conf
72Section "InputClass"
73 Identifier "touchpad catchall"
74 Driver "synaptics"
75 MatchIsTouchpad "on"
76 Option "TapButton1" "1"
77 Option "TapButton2" "3"
78 Option "TapButton3" "2"
79 Option "VertEdgeScroll" "on"
80 Option "VertTwoFingerScroll" "on"
81 Option "HorizEdgeScroll" "on"
82 Option "HorizTwoFingerScroll" "on"
83 Option "VertScrollDelta" "111"
84 Option "HorizScrollDelta" "111"
85EndSection
86```
87
88There are a lot more options that can be configured, see
89[synaptics(4)](http://man.openbsd.org/synaptics.4).
90
91Suspend and hibernate just work, thanks to
92[apm(8)](http://man.openbsd.org/apm.8). Suspend on lid-close just needs
93one `sysctl` tweak:
94
95```
96$ sysctl machdep.lidaction=1
97```
98
99I believe it's set to 1 by default on some installs, but I'm not sure.
100
101## impressions
102
103I already really like the philosophy of OpenBSD---security and
104simplicity, while not losing out on sanity. The default install is
105plentiful, and has just about everything you'd need to get going.
106I especially enjoy how everything just works! I was pleasantly surprised
107to see my brightness and volume keys work without any configuration!
108It's clear that the devs
109actually dogfood OpenBSD, unlike uh, *cough* Free- *cough*. Gosh I hope
110it's not _the_ flu. :^)
111
112Oh and did you notice all the manpage links I've littered throughout
113this post? They have manpages for _everything_; it's ridiculous. And
114they're very thorough. Arch Wiki is good, but it's incorrect at times,
115or simply outdated. OpenBSD's manpages, although catering only to
116OpenBSD have never failed me.
117
118Performance and battery life are fine. Battery is in fact, identical, if
119not better than on Linux. OpenBSD disables HyperThreading/SMT for
120security reasons, but you can manually enable it if you wish to do so:
121
122```
123$ sysctl hw.smt=1
124```
125
126Package management is probably the only place where OpenBSD falls short.
127[pkg_add(1)](http://man.openbsd.org/pkg_add.1) isn't particularly fast,
128considering it's written in Perl. The ports selection is fine, I have
129yet to find something that I need not on there. I also wish they
130debloated packages; maybe I've just been spoilt by KISS. I now have
131D-Bus on my system thanks to Firefox. :(
132
133I appreciate the fact that they don't have a political document---a Code
134of Conduct. CoCs are awful, and have only proven to be harmful for
135projects; part of the reason why I'm sick of Linux and its community.
136Oh wait, OpenBSD does have one: https://www.openbsd.org/mail.html
137;)
138
139I'll be exploring [vmd(8)](http://man.openbsd.org/vmd.8) to see if I can
140get a Linux environment going. Perhaps that'll be my next post, but when
141have I ever delivered?
142
143I'll close this post off with my new rice, and a sick ASCII art I made.
144
145```
146 \.-----./
147 / ^ ^ ^ \
148 (o)(o) ^ ^ |_/|
149 {} ^ ^ > ^| \|
150 \^ ^ ^ ^/
151 /-----\
152 ~icy
153```
154
155![openbsd rice](https://x.icyphox.sh/zDYdj.png)