
Finally! Took me just over three years to save up for a old Thinkpad X270 (~£85). It seems to be in excellent condition and interestingly, despite being a bit more chunky than my work’s Macbook Pro M1 14”, it feels a lot lighter. And arguably has a better keyboard. Also, it might be a seven year old machine, but for a progression in NetBSD hardware for me that has gone from Pentium III, to Pentium D this thing feels like the future!
My plan was that I’d get a X270 or T470 (but not anything newer) as that way I could put the SSD I’d pulled from my old Optiplex into it and immediately have a working NetBSD machine that I could then upgrade. But after three years that SSD was unlikely to work and things had moved on a fair bit. So I opted for a fresh NetBSD 10.1 install (after a final boot into the Windows OS it came with to update the BIOS). I mostly followed this approach (encrypted swap comes free with NetBSD 10), but with these changes (these notes are more for me than anything):
gpt add -l efi -t efi -s 128m ld0
gpt add -l netbsd -t ffs -s 20g ld0
gpt add -l swap -t swap -s 8g ld0
gpt add -l netcgd -t cgd ld0
On my NetBSD server I have 5Gi /root
and 10Gi /usr
. Here I want /usr
unencrypted (because I just do), so I’ve opted for 20Gi so I have a bit of breathing room. For cgd I have:
/dev/cgd0b /tmp mfs rw,-s=132m 0 0
/dev/cgd0e /var ffs rw 1 2
/dev/cgd0f /home ffs rw 1 2
(I set a
to unused).
I have 2Gi for /tmp
and 10Gi for /var
. I kind of wish I’d done a bigger /tmp
directory as I’ve already maxed it out with some cargo
builds (but hopefully only because it didn’t clean up some previous attempts); Have to be honest that I don’t fully understand the /tmp
changes with NetBSD 10. I seem to have both a /tmp
and a /var/shm
tmpfs - I don’t know if that’s intentional or I’ve just done something wrong. Maybe some day I could change this, but probably not any time soon.
I used to use dwm and st, but since I was setting up from scratch I decided to give leftwm a whirl to go with alacritty which I’ve been using on macOS for the past few years. I do like that dwm is “self-contained”, whereas with leftm you have to worry about status bars, etc. I’ve opted for lemonbar after making a small sed
change (sed -rg '/^\s*$/d'
) in the script for NetBSD. I’m showing battery usage based on this approach (I have two batteries though!) and built this little status script:
#!/bin/sh
# file:~/bin/leftwmstatus
while true; do
load=$(cat /proc/loadavg | awk '{print $1, $2, $3}')
mem=$(cat /proc/meminfo | awk 'FNR==5{printf ("%.1f/", $2/1024/1024)};FNR==10{printf ("%.1f GB", $2/1024/1024)}')
swap=$(grep SwapFree /proc/meminfo | awk '{print "scale=1;"$2"/1024"}' | bc)
cal=$(date +"%a %b %d %Y %H:%M")
batt1=$(envstat -s acpibat0:charge | grep charge | sed 's/.*(\(.*\)%)/\1/')
batt2=$(envstat -s acpibat1:charge | grep charge | sed 's/.*(\(.*\)%)/\1/')
charge=$(if envstat | grep -Eq 'connected.*TRUE'; then echo ^; fi)
printf "S$batt1%%+$batt2%% $charge | $load | $mem | $cal\n"
sleep 2
done
A few random “issues” I’ve had:
- Needing to set
XDG_RUNTIME_DIR
for leftwm - I’ve not been able to enable XDM yet because I hit keyboard input conflict issues.
- An occasional
fsck
issue on boot I have no clue about because it’s moaning aboutfsck_home
being missing (which doesn’t seem to be a thing). - I had TLS/SSL errors doing the initial install with
pkg_add
. I can’t actually remember how I resolved this. I think I first of all had to setpkg_path
to use http to get the Mozilla root certs and then I could switch it to https. - Suspend doesn’t work. At home this isn’t a huge problem as I just leave it turned on.
- I have somewhat got the
/etc/powerd/scripts/acadapter
script working to lower the frequency when on battery (sometimes it doesn’t trigger, I don’t know why; Not a massive deal).
At the time I set this up the Pkgsrc version of Helix was set as broken, but building it outside of Pkgsrc was easy; I am going to see if I can get Pkgsrc Helix updated now I actually have NetBSD hardware to do that on.
I’ve got it setup enough that I can use it, but still need to tweak a few things:
- Finding a good way to type £ (it’s an American keyboard).
- Disabling taps on the track pad because I keep clicking accidentally.
I’m very happy to have NetBSD hardware again!