git: a96230e0329b - main - bsdinstall: Enable FreeBSD-base repo when pkgbase

From: Colin Percival <cperciva_at_FreeBSD.org>
Date: Sat, 15 Nov 2025 22:06:09 UTC
The branch main has been updated by cperciva:

URL: https://cgit.FreeBSD.org/src/commit/?id=a96230e0329b32cbee0999813787a86eab521da4

commit a96230e0329b32cbee0999813787a86eab521da4
Author:     Colin Percival <cperciva@FreeBSD.org>
AuthorDate: 2025-11-15 21:56:35 +0000
Commit:     Colin Percival <cperciva@FreeBSD.org>
CommitDate: 2025-11-15 22:05:50 +0000

    bsdinstall: Enable FreeBSD-base repo when pkgbase
    
    When performing a pkgbase install, create a configuration file in
    /usr/local/etc/pkg/repos/FreeBSD.conf which enables the FreeBSD-base
    repository.  (This repository is defined in /etc/pkg/FreeBSD.conf as
    being disabled by default.)
    
    Reported by:    Mark Millard
    Reviewed by:    markj
    MFC after:      immediately (needed for 15.0-RC1)
    Differential Revision:  https://reviews.freebsd.org/D53777
---
 usr.sbin/bsdinstall/scripts/pkgbase.in | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/usr.sbin/bsdinstall/scripts/pkgbase.in b/usr.sbin/bsdinstall/scripts/pkgbase.in
index ddbf8eaf4f86..89ddc244171e 100755
--- a/usr.sbin/bsdinstall/scripts/pkgbase.in
+++ b/usr.sbin/bsdinstall/scripts/pkgbase.in
@@ -355,6 +355,10 @@ local function pkgbase()
 	if not os.execute(pkg .. "install -U -y -r FreeBSD-base " .. packages) then
 		os.exit(1)
 	end
+
+	-- Enable the FreeBSD-base repository for this system.
+	assert(os.execute("mkdir -p " .. chroot .. "/usr/local/etc/pkg/repos"))
+	assert(os.execute("echo 'FreeBSD-base: { enabled: yes }' > " .. chroot .. "/usr/local/etc/pkg/repos/FreeBSD.conf"))
 end
 
 pkgbase()