Difference between revisions of "FreeBSD on X1 Carbon (Gen 6)"

From Run Your Own
Jump to: navigation, search
(Middle click button)
(Middle click button)
Line 68: Line 68:
  portmaster -dB x11/libinput x11-drivers/xf86-input-libinput
  portmaster -dB x11/libinput x11-drivers/xf86-input-libinput
* Add to <code>/etc/sysctl.conf</code>
* Add to <code>/etc/sysctl.conf</code>
# Mouse support (needed for trackpad since xorg 1.20.7
* Add to <code>/boot/loader.conf</code>
* Add to <code>/etc/rc.conf</code>
# Mouse support (needed for trackpad since xorg 1.20.7
=== GPU ===
=== GPU ===

Revision as of 21:55, 8 March 2020

Base Installation

  • grab ISO
  • encryption info goes here

Tracking FreeBSD-STABLE 12

/etc/src/conf - source build options

WITHOUT_ASSERT_DEBUG=true # compile without the assert(3) checks.
WITHOUT_AUDIT=true # Set to not build audit support into system programs.
WITHOUT_BSNMP=true # Set to not build or install bsnmpd(1)
WITHOUT_CALENDAR=true # Set to not build calendar(1)
WITHOUT_TESTS=true # Set to not build nor install the FreeBSD Test Suite
#WITHOUT_KERBEROS=true # some pkgs do not like to have it without
WITH_SVN=true # Set to install svnlite(1) as svn(1).

/etc/make.conf - system build information

CPUTYPE?=skylake           # no kabylake yet?

FreeBSD source and installation

rm -rf /usr/src/*
svnlite checkout https://svn0.eu.FreeBSD.org/base/stable/12 /usr/src

Hardware Specific config

BIOS Updates

  • Get latest BIOS update from Lenovo as bootable CD ISO file.
  • Convert the ISO to something that you can boot from USB
sudo portmaster -i sysutils/geteltorito
geteltorito -o usb-bios-update.img n23ur13w.is
  • Write the image to your USB device
sudo dd if=usb-bios-update.img of=/dev/daX bs=10M
  • plug USB in X1, (re)boot
  • Press enter, then F12 to choose temporary startup device
  • Choose your USB device (USB HDD)
  • Follow instructions from BIOS update utility

Microcode Updates

  • Information about current microcode version can be accessed this way (needs to install a small tool first)
sudo portmaster -iB sysutils/x86info
sudo kldload cpuctl.ko
sudo x86info -a | grep Microcode      # To note current Microcode version
  • Latest microcode can be fetched by installing the following port:
sudo portmaster -iB sysutils/devcpu-data
  • Edit /boot/loader.conf to add:
# Microcode update
  • Reboot and check if Microcode version has changed :)


  • in /etc/rc.conf
# Wireless
ifconfig_wlan0="WPA DHCP country NL"

Middle click button

With the update of x11-servers/xorg-server to 1.20.7, xorg-server has switched from using the devd backend to the udev backend for device configuration on FreeBSD 12 and 13. If you do not do anything, the trackpad that used to work out of the box, will... not work anymore. If you want a working mouse with middle-click, do this:

  • Make sure these ports are installed
portmaster -dB x11/libinput x11-drivers/xf86-input-libinput
  • Add to /etc/sysctl.conf
# Mouse support (needed for trackpad since xorg 1.20.7
  • Add to /etc/rc.conf
# Mouse support (needed for trackpad since xorg 1.20.7


DRM Next Kernel Module

  • Install the port
portmaster -i graphics/drm-next-kmod
  • in /etc/rc.conf
# drm-next-kmod port
  • add your main user to video group
pw usermod ${USERNAME} -G video
  • reboot
shutdown -r now


  • /etc/X11/xorg.conf
Section "Device"
  Identifier  "Intel Graphics"
  Driver      "intel"
  Option      "TearFree" "true"

Note: These days all the useful options are enabled by default so no need to add too many extra parameters.

Audio over HDMI

Seems to be currently broken with drmnext. Need to be investigated further.


To make the headphone plug work, add the following in /boot/device.hints (and reboot):

# Enable headphones
hint.hdaa.0.nid33.config="as=1 seq=15"


Note: this does not quite work as expected due to a small conflict between cuse.ko and cuse4bsd.ko, the former need to be unloaded first, need to investigate...

  • Install the cuse4bsd kernel module and webcamd
portmaster -iB multimedia/cuse4bsd-kmod multimedia/webcamd multimedia/pwcview
  • Load the cuse4bsd kernel module at boot time, edit /boot/loader.conf:
# Character device driver for webcams
  • Start webcamd daemon at boot time, edit /etc/rc.conf:
# Webcam daemon
  • Test webcam with:
pwcview -s uxga -f 30

Thinkpad drivers

Used for LCD control, suspend, etc...

  • in /boot/loader.conf
# Thinkpad stuff


  • You need at least BIOS 1.30 (see BIOS section to know how to update BIOS)
  • In BIOS change sleep state mode to Linux
  • when you want to suspend to RAM:
sudo zzz

Note: I see the disk not super happy when resuming, with system hanging for a couple secs and lots of:

nvme0: aborting outstanding i/o
nvme0: WRITE sqid:7 cid:67 nsid:1 lba:9792488 len:64
nvme0: ABORTED - BY REQUEST (00/07) sqid:7 cid:67 cdw0:0

Not sure if this should be a concern... There is an issue open about that https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=230722

Another Note: See optional config bits below for sleeping when closing lid.


  • xorg.conf
# All non-default X11 font directories must specified manually because
# the X server does not search directories recursively...
# Also, check /var/log/Xorg.0.log for missing fonts.dir files
# Most likely some directories will miss theirs, in which case you need
# to cd there and run mkfontdir...
Section "Files"
  FontPath "/usr/local/share/fonts/Caladea/"
  FontPath "/usr/local/share/fonts/Carlito/"
  FontPath "/usr/local/share/fonts/GentiumBasic/"
  FontPath "/usr/local/share/fonts/Liberation/"
  FontPath "/usr/local/share/fonts/LinLibertineG/"
  FontPath "/usr/local/share/fonts/TerminusTTF/"
  FontPath "/usr/local/share/fonts/TTF/"
  FontPath "/usr/local/share/fonts/Type1/"
  FontPath "/usr/local/share/fonts/cyrillic/"
  FontPath "/usr/local/share/fonts/dejavu/"
  FontPath "/usr/local/share/fonts/encodings/"
  FontPath "/usr/local/share/fonts/terminus-font/"
  FontPath "/usr/local/share/fonts/twemoji-color-font-ttf/"
  FontPath "/usr/local/share/fonts/util/"
  • Don't want some options, /etc/make.conf
OPTIONS_SET+=SNDIO      # BSD specific sound system
OPTIONS_UNSET+=DOCS     # I only install specific ones
OPTIONS_UNSET+=IPV6     # IPV6 free laptop already saved the day twice
  • Keyboard rate
xset rate r rate 250 34
kbdcontrol -r fast
  • in /etc/sysctl.conf

# Suspend to RAM when closing lid (for laptop with a working S3)
  • If you don't like the touchpad and only use the emblematic Thinkpad pointing stick, you can disable the touchpad entirely in the BIOS (hurray!)
  • in ~/.login.conf
  • in /etc/rc.conf
dbus_enable="YES"       # Enable DBUS
dumpdev="NO"            # Disable crash dumps