1. The base system
After the card is written and the board boots (Raspberry Pi basics; without a network, log in over the serial console), as root:
passwd # root
passwd freebsd
sysrc ntpd_enable=YES ntpd_sync_on_start=YES
service ntpd start
None of the three test boards kept the right time across a power cut; with a clock in the past, make skips rebuilding modules that look newer than their sources.
config.txt
The Raspberry Pi firmware reads config.txt from the FAT partition of the card, mounted at /boot/msdos. Any computer can edit it with the card in a reader, which is the way back when a change stops the boot.
Pi 4 and Zero 2 W, as the FreeBSD 15.1 image writes it (read from the test Zero 2 W):
[all]
arm_64bit=1
dtparam=audio=on,i2c_arm=on,spi=on
dtoverlay=disable-bt
device_tree_address=0x4000
kernel=u-boot.bin
[pi4]
hdmi_safe=1
armstub=armstub8-gic.bin
dtoverlay=disable-btputs the PL011 UART on header pins 8 and 10: that is the serial console. Keep it.dtparam=audio=onis needed for sound on the Pi 4.- Zero 2 W: the file must not contain
dtoverlay=mmc. That overlay switches the Wi-Fi bus off;install.shwarns about it. - Lines for a screen (
hdmi_*) can follow in a second[all]block; the test Zero has its own 1024x600 mode there.
Pi 5, booted through the UEFI firmware (v0.3 on the test board; the same file is at /boot/efi/config.txt):
armstub=RPI_EFI.fd
device_tree_address=0x1f0000
device_tree_end=0x210000
framebuffer_depth=32
disable_overscan=1
usb_max_current_enable=1
force_turbo=1
enable_uart=1
dtparam=uart0_console
enable_uart=1anddtparam=uart0_consolegive the console on the 3-pin UART connector.- No line is needed for Wi-Fi or the fan.
The Pi 4's own file was not read for this page (the board was offline); it uses the same image file, so the [pi4] block above applies.
Kernel sources
Drivers built on the board need the kernel sources. Only usr/src/sys is used:
fetch https://download.freebsd.org/releases/arm64/aarch64/15.1-RELEASE/src.txz
tar -C / -xf src.txz usr/src/sys
On a Pi 4 build with one job (make, not make -j4): a sagging power supply once killed the compiler there with "illegal instruction".
2. Which driver goes on which board
| Driver | Pi 5 | Pi 4 | Zero 2 W | Repository | Page |
|---|---|---|---|---|---|
cywfm Wi-Fi | yes | yes | yes | freebsd-rpi-wifi | Wi-Fi |
rp1fan fan | yes | n/a | n/a | freebsd-rpi-fan | Fan |
vchiq, bcm2835_audio sound | n/a | yes | not tried | freebsd-rpi-audio | Sound |
ng_h4 and tools, Bluetooth | blocked | built, power line only | simulator only | freebsd-rpi-bt | Bluetooth |
rpitemp | works | built | works | freebsd-rpi-soc | SoC |
rpifreq, rpiwdog, rpirng | works | n/a | n/a | freebsd-rpi-soc | SoC |
rpipower | n/a | built | works | freebsd-rpi-soc | SoC |
rp1 and its children | GPIO, Ethernet, PWM1 work; UART, I2C, SPI transmit only | n/a | n/a | freebsd-rpi-rp1 | RP1 |
For daily use on a board today: Wi-Fi everywhere, plus the fan on a Pi 5. The rest is for testing and reports.
3. The commands, driver by driver
Wi-Fi (cywfm), from a checkout of spagu/freebsd-rpi-wifi:
make install-firmware # Zero 2 W: tools/fetch-firmware.sh -i -c 43436s
# Pi 5: tools/fetch-firmware.sh -i -b raspberrypi,5-model-b
make module
make install # /boot/modules, kldxref, man page
sysrc kld_list+=cywfm wlans_cywfm0=wlan0 create_args_wlan0="country XX" ifconfig_wlan0="WPA DHCP"
Fan (rp1fan, Pi 5), from spagu/freebsd-rpi-fan:
make module
install -m 555 driver/rp1fan.ko /boot/modules/
sysrc kld_list+=rp1fan
kldload rp1fan
Sound (Pi 4), from spagu/freebsd-rpi-audio, with /usr/src/sys installed (make applies patches 0001 to 0004 to a copy and leaves SYSDIR unchanged):
make all SYSDIR=/usr/src/sys
kldload ./driver/vchiq/vchiq.ko ./driver/bcm2835_audio/bcm2835_audio.ko
sysctl dev.pcm.0.dest=1 # headphone jack
Bluetooth (Zero 2 W first), from spagu/freebsd-rpi-bt, with the radio's UART freed from the console:
make module tools
make install
sysrc rpibt_enable=YES
service rpibt start
SoC modules, from spagu/freebsd-rpi-soc:
make modules
kldload ./driver/rpitemp/rpitemp.ko && sysctl hw.rpitemp
The RP1 drivers (Pi 5), from spagu/freebsd-rpi-rp1: make modules, make install, make load; their page lists what runs on the board and what does not.
4. The public part in one script
works Run on 3 December 2026 on a Pi 4 Model B, a Pi 5 Model B and a Zero 2 W, all on FreeBSD 15.1-RELEASE-p7. Each run installed into a separate directory (DESTDIR), not into the live system, and the module installed matched the one already running on those boards byte for byte. The Pi 400 path (a build from source) has run only in the test suite.
What the script installs
| Board | Wi-Fi (cywfm) | Fan (rp1fan) |
|---|---|---|
| Pi 4 Model B | prebuilt module and firmware | n/a |
| Pi 5 Model B | prebuilt module and firmware | built on the board |
| Zero 2 W | prebuilt module and firmware | n/a |
| Pi 400 | built on the board | n/a |
Sound, Bluetooth, the SoC modules and the RP1 drivers are not in it. Their pages list the build steps from each repository.
Requirements: FreeBSD 15.1 or newer on arm64, root, and a network connection (Ethernet or a serial console session with a cable plugged in). A build on the board also needs the kernel sources in /usr/src/sys; the prebuilt Wi-Fi path does not. Older FreeBSD versions are refused.
Run it
Download the script and read it. It is plain
sh, about 200 lines:fetch https://freebsd.tradik.com/install.sh less install.shSee what it would do without changing anything:
sh install.sh -nInstall, as root. With
-ethe modules are also added tokld_listin/etc/rc.conf, so they load at every boot:sh install.sh -eLoad them and set up the network. The script prints the
rc.conflines at the end; the Wi-Fi page explains each one. Keep/etc/wpa_supplicant.confat mode 0600.kldload cywfm
Options: -n dry run, -e load at boot, -b build Wi-Fi from source even when a prebuilt module exists, -d dir working directory (default /var/tmp/freebsd-tradik-install).
What it does, step by step
- Checks for FreeBSD 15.1 or newer, arm64 and root.
- Reads the board model: from the device tree on the Pi 4, Pi 400 and Zero 2 W, from SMBIOS on the Pi 5 (which boots through UEFI firmware). Any other board stops the script.
- Wi-Fi: looks up the newest release of spagu/freebsd-rpi-wifi built for the running FreeBSD version, downloads it, and checks the archive against
SHA256SUMSand every file inside against its own list. On a Pi 5 the same firmware files are also installed under the Pi 5 names. Without a matching release, it downloads the source, buildscywfm.koand fetches the firmware with the repository'stools/fetch-firmware.sh, which checks each file's SHA-256. - Fan (Pi 5 only): downloads spagu/freebsd-rpi-fan and builds
rp1fan.ko. - Installs the modules into
/boot/modulesand the firmware into/boot/firmware, then runskldxref. A module that is already there is kept as<name>.ko.bak. - On a Zero 2 W, warns when
config.txtstill hasdtoverlay=mmc, which switches the Wi-Fi bus off.
It does not touch wpa_supplicant.conf, passwords or network settings, and it loads nothing.
Undo
sysrc kld_list-="cywfm rp1fan"
rm /boot/modules/cywfm.ko /boot/modules/rp1fan.ko
kldxref /boot/modules
To go back to a previous module instead, rename <name>.ko.bak to <name>.ko. The firmware files in /boot/firmware are harmless when no driver uses them.
When it stops
| Message | Meaning |
|---|---|
needs FreeBSD 15.1 or newer | Upgrade first; older releases are not supported. |
board '...' is not supported | The board is none of the four above. A board report helps add it. |
checksum mismatch | A download does not match its published SHA-256. Nothing was installed. Run it again; if it repeats, report it. |
needs the kernel sources in /usr/src/sys | A build is needed. Extract src.txz of the running release, or at least its usr/src/sys. |
build failed | The last 20 lines of the build log are printed; the whole log is in the working directory. |