Eric Radman : a Journal

OpenRC on FreeBSD

One of the least obvious features FreeBSD is the degree to which it may be customized. In no small part this is due to the number of projets that choose to treat FreeBSD as a first-class citizen. OpenRC works equally well on BSD and Linux.

To get started, follow the instructions for Installing OpenRC on FreeBSD

X11

Enable the DRM graphics and the HID mouse driver

echo 'modules="... hms i915kms"' > /etc/conf.d/modules

Instead of allowing devd(8) to run moused(8) install the Xorg input driver

pkg install -q xorg drm-kmod xf86-input-evdev

Control the backlight using

/usr/bin/backlight incr 10
/usr/bin/backlight decr 10

Or

xrandr --output eDP-1 --brightness 1.0

Wireless

Update firmware

  fwget

Configure connections

cat > /etc/wpa_supplicant.conf <<EOF
ctrl_interface=/var/run/wpa_supplicant
eapol_version=1
ap_scan=1
fast_reauth=1

network={
  ssid="radnet2"
  psk="******"
  priority=10
}
EOF

Enable the wireless module

echo 'modules="... if_iwlwifi"' > /etc/conf.d/modules

Start service

rc-update add wpa_supplicant default
openrc default

Mount Encrypted Volume

To mount an encrypted volume, create /etc/init.d/unlock-home to prompt for a password

#!/sbin/openrc-run
description="Unlock zroot/home"

depend() {
    need localmount
    before login
}

start() {
    zfs load-key -r zroot/home
    zfs mount zroot/home
    eend $?
}

Enable

rc-update add unlock-home default

Networking

To use EUI64 network configuration with dhcpcd

sed -i -E 's/slaac private/#slaac private/g' /usr/local/etc/dhcpcd.conf

Or to disable router solicitations and set a static IP

# /usr/local/etc/dhcpcd.conf
interface vtnet0
noipv6rs
# /etc/conf.d/network
ifconfig_vtnet0="inet6 fd00:52::1d/64"
defaultroute6="fd00:52::4"