FreeBSDDesktop

FreeBSD 12-CURRENT brings the Year of FreeBSD on the Desktop! Currently with some unofficial modifications and building some stuff from source, but you can get evdev, Wayland, Vulkan, all that stuff, with support for Intel Kaby Lake and AMD Polaris (Radeon RX 4xx/5xx) GPUs (and older).

base/ports

Build kernel with options EVDEV_SUPPORT

Ports: https://github.com/myfreeweb/freebsd-ports-dank — build Xorg with UDEV to autodetect/hotplug evdev devices, Mesa with WAYLAND, Vulkan SDK, etc.

Fresh GPU drivers: doas make -C/usr/ports/graphics/drm-next-kmod install clean (DO NOT go back to CSM boot for Radeons, just disable efifb with hw.syscons.disable=1)

Weston

fork — build instructions in the ports page linked above

Common configuration

sysctl

kern.evdev.rcpt_mask="12" — send evdev events from individual mice/keyboards instead of sysmouse/kbdmux

kern.vt.kbd_reboot="0" — do not reboot on Ctrl-Alt-Del

vfs.usermount="1" — let users mount filesystems

/boot/loader.conf

vfs.zfs.arc_max="2G" — limit ZFS ARC size — generally it yields memory to userspace programs, but doesn't seem to yield to other kernel things (network stack etc.), nice to always have a limit

hw.usb.no_boot_wait="1" — don't waste time on probing USB at early boot time (do not enable when booting from a USB disk, obviously)

Device permissions

doas sysrc devfs_system_ruleset="desktop", edit /etc/devfs.rules:

[desktop=10]
add path 'input/*' mode 0660 group video
add path 'tty*' mode 0660 group video

input and tty can be reuqired to run Wayland compositors as user.

(Of course this is bad security, and e.g. weston fork should work without it)

Device events (devd)

Restart devd to activate new rules!!

USB phone connection (vendor 0x18d1 is Google Nexus/Pixel) for ADB, MTP fusefs-simple-mtpfs:

notify 100 {
        match "system"          "USB";
        match "subsystem"       "DEVICE";
        match "type"            "ATTACH";
        match "vendor"          "0x18d1";
        action  "chgrp wheel /dev/$cdev; chmod g+rw /dev/$cdev";
};

U2F token: /usr/local/etc/devd/u2f.conf.sample was installed by package libu2f-host-1.1.4

Asetek liquid cooler for control scripts (see below):

notify 100 {
        match "system"          "USB";
        match "subsystem"       "DEVICE";
        match "type"            "ATTACH";
        match "vendor"          "0x2433";
        action  "chgrp wheel /dev/$cdev; chmod g+rw /dev/$cdev";
};

Various links, notes etc.

X11 and Wayland configs: here.

All laptops: powerd++ for better CPU power management.

Thinkpad: load acpi_ibm kernel module, DO NOT load acpi_video.

Asetek AIO liquid coolers: leviathan, krakenx etc. (all the Python scripts "for Linux" that use Python USB libraries work on FreeBSD)

AMD Ryzen CPUs: load amdtemp to read temperature (sysctl dev.cpu.0.temperature), BIOS overclocking works fine even though sysctl will show freq 2700 #218262, ignore that

USB keyboard/mouse multimedia keys: #222646

MSI RGB lighting: msi-rgb

Bluetooth audio, fake microphone from audio files, etc.: audio/virtual_oss.

Posted a response on your own website? Send a Webmention:

(Even better - implement automatic Webmention sending on your website. And set up indie-config to make reply/repost/like buttons work.)