Craig's pfSense Page

Toolchain Notes

Here are some notes on setting up to cross compile pfSense ports on a FreeBSD poudriere build box.


Use poudriere to build and install the qemu-user-static package. Add configuration to /etc/rc.conf:

qemu_user_static_enable="YES"

Run the rc.d script:

service qemu_user_static start

Build the jail; use the Versions of pfSense and FreeBSD page to map your pfsense target version to the git branch. For 24.03 it's "15.0-CURRENT@a5a965d75934". It's not possible to give poudriere a specific hash (at least I could not figure out how to do this) so I built from a local source tree:

zfs create -o mountpoint=/usr/src/15-CURRENT -o compress=lz4 tank/15-CURRENT 
cd /usr/src
git clone https://git.freebsd.org/src.git 15-CURRENT
cd 15-CURRENT
git checkout a5a965d75934
poudriere jail -x -c -j pfsense2403 -a arm64.aarch64 -m src=/usr/src/15-CURRENT -b

Check out the ports tree; poudriere defaults to master so specify the "devel" branch:

poudriere ports -v -c -m git+https -B devel -p pfsense 

To update the ports tree use:

git stash
poudriere ports -v -u -m git+https -B devel -p pfsense
git stash pop

I like to tweak root's dot files in the jail:

# Edit dot files
zfs list -t snapshot 
zfs destroy tank/poudriere/jails/pfsense2309@clean
vi /usr/local/poudriere/jails/pfsense2309/root/.cshrc
zfs snapshot tank/poudriere/jails/pfsense2309@clean

Create a jail specific poudriere make.conf.

cd /usr/src && git clone https://github.com/pfsense/pfsense.git 
cp -i /usr/src/pfsense/tools/conf/pfPorts/make.conf \
    /usr/local/etc/poudriere.d/pfsense-make.conf

Turn off warning sleep delays:

echo WARNING_WAIT=0 >> /usr/local/etc/poudriere.d/pfsense-make.conf
echo DEV_WARNING_WAIT=0 >> /usr/local/etc/poudriere.d/pfsense-make.conf

Set the default Python versions to match for 23.09 use 3.11:

echo 'DEFAULT_VERSIONS+= python=3.11' >> /usr/local/etc/poudriere.d/pfsense-make.conf

Build something:

poudriere bulk -C -j pfsense2309 -p pfsense net-mgmt/pfSense-pkg-arpwatch

GitHub Forking


Copyright © 2019, 2020, 2021, 2022, 2023, 2024
Craig Leres