Skip to content

NextBSD: configure FreeBSD's package repository in bootstrap.sh - #82

Open
pkgdemon wants to merge 2 commits into
devfrom
nextbsd-own-freebsd-repo
Open

pkgdemon wants to merge 2 commits into
devfrom
nextbsd-own-freebsd-repo

Conversation

@pkgdemon

@pkgdemon pkgdemon commented Oct 31, 2026 •

Copy link
Copy Markdown
Collaborator

Part of NextBSD dropping its FreeBSD repository configuration: nextbsd/nextbsd-kernel#376 (image side: nextbsd/nextbsd#606). Companion: gershwin-desktop/gershwin-desktop#108 (the NextBSD live-ISO target).

Why

NextBSD is moving to its own version (27.0.0) and its own package ABI, NextBSD:27:<arch>, and its images will no longer ship /usr/local/etc/pkg/repos/FreeBSD.conf. The packages in Library/OSSupport/nextbsd.txt all come from FreeBSD's repository, so bootstrap.sh on NextBSD would have no repository that offers them, and pkg would ask for NextBSD:27 packages anyway.

Change

Only the nextbsd case of Library/Scripts/bootstrap.sh, and only when something from nextbsd.txt is missing:

  • Writes Gershwin's own /usr/local/etc/pkg/repos/FreeBSD.conf: pkg+https://pkg.FreeBSD.org/FreeBSD:15:<arch>/latest, mirror_type: srv, signature_type: fingerprints, enabled: no. <arch> comes from uname -p, with aarch64 on arm64 (pkg's name).
  • Why disabled: pkg rejects a whole repository whose packages don't match its ABI ("repository FreeBSD contains packages with wrong ABI"). Once NextBSD's ABI is NextBSD:27, an enabled FreeBSD repository would make every plain pkg update / pkg upgrade fail. pkg 2.8 still uses a disabled repository when it's named with -r.
  • NextBSD doesn't ship FreeBSD's package signing key: it removes /usr/share/keys/pkg/trusted/pkg.freebsd.org.2013102301 along with FreeBSD's pkg bootstrap. So the repository points at a copy of that fingerprint in /usr/local/etc/pkg/fingerprints/FreeBSD/trusted/ (same content as FreeBSD's releng/15.1 file). The revoked directory is optional for pkg.
  • Runs the install as env ABI=FreeBSD:15:<arch> OSVERSION=1501000 IGNORE_OSVERSION=yes pkg install -y -r FreeBSD …. The ABI is set only for this call; nothing goes into pkg.conf, so NextBSD's pkg keeps its own ABI for NextBSD's packages. OSVERSION only stops pkg's "Setting ABI requires setting OSVERSION, guessing…" message.

The pkg info check is local and unchanged. Other systems are unchanged.

Notes

  • This works before and after NextBSD's switch: today NextBSD's own ABI is still FreeBSD:15:<arch>, so the env matches what pkg would pick anyway.
  • The file is rewritten on each run that installs something. On a NextBSD system that already has the old unsigned, enabled FreeBSD.conf from the image, it gets replaced by this one.
  • Merge order: gershwin-desktop#108 should go in first or together with this PR. gershwin-desktop's NextBSD ISO installs pkglist.txt after bootstrap.sh, and without #108 it would hit the now-disabled repository. #108 works with both the old and the new bootstrap.sh.
  • Not run on NextBSD yet. gershwin-developer CI doesn't build NextBSD; gershwin-desktop's dev-nextbsd build (which uses this repo's dev) is the test.

🤖 Generated with Claude Code

pkgdemon and others added 2 commits October 31, 2026 17:21
NextBSD is dropping its FreeBSD repository configuration
(nextbsd/nextbsd-kernel#376): the image no longer ships
/usr/local/etc/pkg/repos/FreeBSD.conf, and NextBSD's own packages move
to the ABI NextBSD:27:<arch>. The packages in nextbsd.txt come from
FreeBSD, so bootstrap.sh would find no repository that has them.

On NextBSD, bootstrap.sh now writes its own
/usr/local/etc/pkg/repos/FreeBSD.conf (pkg.FreeBSD.org
FreeBSD:15:<arch>/latest, signed) before installing, and runs that pkg
install with ABI=FreeBSD:15:<arch> (aarch64 on arm64),
OSVERSION=1501000 and IGNORE_OSVERSION=yes in its environment, limited
to that repository. Nothing is pinned in pkg.conf, so NextBSD's own pkg
keeps its native ABI.

NextBSD does not ship FreeBSD's package signing key in
/usr/share/keys/pkg, so the repository uses a copy of FreeBSD's
fingerprint in /usr/local/etc/pkg/fingerprints/FreeBSD/trusted.

Other systems are unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
pkg rejects a whole repository whose packages don't match its ABI
("repository FreeBSD contains packages with wrong ABI"). Once NextBSD's
own ABI is NextBSD:27:<arch>, an enabled FreeBSD repository would make
every plain pkg update and pkg upgrade fail. Write it with enabled: no;
bootstrap.sh names it with -r, which pkg 2.8 honours for a disabled
repository.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant