The hang blamed on Forgejo in the previous commit was git waiting at an
invisible username prompt: the forks are internal to code.karsttech.com
and the build VM has no credentials. Fail at once instead, and correct
the reason for the shallow src fetch (its history is not needed).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A full clone of opnsense-src from Forgejo hung for 5.5 hours with nothing
transferred. The build never reads src history (tools only describes src
when VERSION is not numeric), so fetch just the ref's commit; core, plugins
and ports keep full history and tags for their version strings.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- gwmirror.py: lay a build into the mirror tree, verify it (signatures,
catalogues, sizes, hashes, aarch64-only ELF, and over HTTPS also TLS
expiry, Content-Length, redirects) and publish it with rsync only when
it verifies; tests cover tampering, untrusted and revoked keys,
traversal and decompression limits
- server/: unprivileged nginx for a Portainer stack serving the SMB share
read-only, GET/HEAD only, proxying changelog/bogons from upstream
- monitor/: daily systemd user timer running verify --url
- RELEASE.md: design and runbook; README.md points to it
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- vm.sh: FreeBSD amd64 build VM on the Linux workstation (QEMU/KVM,
no root): verified official image, root SSH key via nuageinit, sync of
this repository, detached builds, signing with the key in a tmpfs
- build.sh: check out all repositories at the release tag, build base,
kernel, xtools, ports, plugins, core and the board package unsigned;
finish signs everything, builds the eMMC image and rejects foreign ELF
files in it; pilot times selected ports to estimate a build
- migrate-device.sh: repoint a gateway from opnsense.mono.si to our
mirror (dry run, backups, strict input checks) and offer the 26.7
major upgrade
- tests for migrate-device.sh and 20-kernel-update
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Makefile: read the FreeBSD release from tools' config/<series>/build.conf
and derive the compiler target and package ABI from it, version the
package <release>_<commit count>, take libxml2 from our own packages
set instead of pkg.FreeBSD.org, clone the NXP sources from the Forgejo
mirrors, and drop the image target (release/build.sh replaces it)
- +MANIFEST: ABI from the series, new maintainer and www
- GATEWAY.conf: annotate mono-gateway as coming from the OPNsense
repository; fail the image build if the package is missing
- mk-image.sh: remove the amd64 qemu binary setup_xtools leaves behind
- 20-kernel-update: drop the 26.1.3 guard; check room on the FAT
partition, copy and verify the new kernel before replacing the old
one, keep kernel.old, restore it on failure, retry at next shutdown
- 01-mono-modules: log modules that fail to load instead of hiding it
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The vendor mirror opnsense.mono.si is gone and upstream publishes no
aarch64 builds, so releases are signed with our own key and served from
https://opnsense.karsttech.com.
The core patches move to patches/<series>/ and are applied with git am
onto core's release tag. The new mirror patch replaces the vendor's:
CORE_PACKAGESITE and the mirror list point at the new mirror, its key
opnsense.karsttech.com.20261117 is trusted, the vendor keys are revoked,
and the separate MonoGateway repository is dropped (mono-gateway is now
published in the OPNsense repository). The CMM restart patch is kept.
keys/ holds the public key and the fingerprints release tooling trusts:
ours (trusted/revoked) and upstream's for changelog/bogons.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This is how our releases have always been built: Patch opnsense/core before building it. This is required for online updates.
Also, update the readme to use opnsense.mono.si for prefetching sets. The packages set available there includes the patched core package.
mono-gateway package installs an rc.syshook script which moves the U-Boot booti compatible kernel image from /boot/kernel to the FAT partition on reboot / shutdown.
The FreeBSD moal shim layer links directly against NXP's GPL-2.0
mlan core (~127K lines). Relicense the 4 moal files and Makefile
from BSD-2-Clause to GPL-2.0 and add NXP copyright, consistent
with the mlan source they are compiled against.
The fastpath stack (CDX, CMM, cmmctl, auto_bridge, FCI, dpa_app)
derives from NXP's ASK SDK which is GPL-2.0+ licensed. Several
components compile NXP vendor source directly, and others include
verbatim GPL headers (list.h, jhash.h, fpp.h).
Change all BSD-2-Clause files in the fastpath stack to GPL-2.0+ and
add original copyright holders (Mindspeed Technologies, Freescale
Semiconductor, NXP) alongside Mono's copyright. Also fix "Ported
from" comment in include/desc.h to "Inspired by".
Components unaffected: pf_notify (100% original BSD), fmlib
(BSD-3-Clause NXP), fmc (MIT NXP).
Add CAAM_ prefix to all 253 descriptor command constants (CMD_* ->
CAAM_CMD_*, HDR_* -> CAAM_HDR_*, KEY_* -> CAAM_KEY_*, OP_ALG_* ->
CAAM_OP_ALG_*, LDST_*, FIFOLD_*, FIFOST_*, JUMP_*, MATH_*, MOVE_*)
to differentiate from Linux drivers/crypto/caam/desc.h naming.
Replace all 30+ Linux references in comments with NXP SEC reference
manual citations. Change "ported from" and "matches exactly" language
to hardware-specification references.
No functional changes — purely mechanical renames and comment rewording
for licensing clarity. Build verified clean with -Werror.
Rename register macros (INA2XX_* -> INA_REG_*), config struct
(ina2xx_config -> ina_chip_params with new field names), and LSB
calculation variable to remove 1:1 naming correspondence with the
Linux hwmon/ina2xx.c GPL driver. Change "Based on" to "Inspired by"
and remove explicit Linux function reference from comments.
No functional changes — purely mechanical renames for licensing clarity.
Replace gpart (which enforces 128 GPT entries = 17KB) with a Python
script that creates a 4-entry GPT table fitting in 1.5KB. This keeps
the entire partition table below 4KB, leaving the 4KB-32MB region free
for LS1046A boot firmware (BL2, FIP, U-Boot env, FMan microcode, DTB).
The boot partition starts at sector 65536 (32MB), matching the existing
GATEWAY.conf ARM_FAT_SIZE setting. FreeBSD's kernel reads 4-entry GPTs
without issue — the 128-entry minimum only applies to gpart create.
The driver attaches via config_intrhook, which runs after the kernel's
inittodr() has already failed with ENXIO. Re-invoke inittodr() after
clock_register_flags() so the system time is set from the RTC.
Replace the two-step flow (make arm-5G → UFS image → mk-zfs-image.sh
converts to ZFS) with mk-image.sh that sources opnsense-build's common.sh
and creates a GPT + ZFS image directly. The script is temporarily swapped
in as arm.sh so the opnsense-build Makefile passes all the correct arguments
without requiring any upstream modifications.
Remove mk-zfs-image.sh (superseded) and the -zfs filename suffix since ZFS
is now the only image format.
cdx_reassm_freebsd.c: Add wakeup() before kthread_exit() in the IPR
timer thread so cdx_deinit_ip_reassembly() doesn't rely on a 2-second
tsleep timeout to detect thread exit.
cmm/Makefile: Add 4 missing source files (cmm_deny.c, cmm_socket.c,
cmm_bridge.c, cmm_l2tp.c) and include paths for auto_bridge and
pf_notify headers, matching Makefile.cross.
cmm/PORTING.md: Remove stale warning about auto_bridge.ko missing
d_kqfilter — already implemented (abm_dev_kqfilter).
Fix a bug in pf_notify where pfn_mark_notified() was called before
pfn_queue_event(). If the ring buffer was full, the READY event was
dropped but the state was already marked as notified — it would never
re-fire, leaving the connection permanently in the software path.
Move pfn_mark_notified() inside the lock, after successful ring_put().
On drop, the state is NOT marked, so the next packet re-triggers READY.
Enlarge the ring buffer from 4K to 128K entries and the notified hash
from 16K to 128K entries, both dynamically allocated (~17 MB total).
Add ring_hwm and ring_used diagnostic sysctls.
With the one-shot ordering fix and larger ring, the polling fallback
in CMM is no longer necessary. Remove cmm_conn_poll() and all
associated code (DIOCGETSTATESV2, epoch-based GC, -p flag, /dev/pf).
CMM now requires pf_notify.ko and uses push events exclusively.
Add cmm_conn_maintenance() as a 30-second timer that retries offload
for pending connections (e.g., after route changes) and runs route GC.
Delete cmm_offload.c/h (poll-path eligibility, now dead code) and
cmm_deny_check() (poll-path deny wrapper).
Add a kevent registration safety check that skips invalid fds to
prevent a single bad fd from killing the entire kqueue setup.
When OPNsense interfaces are reassigned to non-DPAA devices (bridge,
VLAN, etc.), CDX would accept route registrations with unknown input
interface names, creating routes with NULL input_itf. Every subsequent
conntrack insertion then hit the NULL check in insert_entry_in_classif_table()
producing massive DPA_ERR spam.
Fix at two layers:
CDX: Return ERR_UNKNOWN_INTERFACE when input/underlying_input device
names are non-empty but not registered, matching the existing output
device validation. Downgrade ehash NULL checks from DPA_ERROR to
DPA_INFO as a defensive fallback.
CMM: Cache route rejection (fpp_rejected flag) to avoid retrying
known-bad routes on every poll cycle. Flag is cleared on full offload
reset (interface reassignment), allowing fresh attempts with new
interface names.
The dtsec driver now owns the SFP GPIO pins (mod-def0, LOS,
TX-disable). FreeBSD gpiobus only allows one consumer per pin,
so sfpled can no longer acquire them. Remove all SFP GPIO and
I2C EEPROM access from sfpled — derive module presence and link
state purely from the dtsec ifnet link state:
LINK_STATE_UNKNOWN → no module → LEDs off
LINK_STATE_DOWN → module present, no link → orange solid
LINK_STATE_UP → link up → green on, orange blinks on traffic
Same issue as a906b7a (fand): the top-level Makefile exports
SRCDIR=/usr/src which leaks into sub-Makefiles that use SRCDIR
for their own local source directory. Remove the ?= conditional
so the local value is always used.
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.
- Pass SYSROOT and KSRCDIR from top-level Makefile to all Makefile.cross
invocations so SRCTOP override flows through to sub-makes
- Add .ORDER directives to prevent "make -j clean all" race where clean
deletes .ko files while modules target tries to copy them
- Remove redundant dist target (modules/userspace already copy to dist/)
- Fix package target depending on clean (raced with its own dist dep)
- Make IMAGESDIR/SETSDIR overridable with ?=
- Update mk-kernel-img.sh defaults from legacy /mnt/vision paths
- Replace MONO-GATEWAY with GATEWAY in all Makefile comments
- Remove stale patches/ from README directory tree
- Document SRCTOP override and make image shortcut in README
Delete the 5 ioctl ABI headers that now live in opnsense-src at
sys/contrib/ncsw/inc/ioctls/. Update fmlib, fmc, and dpa_app
Makefiles to include them from the kernel source tree via KSRCDIR.
Add mc4_reset()/mc6_reset() handlers in CDX multicast command processor.
CMD_MC4_RESET and CMD_MC6_RESET were unhandled — the size check rejected
them (length 0 < MC4_MIN_COMMAND_SIZE) returning ERR_WRONG_COMMAND_SIZE.
Handle reset before the size check since it carries no payload.
Also: bump libxml2 to 2.15.2, remove sudo from make image (assumes root),
add -isystem for kernel headers in CMM cross-build, add cmmctl command
reference (CMM.md).
Port NXP ASK multicast control plane to FreeBSD. CMM maintains a
shadow table of multicast groups and forwards add/remove/update
commands to CDX via FCI for hardware multicast replication.
CDX kernel-side support (cdx_mc_freebsd.c) was already ported;
this adds the userspace CMM module and cmmctl mc4/mc6 commands.
Match NXP's original route_cache.h layout: 2048 buckets for IPv4,
2048 for IPv6, with IPv6 offset into the second half. Reduces
average chain length under load and eliminates cross-family
collisions that degraded lookup performance at scale.