Try to learn something about everything, and everything about somethingThomas Huxley “Darwin's bulldog” (1824-1895)

Computers

Laptop FreeBSD

I moved my Dell laptop from Devuan Linux to FreeBSD and here are some things I needed to do and some things I did for convenience….

Graphics

I found the basic install of the recommended drm-kmod package and i915kms driver wouldn't work - it crashed/hung during boot.

Removing this package and using the SCFB video driver worked, but didn't give (for example) DPMS control of the LCD screen.

I used SCFB temporarily be adding an xorg conf file 20-vesa.conf to /usr/local/etc/X11/xorg.conf.d/

Section "Device"
        Identifier "Card0"
        Driver "scfb"
EndSection

This was a reasonable workaround, but I found the solution to using correct Intel i915kms driver here : https://blog.hofstede.it/freebsd-150-on-the-thinkpad-t480-efficient-stable-and-8-hours-on-battery/

This is what worked:

Installed new packages

drm-latest-kmod

gpu-firmware-intel-kmod-kabylake

added to /etc/rc.conf

kld_list="i915kms"

added to /boot/loader.conf

# Graphics and power tuning
i915kms_load="YES"
drm.i915.enable_rc6=7
drm.i915.enable_fbc=1
drm.i915.lvds_downclock=1
drm.i915.enable_psr=1
compat.linuxkpi.i915_disable_power_well="0"

i915kms now loads and I have access to DPMS for turning off the LCD screen.

LCD Panel on/off

I made a few small shell scripts to assist in controlling the battery consumption by being able to alter LCD brightness, and turn the LCD off via DPMS and makde i3 shorcuts to them.

(later I made the same key actions for DWM when I moved back to using DWM)

now I can “$mod+Shift+o” to reduce brightness and “$mod+Shift+p” to increase it, and “$mod+Shift+i” to turn the LCD screen off completely.

I also added a devd rule to turn the LCD screen off when the lid is closed - this confused me initially, as it worked when testing it by adding the rule, restarting devd and testing, from within an X-Session…. but didn't work when devd was started during bootup…

This was due to the lack of DISPLAY if the script was triggered from “outside” the X session. Changing the script to set the DISPLAY variable was the solution.

/etc/devd/rules.d/lid.conf

notify 20 {
match "system" "ACPI";
match "subsystem" "Lid";
match "notify" "0x01";
action "/home/g4slv/bin/on";
};
notify 20 {
match "system" "ACPI";
match "subsystem" "Lid";
match "notify" "0x00";
action "/home/g4slv/bin/off";
};

The lid actions call one of these →

~/bin/on

#!/usr/local/bin/bash
 
su g4slv -c 'setenv DISPLAY :0.0 && /usr/local/bin/xset dpms force on'

~/bin/off

#!/usr/local/bin/bash
 
su g4slv -c 'setenv DISPLAY :0.0 && /usr/local/bin/xset dpms force off'

Other tweaks

Small scripts to automate swithing between Wifi and Ethernet

net_wlan.sh

#!/bin/sh
 
doas service netif stop em0 
doas service netif start wlan0
doas service dhclient restart wlan0

net_eth.sh

#!/bin/sh
 
doas service netif stop wlan0 
doas service netif start em0
doas service dhclient restart em0

Other Config Files

/etc/rc.conf

hostname="proton"
keymap="uk.kbd"
wlans_iwm0="wlan0"
ifconfig_wlan0="WPA  DHCP"
ip6addrctl_enable="NO"
ipv6_activate_all_interfaces="NO"
ifconfig_wlan0_ipv6="inet6 ifdisabled"
ifconfig_em0_ipv6="inet6 ifdisabled"
ifconfig_lo0_ipv6="inet6 ifdisabled"
create_args_wlan0="country GB regdomain NONE"
sshd_enable="YES"
sshd_flags="-4"

ntpd_enable="YES"
ntpd_sync_on_start="YES"
ntpd_flags="-4"

ftpd_enable="YES"
ftpd_flags="-4"


moused_nondefault_enable="NO"
# Set dumpdev to "AUTO" to enable crash dumps, "NO" to disable
dumpdev="AUTO"
zfs_enable="YES"
cupsd_enable="YES"
devfs_system_ruleset="system"
dbus_enable="YES"


avahi_daemon_enable="YES"

avahi_dnsconfd_enable="YES"
inetd_enable="YES"
rwhod_enable="YES"

kld_list="i915kms"

powerd_enable="YES"
powerd_flags="-a adaptive -b minimum "
update_motd="NO"
dynamic_motd="YES"
ifconfig_em0="DHCP"
autofs_enable="YES"

/boot/loader.conf

kern.geom.label.disk_ident.enable="0"
kern.geom.label.gptid.enable="0"
zfs_load="YES"
i915kms_load="YES"
drm.i915.enable_rc6="7"
drm.i915.semaphores="1"
drm.i915.enable_fbc="1"
drm.i915.lvds_downclock=1
drm.i915.enable_psr=1
compat.linuxkpi.i915_disable_power_well="0"
fuse_load="YES"
iwm8265fw_load="YES"

~/.xinitrc

xrdb -load ~/.Xdefaults
setxkbmap -layout gb
xset s noblank
xset s noexpose
xset dpms 600 660 670
backlight 40
 
eval $(gnome-keyring-daemon --start)
export SSH_AUTH_LOCK
 
feh --bg-center -B "#005577"  ~/freebsd.svg
 
pulseaudio &
 
dwmblocks &
 
pasystray &
 
nextcloud & 
 
exec dbus-launch --exit-with-x11 dwm

pkg prime-list

Here's the list of intentionally installed packages currently

FreeBSD-kernel-generic
FreeBSD-kernel-generic-dbg
FreeBSD-set-base
FreeBSD-set-lib32
FreeBSD-set-minimal
alpine
ansilove
automount
avahi
bash
bombadillo
claws-mail
claws-mail-bogofilter
claws-mail-dillo
claws-mail-pdf_viewer
detox
dmidecode
doas
drm-latest-kmod
dunst
dynamic_motd
evince
feh
ffmpegthumbnailer
figlet
firefox-esr
fldigi
foomatic-db-hpijs
freebsd-ftpd
freebsd-telnetd
fusefs-jmtpfs
gmake
gnome-keyring
gnucash
gopher
gpu-firmware-intel-kmod-kabylake
gvfs
hplip
i3blocks
imv
iperf
libptytty
libreoffice
librewolf
lynx
mixertui
most
mousepad
mpv
musikcube
nano
neofetch
nextcloudclient
nss_mdns
openshot
pasystray
pavucontrol
pcmanfm
pkg
pkgconf
polo
py311-i3ipc
py311-pip
rename
rsync
sacc
scrot
setsid
shotwell
slock
slrn
thunar
thunar-archive-plugin
tightvnc
tmux
vim
vlc
wireshark
xarchiver
xorg
yt-dlp
zip

Further Information

Page created : 04/06/26 11:04 BST

Page updated : 04/06/26 19:11 BST