Commit graph

27 commits

Author SHA1 Message Date
87893ded3e Build 26.7 for FreeBSD 15 only; port caam and cdx to its kernel
- caam: the bus activate, deactivate and release resource methods take
  no type and rid in FreeBSD 15.
- cdx: sys/cdefs.h defines __maybe_unused now; define it only if missing.
- 26.1 is end of life and no longer built: remove patches/26.1 and
  make-26.1.conf, default to 26.7 and FreeBSD 15.1 throughout, and move
  the build examples in README.md and RELEASE.md to 26.7.9. The 26.1
  tree on the mirror stays, for gateways that still have to upgrade.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 19:26:41 -05:00
1ab64f5ba2 Recover GitHub-generated patch distfiles; fix git ownership in the VM
The first pilot stopped building the host pkg: GitHub now abbreviates the
object names on the index lines of its generated commit patches with 10
digits instead of 9, so OPNsense's patches of ports-mgmt/pkg no longer
match distinfo, and nothing caches OPNsense's own distfiles.

- release/fetch-patch.sh: FETCH_CMD that, when fetch(1) fails for a
  GitHub commit/pull/compare patch, shortens the abbreviations until the
  size matches; the port's checksum target verifies the SHA256.
- build.sh: run tools' distfiles step on its own, repair the ports it
  could not fetch on the host into the distfiles set, and rerun it; the
  pilot fetches its ports' distfiles too; host pkg uses the wrapper.
- vm.sh sync: files owned by root in the VM. They kept the workstation's
  uid, git refused the "dubious" repository, and that defeated the dirty
  check silently. build.sh now fails when git cannot read /usr/deps, and
  the package target refuses a version without the commit count.
- migrate-device.sh: FreeBSD grep rejects the empty alternative in the
  fingerprint file check, so it failed on every device. Found by running
  release/tests on the build VM, now part of the documented test run.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-18 13:43:10 -05:00
ccebd54083 board package: build per series, harden kernel install for U-Boot
- 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>
2026-11-17 18:56:54 -05:00
Maurice Walker
5e16b997aa Force-add fingerprint and Mono Gateway repo before committing core patches 2026-06-17 04:21:01 +02:00
Maurice Walker
93b3a45ddd Move mirror / repo / fingerprint configuration to core package
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.
2026-06-17 03:49:36 +02:00
Maurice Walker
fc51b3794b pkg: add kernel updater
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.
2026-04-09 03:59:52 +02:00
Tomaz Zaman
b728bd41f7 cmm: add configd action for interface reassignment restart
Add actions_cmm.conf so OPNsense configd can restart CMM when
interfaces are reassigned. Include in package build and plist.
2026-04-03 16:54:54 +02:00
Tomaz Zaman
a6471b16f6 build: use minimal 4-entry GPT to reserve firmware region on eMMC
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.
2026-03-27 23:06:02 +01:00
Maurice Walker
f6152d5c6e remove custom growfs script
Not applicable or required for ZFS. OPNsense core has its own growfs feature.
https://github.com/opnsense/core/blob/stable/26.1/src/etc/rc
2026-03-26 23:42:11 +01:00
Tomaz Zaman
0d00190958 build: create ZFS image directly, eliminate UFS intermediate step
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.
2026-03-26 16:02:39 +01:00
Tomaz Zaman
d7b89fbce7 build: use upstream opnsense/tools instead of opnsense-vm-images fork 2026-03-16 00:02:36 +01:00
Tomaz Zaman
a5258dd258 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.
2026-03-15 02:23:20 +01:00
Maurice Walker
95f9c28614
Makefile: allow SRCDIR and BUILDTOOL override 2026-03-15 02:21:40 +01:00
Tomaz Zaman
3481c87698 build: forward SYSROOT/KSRCDIR to sub-makes, fix parallel clean race
- 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
2026-03-14 15:07:06 +01:00
Tomaz Zaman
d5060f404d CDX: fix MC4/MC6 reset commands, build and doc improvements
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).
2026-03-14 00:39:52 +01:00
Tomaz Zaman
ef5b163670 WiFi UAP: WPA3-SAE PMF fix, rc.d service, CMM loopback fix
- Fix WPA3-SAE authentication failure by injecting custom RSN IE with
  PMF capability bits (MFPC/MFPR) via MLAN_OID_MISC_CUSTOM_IE. Without
  PMF advertised in beacons, WPA3 clients reject the connection.
- Use PROTOCOL_WPA2 + KEY_MGMT_SAE instead of PROTOCOL_WPA3_SAE so
  mlan TLV builder emits AKMP/cipher/passphrase TLVs correctly.
- Add SAE password field population for WPA3 and WPA2+WPA3 modes.
- Add UAP sysctls: country code, beacon interval, DTIM period.
- Add mwifiex_uap rc.d service script for rc.conf-based AP config.
- Load dpaa_wifi module before mwifiex in early syshook script.
- Fix CMM route offload logging thousands of errors for loopback input
  device — skip lo0 in cmm_fe_route_register() since CDX can't use it.
- Remove uninformative debug printk from CDX control_wifi.c.
2026-03-06 21:59:21 +01:00
Tomaz Zaman
1bc132cc48 CDX: PLCR/KG miss fixup, per-CPU dist FQs, clean kldunload
- Miss action fixup: Ethernet/PPPoE tables → PLCR policer (rate-limits
  exception traffic), all other tables → KG scheme with CC_EN (re-enters
  CC tree). Replaces previous ENQ_FRAME-to-default-FQID approach.

- Distribution FQRs now use per-CPU SW portal channels instead of pool
  channel, preventing TCP reordering on miss path.

- BMan buffer refill: cdx_dist_fq_rx_callback now calls
  dtsec_rm_pool_rx_refill_bpid() and frees buffers via
  dtsec_rm_buf_free_external() (per-port UMA zone) instead of direct
  bman_put_buffer().

- Clean kldunload: cdx_destroy_port_fqs() retires all dist FQRs,
  qman_portal_quiesce() drains in-flight portal polls.
  FM_PORT_DeletePCD() called on all dtsec RX + OH ports before hash
  table deletion, preventing FMan PCD exceptions after unload.
2026-03-05 23:49:54 +01:00
Tomaz Zaman
2339ecc091 Fix CAAM detach stale children, update CEETM and kernel patches 2026-03-03 21:05:53 +01:00
Tomaz Zaman
0ac9dbe362 Fix CAAM JR double enumeration, stale NOP interrupt, add make image target 2026-03-03 17:32:47 +01:00
Tomaz Zaman
55441f0eca Add hwmon dashboard widget and fix EMC2302 fan stall detection 2026-03-03 02:02:49 +01:00
Tomaz Zaman
f535564d2d Add TI TMP431 dual-channel temperature sensor driver 2026-03-03 01:42:55 +01:00
Tomaz Zaman
d0764a8f5c Force clean build for package target, add CDX route diagnostics
Make 'package' depend on 'clean' so stale .ko files from incremental
builds can't end up in the image. Iterative development targets (all,
build-cdx, etc.) still use incremental builds.

Add diagnostic prints to CDX route registration and classification
table insert paths to show interface names and route IDs when lookups
fail, making NULL underlying_input_itf errors actionable.
2026-03-02 14:37:31 +01:00
Tomaz Zaman
7dcc939229 Split monolithic kernel patch into 6 format-patches
Replace the single OPNsense-26.1-aarch64-GATEWAY.patch with per-subsystem
format-patches in patches/. These are generated from the opnsense-src
mono-gateway branch via git format-patch and can be applied with git am.

Also fix package build: add pcf2131.ko and caam.ko to plist, clean stale
packages before creating new ones, and update README with build instructions
and the git am workflow.
2026-03-02 13:57:35 +01:00
Tomaz Zaman
f88576c880 Move pcf2131 and caam to out-of-tree kernel modules 2026-03-02 13:57:35 +01:00
Tomaz Zaman
69b7fea989 Better versioning 2026-02-27 14:20:28 +01:00
Tomaz Zaman
6dae3f78f7 Add mono-gateway FreeBSD package build target 2026-02-27 13:19:20 +01:00
Tomaz Zaman
5514d65ac5 Hello world. 2026-02-25 15:13:46 +01:00