build: use standard OPNsense paths (/usr/src, /usr/tools, /usr/deps)

Replace custom /build/ layout with standard OPNsense /usr/ hierarchy.
Add DEPSDIR variable to GATEWAY.conf. Make git pull non-fatal for NFS
setups. Update all Makefile paths, symlinks, and README instructions.
This commit is contained in:
Tomaz Zaman 2026-03-14 20:36:45 +01:00
parent 95f9c28614
commit a5258dd258
48 changed files with 165 additions and 153 deletions

View file

@ -1,20 +1,20 @@
# Top-level build Makefile for opnsense-deps
#
# Build everything:
# make -C /build/opnsense-deps all
# make -C /usr/deps all
#
# Clean all build artifacts:
# make -C /build/opnsense-deps clean
# make -C /usr/deps clean
#
# Build full image (kernel, modules, userspace, package, image):
# make -C /build/opnsense-deps image
# make -C /usr/deps image
#
# Build subsets:
# make -C /build/opnsense-deps modules # kernel modules only
# make -C /build/opnsense-deps userspace # userspace only
# make -C /usr/deps modules # kernel modules only
# make -C /usr/deps userspace # userspace only
#
# Parallel build (modules build concurrently):
# make -C /build/opnsense-deps -j24 all
# make -C /usr/deps -j24 all
#
# Copyright 2026 Mono Technologies Inc.
# SPDX-License-Identifier: BSD-2-Clause
@ -24,10 +24,9 @@ FASTPATH= ${OPSDIR}/fastpath
DRIVERS= ${OPSDIR}/drivers
VENDORDIR?= ${OPSDIR}/_vendor
# Cross-compilation settings (all ?= for easy override)
SRCTOP?= /build
SRCDIR?= ${SRCTOP}/opnsense-src
BUILDTOOL?= ${SRCTOP}/opnsense-build
# Source and tooling paths (standard OPNsense layout)
SRCDIR?= /usr/src
TOOLSDIR?= /usr/tools
SYSROOT?= /usr/obj${SRCDIR}/arm64.aarch64/tmp
KERNBUILDDIR?= /usr/obj${SRCDIR}/arm64.aarch64/sys/GATEWAY
@ -38,7 +37,7 @@ IMAGESDIR?= /usr/local/opnsense/build/${OPS_SETTINGS}/aarch64/images
SETSDIR?= /usr/local/opnsense/build/${OPS_SETTINGS}/aarch64/sets
# Common args for all kernel module builds
# Host clang cross-compiles with explicit --target (bsd.kmod.mk does NOT add it)
# Explicit --target ensures cross-compilation works from amd64; harmless on native aarch64
KMOD_ARGS= SYSDIR=${SRCDIR}/sys \
KERNBUILDDIR=${KERNBUILDDIR} \
MACHINE=arm64 MACHINE_ARCH=aarch64 \
@ -276,17 +275,17 @@ image:
@rm -rf ${DISTDIR}/*
@touch ${DISTDIR}/.keep
@echo "==> Step 1: Checking repositories"
@test -d ${SRCDIR}/.git || git clone https://github.com/we-are-mono/opnsense-src.git ${SRCDIR}
@test -d ${BUILDTOOL}/.git || git clone https://github.com/maurice-w/opnsense-vm-images.git ${BUILDTOOL}
@cp -n ${OPSDIR}/config/GATEWAY.conf ${BUILDTOOL}/device/ 2>/dev/null || true
cd ${SRCDIR} && git checkout ${OPS_BRANCH} && git pull
@test -d ${SRCDIR}/.git || git clone https://github.com/we-are-mono/opnsense-src.git -b ${OPS_BRANCH} ${SRCDIR}
@test -d ${TOOLSDIR}/.git || git clone https://github.com/maurice-w/opnsense-vm-images.git ${TOOLSDIR}
@cp -n ${OPSDIR}/config/GATEWAY.conf ${TOOLSDIR}/device/ 2>/dev/null || true
cd ${SRCDIR} && git checkout ${OPS_BRANCH} && git pull || echo " git pull skipped (NFS or no remote)"
@echo "==> Step 2: Building kernel (clean)"
rm -f ${SETSDIR}/kernel-*-GATEWAY.txz
chflags -R noschg /usr/obj${SRCDIR}/arm64.aarch64 2>/dev/null || true
rm -rf /usr/obj${SRCDIR}/arm64.aarch64
${MAKE} -C ${BUILDTOOL} kernel \
${MAKE} -C ${TOOLSDIR} kernel \
DEVICE=GATEWAY SETTINGS=${OPS_SETTINGS} \
TOOLSDIR=${BUILDTOOL} SRCDIR=${SRCDIR}
TOOLSDIR=${TOOLSDIR} SRCDIR=${SRCDIR}
@echo "==> Step 2a: Populating sysroot from base set"
@_base=$$(ls ${SETSDIR}/base-*-aarch64-GATEWAY.txz 2>/dev/null | head -1); \
if [ -z "$$_base" ]; then \
@ -321,9 +320,9 @@ image:
@echo "==> Step 5: Assembling image"
rm -f ${IMAGESDIR}/OPNsense-*-GATEWAY.img \
${IMAGESDIR}/OPNsense-*-GATEWAY.img.gz
${MAKE} -C ${BUILDTOOL} arm-5G \
${MAKE} -C ${TOOLSDIR} arm-5G \
DEVICE=GATEWAY SETTINGS=${OPS_SETTINGS} \
TOOLSDIR=${BUILDTOOL} SRCDIR=${SRCDIR}
TOOLSDIR=${TOOLSDIR} SRCDIR=${SRCDIR}
@echo "==> Step 6: Compressing and copying to dist/"
@mkdir -p ${DISTDIR}
gzip -k ${IMAGESDIR}/OPNsense-*-GATEWAY.img

134
README.md
View file

@ -56,68 +56,75 @@ on performance or functionality.
## Build instructions
All commands run on the build server (amd64 FreeBSD).
All commands run on the build server (FreeBSD, matching the OPNsense base version).
The build server should run the same FreeBSD version that OPNsense is based on (e.g., FreeBSD 14.3
for OPNsense 26.1). Mismatched versions can cause ABI issues in cross-compiled kernel modules.
The build server should run the same FreeBSD version that OPNsense is based on
(e.g., FreeBSD 14.3 for OPNsense 26.1). Mismatched versions can cause ABI
issues in kernel modules. Native aarch64 builds are preferred; cross-compilation
from amd64 also works (see below).
### 1. Prerequisites
**Native aarch64 build server:**
```
sudo pkg install -y git python3
```
**Cross-compilation from amd64:**
```
sudo pkg install -y git aarch64-binutils qemu-user-static python3
```
### 2. Set up `/build`
### 2. Directory layout
All build paths default to `/build`. This directory must contain
`opnsense-build`, `opnsense-src`, and `opnsense-deps`. To use a different
location, pass `SRCTOP` to make:
The build system uses standard OPNsense paths under `/usr/`. Repositories map
to these paths either by cloning directly or via NFS + nullfs mounts:
| Path | Repository | OPNsense variable |
|------|-----------|-------------------|
| `/usr/src` | [we-are-mono/opnsense-src](https://github.com/we-are-mono/opnsense-src) | `SRCDIR` |
| `/usr/tools` | [maurice-w/opnsense-vm-images](https://github.com/maurice-w/opnsense-vm-images) | `TOOLSDIR` |
| `/usr/deps` | [we-are-mono/opnsense-deps](https://github.com/we-are-mono/opnsense-deps) | (this repo) |
| `/usr/core` | [opnsense/core](https://github.com/opnsense/core) | `COREDIR` |
All paths are overridable: `sudo make -C /usr/deps image SRCDIR=/my/src TOOLSDIR=/my/tools`
**Option A — Local development** (clone directly):
```
sudo make -C /path/to/opnsense-deps image SRCTOP=/path/to/sources
sudo git clone https://github.com/we-are-mono/opnsense-src.git /usr/src
sudo git clone https://github.com/maurice-w/opnsense-vm-images.git /usr/tools
sudo git clone https://github.com/we-are-mono/opnsense-deps /usr/deps
sudo cp /usr/deps/config/GATEWAY.conf /usr/tools/device/
```
**Local development** (source tree lives on the build server):
```
sudo mkdir /build && sudo chown $(whoami) /build
```
**Remote source via NFS** (source tree lives on another machine):
**Option B — Remote source via NFS** (source tree on another machine):
```
# Enable the NFS client
sudo sysrc nfs_client_enable="YES"
sudo service nfsclient start
# Mount the remote share — the NFS export is the directory containing
# opnsense-build, opnsense-src, opnsense-deps, etc.
# Replace [server] with the NFS server's hostname and [nfs-export] with
# the path to the exported directory.
sudo mkdir -p /mnt/opnsense /build
# Mount the remote NFS export
# Replace [server] and [nfs-export] with your NFS server and export path.
# The exported directory should contain opnsense-src, opnsense-build,
# opnsense-deps, and opnsense-core as subdirectories.
sudo mkdir -p /mnt/opnsense /usr/tools /usr/core /usr/deps
echo '[server]:[nfs-export] /mnt/opnsense nfs rw,late 0 0' | sudo tee -a /etc/fstab
echo '/mnt/opnsense /build nullfs rw,late 0 0' | sudo tee -a /etc/fstab
sudo mount /mnt/opnsense
sudo mount /build
echo '/mnt/opnsense/opnsense-src /usr/src nullfs rw,late 0 0' | sudo tee -a /etc/fstab
echo '/mnt/opnsense/opnsense-build /usr/tools nullfs rw,late 0 0' | sudo tee -a /etc/fstab
echo '/mnt/opnsense/opnsense-deps /usr/deps nullfs rw,late 0 0' | sudo tee -a /etc/fstab
echo '/mnt/opnsense/opnsense-core /usr/core nullfs rw,late 0 0' | sudo tee -a /etc/fstab
sudo mount -a
sudo cp /usr/deps/config/GATEWAY.conf /usr/tools/device/
```
Using nullfs (rather than a symlink) ensures `pwd` reports `/build/...` in build
Using nullfs (rather than symlinks) ensures `pwd` reports `/usr/...` in build
output, keeping kernel version strings and module paths clean.
### 2b. Clone repositories
Both the local and NFS paths need the following repositories in `/build`:
```
cd /build
git clone https://github.com/maurice-w/opnsense-vm-images.git opnsense-build
git clone https://github.com/we-are-mono/opnsense-src.git opnsense-src
git clone https://github.com/we-are-mono/opnsense-deps
# Copy the GATEWAY device config into the build system
cp /build/opnsense-deps/config/GATEWAY.conf /build/opnsense-build/device/
```
### 3. Prefetch base and packages
Official OPNsense mirrors only publish amd64 sets. For aarch64, use walker.earth.
@ -126,13 +133,13 @@ Check https://opnsense-update.walker.earth/FreeBSD:14:aarch64/26.1/sets/ for ava
```
export VERSION=26.1.1 # use latest available on the mirror
sudo make -C /build/opnsense-build prefetch-base DEVICE=GATEWAY SETTINGS=26.1 TOOLSDIR=/build/opnsense-build SRCDIR=/build/opnsense-src MIRRORS=https://opnsense-update.walker.earth VERSION=$VERSION
sudo make -C /usr/tools prefetch-base DEVICE=GATEWAY SETTINGS=26.1 TOOLSDIR=/usr/tools MIRRORS=https://opnsense-update.walker.earth VERSION=$VERSION
# The build system expects a -GATEWAY suffix on the base set
cd /usr/local/opnsense/build/26.1/aarch64/sets
sudo mv base-${VERSION}-aarch64.txz base-${VERSION}-aarch64-GATEWAY.txz
sudo make -C /build/opnsense-build prefetch-packages DEVICE=GATEWAY SETTINGS=26.1 TOOLSDIR=/build/opnsense-build SRCDIR=/build/opnsense-src MIRRORS=https://opnsense-update.walker.earth VERSION=$VERSION
sudo make -C /usr/tools prefetch-packages DEVICE=GATEWAY SETTINGS=26.1 TOOLSDIR=/usr/tools MIRRORS=https://opnsense-update.walker.earth VERSION=$VERSION
```
This skips `make base`, `make ports`, `make core`, and `make plugins` (no cross-compilation needed).
@ -157,7 +164,7 @@ After completing steps 1–3, a single command builds the kernel, modules, users
package, and assembles the final eMMC image:
```
sudo make -C /build/opnsense-deps image
sudo make -C /usr/deps image
```
The individual steps below are documented for development workflows where you
@ -166,14 +173,12 @@ only need to rebuild part of the stack.
### 4. Build kernel
```
sudo make -C /build/opnsense-build kernel DEVICE=GATEWAY SETTINGS=26.1 TOOLSDIR=/build/opnsense-build SRCDIR=/build/opnsense-src
sudo make -C /usr/tools kernel DEVICE=GATEWAY SETTINGS=26.1 TOOLSDIR=/usr/tools
```
The OPNsense build system defaults `SRCDIR` to `/usr/src`; since our source tree
is named `opnsense-src`, the explicit `SRCDIR=` is required on all make targets
that touch the kernel source (kernel, arm).
The kernel is cross-compiled natively (no QEMU). Package installation during `make arm` uses QEMU user-static emulation.
On a native aarch64 build server, no cross-compilation flags are needed. On an
amd64 host, the kernel is cross-compiled natively (no QEMU). Package
installation during `make arm` uses QEMU user-static emulation.
**Rebuilding:** The build system caches the kernel set in the sets directory and
skips the build if one already exists. When rebuilding after source changes,
@ -181,23 +186,30 @@ remove the stale set and obj tree first:
```
sudo rm -f /usr/local/opnsense/build/26.1/aarch64/sets/kernel-*-GATEWAY.txz
sudo rm -rf /usr/obj/build/opnsense-src/arm64.aarch64/sys/GATEWAY
sudo rm -rf /usr/obj/usr/src/arm64.aarch64/sys/GATEWAY
```
### 5. Install libxml2 into cross-compilation sysroot
### 5. Install libxml2
Required by opnsense-deps (fmc links against libxml2). Fetch the aarch64 package
from the FreeBSD pkg mirror and extract its headers and libraries into the
cross-compilation sysroot created by `make kernel`.
Required by opnsense-deps (fmc links against libxml2).
> **Note:** `make image` does this automatically. The manual steps below are only
> needed when building without `make image`.
**Native aarch64 build server:**
```
sudo pkg install -y libxml2
```
**Cross-compilation from amd64:**
Fetch the aarch64 package from the FreeBSD pkg mirror and extract its headers
and libraries into the sysroot created by `make kernel`. `make image` does this
automatically; the manual steps below are only needed when building without it.
```
fetch -o /tmp/libxml2.pkg 'https://pkg.FreeBSD.org/FreeBSD:14:aarch64/latest/All/libxml2-2.15.2.pkg'
mkdir -p /tmp/libxml2-extract && cd /tmp/libxml2-extract && tar xf /tmp/libxml2.pkg
SYSROOT=/usr/obj/build/opnsense-src/arm64.aarch64/tmp
SYSROOT=/usr/obj/usr/src/arm64.aarch64/tmp
sudo mkdir -p ${SYSROOT}/usr/local/include ${SYSROOT}/usr/local/lib
sudo cp -r /tmp/libxml2-extract/usr/local/include/libxml2 ${SYSROOT}/usr/local/include/
sudo cp -a /tmp/libxml2-extract/usr/local/lib/libxml2* ${SYSROOT}/usr/local/lib/
@ -206,13 +218,13 @@ sudo cp -a /tmp/libxml2-extract/usr/local/lib/libxml2* ${SYSROOT}/usr/local/lib/
If the package version has changed, override it in the Makefile:
```
make -C /build/opnsense-deps image LIBXML2_PKG=libxml2-2.16.0.pkg
make -C /usr/deps image LIBXML2_PKG=libxml2-2.16.0.pkg
```
### 6. Build custom modules and tools (everything in this repo)
```
sudo make -C /build/opnsense-deps -j24 all
sudo make -C /usr/deps -j24 all
```
The first build automatically clones NXP vendor repositories (mwifiex driver
@ -222,7 +234,7 @@ reuse the cached clones. To force a fresh clone, remove `_vendor/` and rebuild.
### 7. Assemble eMMC image
```
sudo make -C /build/opnsense-build arm-5G DEVICE=GATEWAY SETTINGS=26.1 TOOLSDIR=/build/opnsense-build SRCDIR=/build/opnsense-src
sudo make -C /usr/tools arm-5G DEVICE=GATEWAY SETTINGS=26.1 TOOLSDIR=/usr/tools
```
Output: `/usr/local/opnsense/build/26.1/aarch64/images/OPNsense-*-arm-aarch64-GATEWAY.img`
@ -245,7 +257,7 @@ branch.
**Making a change:**
```bash
cd /build/opnsense-src
cd /usr/src
# See Mono Gateway commits on top of upstream
git log --oneline origin/stable/26.1..HEAD
@ -277,10 +289,10 @@ source. To iterate on one:
```bash
# Rebuild just caam
sudo make -C /build/opnsense-deps build-caam
sudo make -C /usr/deps build-caam
# Or rebuild all modules
sudo make -C /build/opnsense-deps -j24 modules
sudo make -C /usr/deps -j24 modules
```
Output `.ko` files land in the driver directory and are collected into `dist/`

View file

@ -14,8 +14,9 @@ export HOSTNAME=mono-gateway
export ARM_FAT_SIZE="80m -b 32m"
# No PRODUCT_UEFI -- we boot via U-Boot booti, not EFI
# Artifacts directory (custom board modules, tools, configs)
MONO_GW_DEPS="${MONO_GW_DEPS:-${TOOLSDIR%/*}/opnsense-deps/dist}"
# deps directory (opnsense-deps repo with board modules, tools, configs)
DEPSDIR="${DEPSDIR:-/usr/deps}"
MONO_GW_DEPS="${MONO_GW_DEPS:-${DEPSDIR}/dist}"
arm_install_uboot()
{
@ -25,7 +26,7 @@ arm_install_uboot()
local KERNEL_ELF="${STAGEDIR}/boot/kernel/kernel"
# Convert ELF kernel to ARM64 Image format for U-Boot booti
sh "${TOOLSDIR%/*}/opnsense-deps/mk-kernel-img.sh" \
sh "${DEPSDIR}/mk-kernel-img.sh" \
"${KERNEL_ELF}" "${STAGEDIR}/boot/msdos/kernel.img"
# Copy device tree binary
@ -35,7 +36,7 @@ arm_install_uboot()
# rc.conf.local must be written here (not in arm_hook) because
# setup_xbase() deletes rc.conf.local after arm_hook runs.
local MONO_GW_RCD="${TOOLSDIR%/*}/opnsense-deps/rc.d"
local MONO_GW_RCD="${DEPSDIR}/rc.d"
if [ -f "${MONO_GW_RCD}/rc.conf.local" ]; then
cat "${MONO_GW_RCD}/rc.conf.local" >> \
"${STAGEDIR}/etc/rc.conf.local"

View file

@ -4,8 +4,8 @@
# QI files require NCSW/DPAA include paths (DPAA must be patched into kernel).
#
# Build:
# make -C /build/opnsense-deps/drivers/caam \
# KERNBUILDDIR=/usr/obj/build/opnsense-src/arm64.aarch64/sys/GATEWAY \
# make -C /usr/deps/drivers/caam \
# KERNBUILDDIR=/usr/obj/usr/src/arm64.aarch64/sys/GATEWAY \
# MACHINE=arm64 MACHINE_ARCH=aarch64 CC=cc LD=ld.lld
#
# Copyright 2026 Mono Technologies Inc.

View file

@ -3,8 +3,8 @@
# Bridges mwifiex PCIe WiFi with DPAA1 FMan OH port for CDX offload.
#
# Build:
# make -C /build/opnsense-deps/drivers/dpaa_wifi \
# KERNBUILDDIR=/usr/obj/build/opnsense-src/arm64.aarch64/sys/GATEWAY \
# make -C /usr/deps/drivers/dpaa_wifi \
# KERNBUILDDIR=/usr/obj/usr/src/arm64.aarch64/sys/GATEWAY \
# MACHINE=arm64 MACHINE_ARCH=aarch64 CC=cc LD=ld.lld
#
# Copyright 2026 Mono Technologies Inc.

View file

@ -1,8 +1,8 @@
# Microchip EMC2301/2302/2303/2305 Fan Controller kernel module for FreeBSD
#
# Build:
# make -C /build/opnsense-deps/drivers/emc2302 \
# KERNBUILDDIR=/usr/obj/build/opnsense-src/arm64.aarch64/sys/GATEWAY \
# make -C /usr/deps/drivers/emc2302 \
# KERNBUILDDIR=/usr/obj/usr/src/arm64.aarch64/sys/GATEWAY \
# MACHINE=arm64 MACHINE_ARCH=aarch64 CC=cc LD=ld.lld
#
# Copyright 2026 Mono Technologies Inc.

View file

@ -2,12 +2,12 @@
#
# Build:
# mkdir -p /tmp/fand-build && cd /tmp/fand-build
# make -f /build/opnsense-deps/drivers/fand/Makefile
# make -f /usr/deps/drivers/fand/Makefile
#
# Copyright 2026 Mono Technologies Inc.
# SPDX-License-Identifier: BSD-2-Clause
SYSROOT?= /usr/obj/build/opnsense-src/arm64.aarch64/tmp
SYSROOT?= /usr/obj/usr/src/arm64.aarch64/tmp
CC?= cc
TARGET?= --target=aarch64-unknown-freebsd14.3

View file

@ -1,8 +1,8 @@
# TI INA2xx Power Monitor kernel module for FreeBSD
#
# Build:
# make -C /build/opnsense-deps/drivers/ina2xx \
# KERNBUILDDIR=/usr/obj/build/opnsense-src/arm64.aarch64/sys/GATEWAY \
# make -C /usr/deps/drivers/ina2xx \
# KERNBUILDDIR=/usr/obj/usr/src/arm64.aarch64/sys/GATEWAY \
# MACHINE=arm64 MACHINE_ARCH=aarch64 CC=cc LD=ld.lld
#
# Copyright 2026 Mono Technologies Inc.

View file

@ -1,8 +1,8 @@
# TI LP5812 LED Controller kernel module for FreeBSD
#
# Build:
# make -C /build/opnsense-deps/drivers/lp5812 \
# KERNBUILDDIR=/usr/obj/build/opnsense-src/arm64.aarch64/sys/GATEWAY \
# make -C /usr/deps/drivers/lp5812 \
# KERNBUILDDIR=/usr/obj/usr/src/arm64.aarch64/sys/GATEWAY \
# MACHINE=arm64 MACHINE_ARCH=aarch64 CC=cc LD=ld.lld
#
# Copyright 2026 Mono Technologies Inc.

View file

@ -1 +1 @@
/build/opnsense-deps/_vendor/mwifiex/mlan/mlan_11ac.c
/usr/deps/_vendor/mwifiex/mlan/mlan_11ac.c

View file

@ -1 +1 @@
/build/opnsense-deps/_vendor/mwifiex/mlan/mlan_11ax.c
/usr/deps/_vendor/mwifiex/mlan/mlan_11ax.c

View file

@ -1 +1 @@
/build/opnsense-deps/_vendor/mwifiex/mlan/mlan_11d.c
/usr/deps/_vendor/mwifiex/mlan/mlan_11d.c

View file

@ -1 +1 @@
/build/opnsense-deps/_vendor/mwifiex/mlan/mlan_11h.c
/usr/deps/_vendor/mwifiex/mlan/mlan_11h.c

View file

@ -1 +1 @@
/build/opnsense-deps/_vendor/mwifiex/mlan/mlan_11n.c
/usr/deps/_vendor/mwifiex/mlan/mlan_11n.c

View file

@ -1 +1 @@
/build/opnsense-deps/_vendor/mwifiex/mlan/mlan_11n_aggr.c
/usr/deps/_vendor/mwifiex/mlan/mlan_11n_aggr.c

View file

@ -1 +1 @@
/build/opnsense-deps/_vendor/mwifiex/mlan/mlan_11n_rxreorder.c
/usr/deps/_vendor/mwifiex/mlan/mlan_11n_rxreorder.c

View file

@ -1 +1 @@
/build/opnsense-deps/_vendor/mwifiex/mlan/mlan_cfp.c
/usr/deps/_vendor/mwifiex/mlan/mlan_cfp.c

View file

@ -1 +1 @@
/build/opnsense-deps/_vendor/mwifiex/mlan/mlan_cmdevt.c
/usr/deps/_vendor/mwifiex/mlan/mlan_cmdevt.c

View file

@ -1 +1 @@
/build/opnsense-deps/_vendor/mwifiex/mlan/mlan_init.c
/usr/deps/_vendor/mwifiex/mlan/mlan_init.c

View file

@ -1 +1 @@
/build/opnsense-deps/_vendor/mwifiex/mlan/mlan_join.c
/usr/deps/_vendor/mwifiex/mlan/mlan_join.c

View file

@ -1 +1 @@
/build/opnsense-deps/_vendor/mwifiex/mlan/mlan_meas.c
/usr/deps/_vendor/mwifiex/mlan/mlan_meas.c

View file

@ -1 +1 @@
/build/opnsense-deps/_vendor/mwifiex/mlan/mlan_misc.c
/usr/deps/_vendor/mwifiex/mlan/mlan_misc.c

View file

@ -1 +1 @@
/build/opnsense-deps/_vendor/mwifiex/mlan/mlan_pcie.c
/usr/deps/_vendor/mwifiex/mlan/mlan_pcie.c

View file

@ -1 +1 @@
/build/opnsense-deps/_vendor/mwifiex/mlan/mlan_scan.c
/usr/deps/_vendor/mwifiex/mlan/mlan_scan.c

View file

@ -1 +1 @@
/build/opnsense-deps/_vendor/mwifiex/mlan/mlan_shim.c
/usr/deps/_vendor/mwifiex/mlan/mlan_shim.c

View file

@ -1 +1 @@
/build/opnsense-deps/_vendor/mwifiex/mlan/mlan_sta_cmd.c
/usr/deps/_vendor/mwifiex/mlan/mlan_sta_cmd.c

View file

@ -1 +1 @@
/build/opnsense-deps/_vendor/mwifiex/mlan/mlan_sta_cmdresp.c
/usr/deps/_vendor/mwifiex/mlan/mlan_sta_cmdresp.c

View file

@ -1 +1 @@
/build/opnsense-deps/_vendor/mwifiex/mlan/mlan_sta_event.c
/usr/deps/_vendor/mwifiex/mlan/mlan_sta_event.c

View file

@ -1 +1 @@
/build/opnsense-deps/_vendor/mwifiex/mlan/mlan_sta_ioctl.c
/usr/deps/_vendor/mwifiex/mlan/mlan_sta_ioctl.c

View file

@ -1 +1 @@
/build/opnsense-deps/_vendor/mwifiex/mlan/mlan_sta_rx.c
/usr/deps/_vendor/mwifiex/mlan/mlan_sta_rx.c

View file

@ -1 +1 @@
/build/opnsense-deps/_vendor/mwifiex/mlan/mlan_sta_tx.c
/usr/deps/_vendor/mwifiex/mlan/mlan_sta_tx.c

View file

@ -1 +1 @@
/build/opnsense-deps/_vendor/mwifiex/mlan/mlan_txrx.c
/usr/deps/_vendor/mwifiex/mlan/mlan_txrx.c

View file

@ -1 +1 @@
/build/opnsense-deps/_vendor/mwifiex/mlan/mlan_uap_cmdevent.c
/usr/deps/_vendor/mwifiex/mlan/mlan_uap_cmdevent.c

View file

@ -1 +1 @@
/build/opnsense-deps/_vendor/mwifiex/mlan/mlan_uap_ioctl.c
/usr/deps/_vendor/mwifiex/mlan/mlan_uap_ioctl.c

View file

@ -1 +1 @@
/build/opnsense-deps/_vendor/mwifiex/mlan/mlan_uap_txrx.c
/usr/deps/_vendor/mwifiex/mlan/mlan_uap_txrx.c

View file

@ -1 +1 @@
/build/opnsense-deps/_vendor/mwifiex/mlan/mlan_wmm.c
/usr/deps/_vendor/mwifiex/mlan/mlan_wmm.c

View file

@ -1 +1 @@
/build/opnsense-deps/_vendor/imx-firmware/FwImage_9098_PCIE/pcieuart9098_combo_v1.bin
/usr/deps/_vendor/imx-firmware/FwImage_9098_PCIE/pcieuart9098_combo_v1.bin

View file

@ -1,8 +1,8 @@
# NXP PCF2131 RTC kernel module for FreeBSD
#
# Build:
# make -C /build/opnsense-deps/drivers/pcf2131 \
# KERNBUILDDIR=/usr/obj/build/opnsense-src/arm64.aarch64/sys/GATEWAY \
# make -C /usr/deps/drivers/pcf2131 \
# KERNBUILDDIR=/usr/obj/usr/src/arm64.aarch64/sys/GATEWAY \
# MACHINE=arm64 MACHINE_ARCH=aarch64 CC=cc LD=ld.lld
#
# Copyright 2026 Mono Technologies Inc.

View file

@ -1,8 +1,8 @@
# SFP LED Control kernel module for FreeBSD
#
# Build:
# make -C /build/opnsense-deps/drivers/sfp-led \
# KERNBUILDDIR=/usr/obj/build/opnsense-src/arm64.aarch64/sys/GATEWAY \
# make -C /usr/deps/drivers/sfp-led \
# KERNBUILDDIR=/usr/obj/usr/src/arm64.aarch64/sys/GATEWAY \
# MACHINE=arm64 MACHINE_ARCH=aarch64 CC=cc LD=ld.lld
#
# Copyright 2026 Mono Technologies Inc.

View file

@ -1,8 +1,8 @@
# TI TMP431 Temperature Sensor kernel module for FreeBSD
#
# Build:
# make -C /build/opnsense-deps/drivers/tmp431 \
# KERNBUILDDIR=/usr/obj/build/opnsense-src/arm64.aarch64/sys/GATEWAY \
# make -C /usr/deps/drivers/tmp431 \
# KERNBUILDDIR=/usr/obj/usr/src/arm64.aarch64/sys/GATEWAY \
# MACHINE=arm64 MACHINE_ARCH=aarch64 CC=cc LD=ld.lld
#
# Copyright 2026 Mono Technologies Inc.

View file

@ -1,8 +1,8 @@
# auto_bridge kernel module
#
# Build (cross-compile for arm64):
# make -C /build/opnsense-deps/fastpath/auto_bridge \
# KERNBUILDDIR=/usr/obj/build/opnsense-src/arm64.aarch64/sys/GATEWAY \
# make -C /usr/deps/fastpath/auto_bridge \
# KERNBUILDDIR=/usr/obj/usr/src/arm64.aarch64/sys/GATEWAY \
# MACHINE=arm64 MACHINE_ARCH=aarch64 CC=cc LD=ld.lld
#
# Copyright 2026 Mono Technologies Inc.

View file

@ -1,16 +1,16 @@
# CMM cross-compilation Makefile for arm64
#
# Usage:
# make -f /build/opnsense-deps/fastpath/cmm/Makefile.cross
# make -f /usr/deps/fastpath/cmm/Makefile.cross
#
# Builds in the current directory (use /tmp/cmm-build or similar).
# Requires OPNsense base build first:
# sudo make -C /build/opnsense-build base DEVICE=GATEWAY SETTINGS=26.1 TOOLSDIR=/build/opnsense-build
# sudo make -C /usr/tools base DEVICE=GATEWAY SETTINGS=26.1 TOOLSDIR=/usr/tools
#
# Copyright 2026 Mono Technologies Inc.
# SPDX-License-Identifier: BSD-2-Clause
SYSROOT?= /usr/obj/build/opnsense-src/arm64.aarch64/tmp
SYSROOT?= /usr/obj/usr/src/arm64.aarch64/tmp
CC?= cc
TARGET?= --target=aarch64-unknown-freebsd14.3
@ -30,7 +30,7 @@ PROG= cmm
CFLAGS= -O2 -pipe -Wall -Wextra -Wno-unused-parameter
CFLAGS+= --sysroot=${SYSROOT} ${TARGET}
KSRCDIR?= /build/opnsense-src
KSRCDIR?= /usr/src
CFLAGS+= -isystem ${KSRCDIR}/sys
CFLAGS+= -I${FCI_DIR} -I${FCI_HDR} -I${SRCDIR}/include -I${CMM_DIR} \
-I${SRCDIR}/auto_bridge -I${SRCDIR}/pf_notify

View file

@ -2,15 +2,15 @@
#
# Usage:
# mkdir -p /tmp/cmmctl-build && cd /tmp/cmmctl-build
# make -f /build/opnsense-deps/fastpath/cmmctl/Makefile.cross clean all
# make -f /usr/deps/fastpath/cmmctl/Makefile.cross clean all
#
# Requires OPNsense base build first:
# sudo make -C /build/opnsense-build base DEVICE=GATEWAY SETTINGS=26.1 TOOLSDIR=/build/opnsense-build
# sudo make -C /usr/tools base DEVICE=GATEWAY SETTINGS=26.1 TOOLSDIR=/usr/tools
#
# Copyright 2026 Mono Technologies Inc.
# SPDX-License-Identifier: BSD-2-Clause
SYSROOT?= /usr/obj/build/opnsense-src/arm64.aarch64/tmp
SYSROOT?= /usr/obj/usr/src/arm64.aarch64/tmp
CC?= cc
TARGET?= --target=aarch64-unknown-freebsd14.3

View file

@ -1,7 +1,7 @@
# dpa_app cross-compilation Makefile for FreeBSD arm64
#
# Usage:
# make -f /build/opnsense-deps/fastpath/dpa_app/Makefile.cross
# make -f /usr/deps/fastpath/dpa_app/Makefile.cross
#
# Builds in the current directory (use /tmp/dpa_app-build or similar).
# Requires:
@ -12,7 +12,7 @@
# Copyright 2026 Mono Technologies Inc.
# SPDX-License-Identifier: BSD-2-Clause
SYSROOT?= /usr/obj/build/opnsense-src/arm64.aarch64/tmp
SYSROOT?= /usr/obj/usr/src/arm64.aarch64/tmp
CC?= cc
CXX?= c++
TARGET?= --target=aarch64-unknown-freebsd14.3
@ -24,7 +24,7 @@ FMLIB_LIB?= /tmp/fmlib-build
FMC_INC?= ${MAKEFILE:H}/../fmc/source
FMC_LIB?= /tmp/fmc-build
CDX_INC?= ${MAKEFILE:H}/../vendor/cdx
KSRCDIR?= /build/opnsense-src
KSRCDIR?= /usr/src
CFLAGS= -O2 -pipe -Wall -Wno-unused-variable
CFLAGS+= --sysroot=${SYSROOT} ${TARGET}

View file

@ -1,7 +1,7 @@
# FMC cross-compilation Makefile for FreeBSD arm64
#
# Usage:
# make -f /build/opnsense-deps/fastpath/fmc/Makefile.cross
# make -f /usr/deps/fastpath/fmc/Makefile.cross
#
# Builds in the current directory (use /tmp/fmc-build or similar).
# Requires:
@ -12,7 +12,7 @@
# Copyright 2026 Mono Technologies Inc.
# SPDX-License-Identifier: BSD-2-Clause
SYSROOT?= /usr/obj/build/opnsense-src/arm64.aarch64/tmp
SYSROOT?= /usr/obj/usr/src/arm64.aarch64/tmp
CC?= cc
CXX?= c++
AR?= ar
@ -22,7 +22,7 @@ SRCDIR?= ${MAKEFILE:H}/source
FMLIB_INC?= ${MAKEFILE:H}/../fmlib/include/fmd
FMLIB_LIB?= /tmp/fmlib-build
TCLAP_INC?= ${MAKEFILE:H}/tclap
KSRCDIR?= /build/opnsense-src
KSRCDIR?= /usr/src
CFLAGS= -O2 -pipe -Wall -fPIC
CFLAGS+= --sysroot=${SYSROOT} ${TARGET}

View file

@ -1,16 +1,16 @@
# fmlib cross-compilation Makefile for FreeBSD arm64
#
# Usage:
# make -f /build/opnsense-deps/fastpath/fmlib/Makefile.cross
# make -f /usr/deps/fastpath/fmlib/Makefile.cross
#
# Builds in the current directory (use /tmp/fmlib-build or similar).
# Requires OPNsense base build first:
# sudo make -C /build/opnsense-build base DEVICE=GATEWAY SETTINGS=26.1 TOOLSDIR=/build/opnsense-build
# sudo make -C /usr/tools base DEVICE=GATEWAY SETTINGS=26.1 TOOLSDIR=/usr/tools
#
# Copyright 2026 Mono Technologies Inc.
# SPDX-License-Identifier: BSD-2-Clause
SYSROOT?= /usr/obj/build/opnsense-src/arm64.aarch64/tmp
SYSROOT?= /usr/obj/usr/src/arm64.aarch64/tmp
CC?= cc
AR?= ar
TARGET?= --target=aarch64-unknown-freebsd14.3
@ -18,7 +18,7 @@ TARGET?= --target=aarch64-unknown-freebsd14.3
SRCDIR= ${MAKEFILE:H}
FMLIB_INC= ${SRCDIR}/include/fmd
FMLIB_SRC= ${SRCDIR}/src
KSRCDIR?= /build/opnsense-src
KSRCDIR?= /usr/src
# Platform: LS1043/LS1046A (FManv3, DPAA v11)
# NCSW_LINUX: selects types_linux.h (stdint/stdbool — works on FreeBSD too)

View file

@ -1,8 +1,8 @@
# pf_notify kernel module
#
# Build (cross-compile for arm64):
# make -C /build/opnsense-deps/fastpath/pf_notify \
# KERNBUILDDIR=/usr/obj/build/opnsense-src/arm64.aarch64/sys/GATEWAY \
# make -C /usr/deps/fastpath/pf_notify \
# KERNBUILDDIR=/usr/obj/usr/src/arm64.aarch64/sys/GATEWAY \
# MACHINE=arm64 MACHINE_ARCH=aarch64 CC=cc LD=ld.lld
#
# Copyright 2026 Mono Technologies Inc.

View file

@ -12,12 +12,12 @@
# (matching the ELF layout), causing page table corruption on MMU enable.
#
# Usage: mk-kernel-img.sh [kernel_elf] [output]
# kernel_elf defaults to /usr/obj/build/opnsense-src/arm64.aarch64/sys/GATEWAY/kernel.full
# kernel_elf defaults to /usr/obj/usr/src/arm64.aarch64/sys/GATEWAY/kernel.full
# output defaults to ./kernel.img
set -e
KERNEL_ELF="${1:-/usr/obj/build/opnsense-src/arm64.aarch64/sys/GATEWAY/kernel.full}"
KERNEL_ELF="${1:-/usr/obj/usr/src/arm64.aarch64/sys/GATEWAY/kernel.full}"
OUTPUT="${2:-./kernel.img}"
TMPBIN=$(mktemp /tmp/kernel.bin.XXXXXX)
TMPIMG=$(mktemp /tmp/kernel.img.XXXXXX)