- K2: config/lock-<version> gives tools, src, ports, plugins and core
their exact commits; build stops when a checkout differs (a tag moved
upstream, or src moved on), and fetches tags without --force.
build.sh lock resolves and writes them. lock-26.7.9 is what 26.7.9 was
built from, checked against the upstream tags.
- K3: verify --root reports symlinks that lead outside the tree or
nowhere, which publish (rsync -L) would follow; such a path is now
reported instead of crashing verify.
- K6: RELEASE.md no longer says core trusts only our key (it also trusts
upstream's, for changelog and bogons), and names no host or user.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The hook deleted /boot/kernel/kernel.bin once it was on the FAT
partition, so the health audit always reported it missing (seen on the
gateway after the 26.7.9 upgrade). It now leaves the kernel set's files
alone and returns early, without a space check or a log line, when the
kernel and device tree on the FAT partition are already the same.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The custom stop killed whatever pid the pid file held, ignored whether
that worked, removed the file and printed "Stopped cmm." On the gateway
cmm was still running right after it. rc.subr's own start, stop and
status (command=) send SIGTERM and wait for the exit, and only act on a
pid file that names a running cmm.
Tested through FreeBSD's rc.subr with a stand-in cmm that takes 2
seconds to exit, and with a stale pid file naming another process.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
U-Boot boots boot/kernel/kernel.bin, and the gateway's 20-kernel-update
skips a kernel set without one, leaving the old kernel in place. FreeBSD
15 builds it only with WITH_KERNEL_BIN, which the 26.7.9 image build was
the first to notice; check the kernel set right after it is built.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Since 26.7 the ports tree builds pkg from opnsense/pkg (2.8.4) and tools
compares the host's pkg with it; ports-mgmt/pkg is FreeBSD's 2.9.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- 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>
FreeBSD 15 names its ports repository FreeBSD-ports instead of FreeBSD,
so the release_N override created a second repository, which had no
mirror_type "srv" for its pkg+https URL and failed. setup now overrides
the first repository /etc/pkg/FreeBSD.conf defines, with mirror_type.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The build runs natively on arm64 since 2026-11-18: setup no longer installs
qemu-user-static and aarch64-binutils (and refuses a non-aarch64 host),
GATEWAY.conf drops PRODUCT_WANTS_CROSS, build no longer asks tools for an
xtools set, finish no longer moves one aside, and mk-image.sh no longer
sets up xtools or removes qemu. The pilot command, which timed ports
before the first full build, goes too.
Gateways are migrated with the shell commands in RELEASE.md, as
ApolloGuardian was, instead of migrate-device.sh; that includes the
custom mirror for a proxy that is not on 443 inside the LAN, and the
major upgrade's UPGRADE_RELEASE.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Tools signs the aux repository's catalogue only in a packages step run
with the key; its sign-packages re-signs the packages set's catalogue but
not the aux set's. Build runs without the key, so the aux catalogue stayed
unsigned and gwmirror verify rejected it. finish now unpacks the aux set,
signs its catalogue with pkg repo and repacks it before tools signs the set.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
finish's scan imported the image's pool with every dataset mounted under
an altroot. The pool's own dataset needs a mountpoint inside the read-only
root, so nothing was mounted, find scanned an empty directory, and the
export then failed with "pool is busy". The pool is now imported without
mounting, and each dataset is mounted read-only by itself. The root must
have /bin/sh, so an empty scan cannot pass. The export is retried, since
the pool stays busy for a while after the import and after an unmount.
build.sh now says when set -e stops it, and vm.sh sign returns finish's
exit status, not tee's.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
xcaddy fetches www/caddy-custom's plugins while it builds, at their
newest versions; caddy-l4 v0.1.3 (2026-11-09) needs caddy 2.11.7 and the
ports tree has 2.11.4, so the port failed. config/make-<series>.conf,
added to tools' make.conf by ports_make_conf, pins tools' plugin list at
the versions of 2026-07-01, when 26.1.11 was tagged.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codeberg now compresses tag archives with GNU gzip instead of git's own,
so sysutils/sysinfo's 1.0.4 archive is 15546 bytes, not distinfo's 15618,
and FreeBSD's distfile cache serves the new one too. git archive of the
tag with git's gzip at level 6 reproduces the original exactly (SHA256
checked by the port). The FETCH_CMD wrapper does that for Codeberg tag
archives, after checking owner, repository and tag strictly, and is
renamed for the second kind of repair.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Tools ran make clean after each port, which cleans every dependency with
the port's own flavor: a dependency with another flavor, or none, looks
for the wrong work-<flavor> and keeps its work directory. After a failure
tools removes the dependencies it built, and the stale directory claims
they are installed, so every later port needing them failed at once
(Rust: cmake not found; libxslt.so not found). build now has tools'
ports.sh remove every work directory instead, and stops if ports.sh no
longer has the two cleans it replaces.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The Rust build in the 12 GB VM lost two llvm-tblgen 2.8 hours in:
FreeBSD kills a process that has waited 30 seconds for a page, and the
emulated VM's pageout took that long with the swap unused. setup turns
those kills off (vm.pfault_oom_attempts=-1), and build caps lang/rust,
which builds its own LLVM with a job per CPU, at one job per 768 MB
through tools' make.conf.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
host_pkg fetched pkg's distfiles again for every build of the host
pkg, and GitHub turned one of its patches away four times in a row,
which stopped the build. It now seeds them into the distfiles set
(repair_distfiles, which skips what the set has) and extracts them
from there. port_distfiles names a port's entries in the set, for
both host_pkg and distfiles_in_set (whose awk now reads them from
the environment).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
FreeBSD's tar lists an empty file as an empty archive, so a package
file cut off at zero bytes passed salvage_ports' check. A salvaged
package must now also hold +MANIFEST.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A 16 GB VM (18 GB in qemu, 7 GB of it ZFS cache) and the HTPC's other
work ran the HTPC out of memory, and its reboot lost 12 hours of the
ports step. The VM now gets a swap disk of its own (swap.qcow2, serial
gwswap, cache=none: off ZFS, where swap can deadlock, and past the
host's page cache), and setup caps the VM's ZFS cache at 2 GB
(vm_memory). The VM itself goes down to 12 GB in vm.conf.
Tools writes the packages set only when a ports step ends. build now
first adds what an interrupted step had finished (salvage_ports): the
runtime packages in the stage's packages directory, when the stage
belongs to the same series, version and ports commit, each checked to
be a whole archive. Build-only dependencies are rebuilt.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The restarted build stopped at seeding pkg's distfiles: GitHub
answered "Service Unavailable" for a patch the distfiles set already
held. repair_distfiles now skips a port whose distfiles and patch
files are all in the set (distfiles_in_set), and fetch-patch.sh tries
GitHub's current patch three times, a minute apart.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Tools caches the build-only dependencies it builds (cmake, autoconf,
the Rust and Go compilers) for the rest of a ports step only, and the
packages set keeps just the listed ports and their runtime
dependencies. Each chunk therefore rebuilt them: the second chunk
started by rebuilding the autotools the first had built.
The step also runs without an argument now: an argument makes tools
stop at the first failed port, while without one it goes on with the
others and fails at the end. ports_list served only the chunks.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Tools' distfiles step walks every port's whole dependency tree again,
one make at a time: 70 of 266 ports in 9 hours under emulation. It
also walks the default flavor's tree for flavored ports (QEMU's desktop
dependencies for qemu@guestagent) and fails there on a port the build
never needs (gstreamer1-plugins-bad, missing from its distinfo). The
ports step fetches what it builds anyway, so the step is dropped, and
with it the tools patch that only fixed it.
pkg's distfiles are seeded into the distfiles set (which tools
extracts into the ports chroot) before the first chunk. A chunk whose
log shows "Couldn't fetch it" or "Giving up on fetching files" has
those ports repaired with fetch-patch.sh and runs once more.
fetch_failures accepts only port names, tested against real and
crafted logs.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Natively, the first fetch in tools' distfiles chroot builds pkg, whose
GitHub patches no longer match distinfo, and tools' fetch loop records
a failure in a path outside the chroot, which under sh -e ended the
loop with no port named. patches/tools/0001 records failures inside
the chroot (as tools' ports step does); build.sh applies patches/tools
to every series. pkg's distfiles go into the set before the step, via
fetch-patch.sh; repairs are appended to the set instead of rewriting
a set of many gigabytes.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Excluding all of dist/ (to keep the VM's build output from --delete)
also skipped dist/.keep, so the VM's checkout looked dirty and
build.sh would refuse to build.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Debian's qemu-system-arm only recommends ipxe-qemu, so the virtio NIC's
efi-virtio.rom is missing from the image and qemu refused to start. The
VM never network-boots: drop the ROM. A qemu that exits at once now
shows its log instead of vm.sh waiting minutes to say it stopped.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
qemu-user cannot run cargo, so no Rust port (py-cryptography and its
dependents) can be cross-built. The build VM is now FreeBSD arm64 under
full-system emulation (qemu-system-aarch64, TCG), run by the new
release/vmhost.sh in a rootless podman container on the build host
GW_VMHOST. vm.sh drives it over ssh and reaches the VM's loopback-only
ssh port through the host (ProxyJump). Settings may live in
$GW_KEYDIR/vm.conf.
The image download probes its sources, resumes stalled transfers and
falls back to a mirror that keeps old releases; the checksum always comes
from FreeBSD itself.
build.sh builds the ports in chunks of PORTS_CHUNK (20) with timings, so
progress is visible and a failure costs one chunk, then runs the whole
list once more to bundle the set. ports_list evaluates ports.conf like
tools' list_config does.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Its distfiles stayed in /usr/ports/distfiles, the lower layer of the
unionfs mount tools puts in every chroot, and the ports step's
rm -rf of distfiles/ there failed with "Operation not supported".
Fetch and build it under /var/tmp instead and remove that afterwards.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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>
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>
- 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>