stuff/os/FreeBSD/FreeBSD_on_Clevo_Laptop.md
Moni Ghaoui 47aa1a3484 FC
2025-04-14 19:51:40 +02:00

4.7 KiB

Setup

Install my favorite packages

pkg install bash sudo tmux htop neovim git bastille

Add "wheel" to the suoers file:

visudo

Change shell

chsh -s /usr/local/bin/bash

Do a system update:

freebsd-update fetch install

Wifi

Find out what network cards we have:

pciconf -lv | grep -A1 -B3 network

On my Clevo laptop it looks like this:

re0@pci0:2:0:0: class=0x020000 rev=0x15 hdr=0x00 vendor=0x10ec device=0x8168 subvendor=0x1558 subdevice=0xa600
    vendor     = 'Realtek Semiconductor Co., Ltd.'
    device     = 'RTL8111/8168/8211/8411 PCI Express Gigabit Ethernet Controller'
    class      = network
    subclass   = ethernet
iwlwifi0@pci0:3:0:0:    class=0x028000 rev=0x1a hdr=0x00 vendor=0x8086 device=0x2723 subvendor=0x8086 subdevice=0x0084
    vendor     = 'Intel Corporation'
    device     = 'Wi-Fi 6 AX200'
    class      = network
nvme0@pci0:4:0:0:       class=0x010802 rev=0x00 hdr=0x00 vendor=0x144d device=0xa809 subvendor=0x144d subdevice=0xa801

So we have an Intel Wifi.

We're going to configure the wireless card iwlwifi0 to the interface wlan0:

ifconfig wlan0 create wlandev iwlwifi0

To make the change persist across reboots:

sysrc wlans_iwlwifi0="wlan0"

We need to set the regulatory domain:

ifconfig wlan0 regdomain ETSI country NL

To scan the networks. I had to run the command twice to see the list:

ifconfig wlan0 up list scan

I see my networks:

SSID/MESH ID                      BSSID              CHAN RATE    S:N     INT CAPS
TMNL-3EF981_24G                   d8:0d:17:b9:b2:f0   11   54M  -37:-96   100 EPS  HTCAP WME ATH RSN WPS
TMNL-3EF981                       98:0d:67:3e:f9:81   11   54M  -72:-96   100 EP   APCHANREP RSN WPS BSSLOAD HTCAP VHTCAP VHTOPMODE WME
TMNL-3EF981_5G                    d8:0d:17:b9:b2:f1   64   54M  -42:-96   100 EP   HTCAP VHTCAP VHTOPMODE VHTPWRENV WME ATH RSN WPS

I want to connect to TMNL-3EF981_5G. We need to edit the /etc/wpa_supplicant.conf file:

nvim /etc/wpa_supplicant.conf

The contents. The password need to be set in psk.

country=NL
network={
        ssid="TMNL-3EF981_5G"
        psk="3J6YJHNRG8W7KMMF"
        priority=5
}

To set it to use DHCP:

sysrc ifconfig_wlan0="WPA SYNCDHCP"

For some reason, we need to add the country code in the rc.conf:

sysrc create_args_wlan0="country NL"

Now bring it up!

service netif restart

Restart the laptop to see if it persists.

For some reason, it won't work (no suprise, wifi is awful in FreeBSD).

This worked for me after boot

ifconfig wlan0 down
ifconfig wlan0 ssid "TMNL-3EF981_5G"
ifconfig wlan0 regdomain etsi2 country NL
service netif restart

X11

https://docs.freebsd.org/en/books/handbook/x11/

Don't forget to start tmux:

tmux

Add moni to the video group:

pw groupmod video -m moni

And then install, but don't forget to read the messages when the install is complete! Scroll up with tmux

pkg install xorg

This will improve mnuse and touchscreen support:

sysctl kern.evdev.rcpt_mask=6

And add this to /etc/sysctl.conf to persist it:

kern.evdev.rcpt_mask=6

Amd

pkg install drm-kmod
sysrc kld_list+=amdgpu

Kde

pkg install kde5
sysrc dbus_enable="YES"
sysctl net.local.stream.recvspace=65536
sysctl net.local.stream.sendspace=65536
pkg install sddm
sysrc sddm_enable="YES"

Fonts

pkg install urwfonts

But you're not done yet, you need to add a conf file:

nvim /usr/local/etc/X11/xorg.conf.d/90-fonts.conf

With the following:

Section "Files"
  FontPath "/usr/local/share/fonts/urwfonts/"
EndSection

CPU

Too see your CPU 0

sysctl dev.cpu.0

If you don't see a temperature:

kldload amdtemp

Add it to startup:

sysrc kld_list+=amdtemp

Linux compatibility

sysrc linux_enable="YES"
service linux start

Final configs

My /etc/rc.conf

hostname="moni-freebsd"
ifconfig_re0="DHCP"
sshd_enable="YES"
moused_enable="YES"
# Set dumpdev to "AUTO" to enable crash dumps, "NO" to disable
dumpdev="AUTO"
kld_list="amdgpu amdtemp"
dbus_enable="YES"
sddm_enable="YES"
linux_enable="YES"
create_args_wlan0="country NL"
wlans_iwlwifi0="wlan0"
ifconfig_wlan0="WPA SYNCDHCP"

My /etc/sysctl.conf:

#
#  This file is read when going to multi-user and its contents piped thru
#  ``sysctl'' to adjust kernel values.  ``man 5 sysctl.conf'' for details.
#

# Uncomment this to prevent users from seeing information about processes that
# are being run under another UID.
#security.bsd.see_other_uids=0

kern.evdev.rcpt_mask=6