Created attachment 264737 [details] simple add pkgbase Simple install script not work now after add pkgbase bsdinstall script /tmp/installerconfig # installerconfig export nonInteractive="YES" HOSTNAME="freebsd" BSDINSTALL_PKG_REPOS_DIR="/usr/freebsd-packages/repos/" DISTRIBUTIONS="" DISKSLICE=vtbd0 PARTITIONS="$DISKSLICE GPT { auto freebsd-ufs / }" #!/bin/sh -x Patch base fixed, but not full non interactive. Need OK in Select System Components
This is a good start, but I think there are at least two problems, and maybe four: * Testing BSDINSTALL_PKG_REPOS_DIR should use "-n": if [ -n "$..." ] * "bsdinstall pkgbase" and "bsdinstall distextract" should be mutually exclusive. If the script does the former, then it must skip "bsdinstall checksum" and "bsdinstall pkgbase" * changing the default value of DISTRIBUTIONS may break existing scripts. Best to leave it the same. * "bsdinstall pkgbase" already does something sensible if BSDINSTALL_PKG_REPOS_DIR is unset. So I don't think that you should require the user to set it. Rather, to select a pkgbase install, I think you should either require the user to set DISTRIBUTIONS="", or else introduce a new variable.
Hey @asomers! Please tag me if you have a public revision. There is a GSoC project to "Reimagine NanoBSD", one of the goals is to use pre-compiled binaries. The user-facing interface we have decided to adopt is the one from bsdinstall (script) for distribution sets and eyeballed the pkgbase one. I would like to align our implementation with yours (whenever possible).
Here is my plan: * make pkgbase be the default going forward. Anybody wishing to install with legacy distsets must set PKGBASE="no" in their installerconfig file. usr.sbin/bsdinstall/scripts/script will check for that variable, and if set, call "bsdinstall pkgbase --non-interactive" * Add a "--non-interactive" option to usr.sbin/bsdinstall/scripts/pkgbase.in . When set, pkgbase.in will not call bsddialog for user input. Instead, it will select components based on the DISTRIBUTIONS environment variable. I plan to implement this in time for 15.1-RELEASE .
This will probably be fixed soon - but if You need solution right now then verimg(8) does that You need - installs PKGBASE FreeBSD w/o any user input ... and is fully customizable both by options and code in the script itself. - https://github.com/vermaden/verimg Regards, vermaden
(In reply to Alan Somers from comment #3) Right, so you plan to map, for example: DISTRIBUTIONS="base.txz kernel.txz" to FreeBSD-set-base and FreeBSD-set-kernels; a one to one, so to speak? No fancy -minimal or a particular FreeBSD-kernel? At the moment, we have opted to at least require FreeBSD-set-base or FreeBSD-set-minimal (as the MANDATORY base options) and if a kernel is required (non-jail), some form of FreeBSD-kernel-* (PowerPC kernel names are fun!). Although, we have decided to use a different variable name (this is the information I'm looking to align with your implementation, thank you for the input). (In reply to Slawomir Wojciech Wojtczak from comment #4) Thank you, we'll take a look at this implementation as well.
(In reply to Alan Somers from comment #1 and #3) (In reply to Jose Luis Duran from comment #5) A question here is if the support is only for 15.0+ (not, say, 14.*). For example, 14.* does not have FreeBSD-set-base or FreeBSD-set-kernels to use. Only 15.* and later have the Release & Security Engineering class of support for pkgbase contexts as I understand. 14.*'s draft/unsupported status for pkgbase relative to Release Engineering lead to 14.* not being updated to match what was done with 15.0 . In various places base packages are split up differently. (This is also visible in standard/official poudriere-devel not putting any FreeBSD-set-* to use --and over installing in order to be operational for both 14.* and 15.0+ without tracking all the details of the differences: there are hundreds of base packages for either.)
(In reply to Jose Luis Duran from comment #5) > DISTRIBUTIONS="base.txz kernel.txz" to FreeBSD-set-base and FreeBSD-set-kernels; a one to one, so to speak? No fancy -minimal or a particular FreeBSD-kernel? Yes. I'm planning to mimic the interactive code as closely as possible. So minimal or minimal-jail will always be installed, for example. But if you have a better suggesting for how to specify packages in the installerconfig, I'm all ears. (In reply to Mark Millard from comment #6) I don't plan to MFC this to stable/14 at all.
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=dc14ae4217a0babb1240f813b642edc2d7b955a6 commit dc14ae4217a0babb1240f813b642edc2d7b955a6 Author: Alan Somers <asomers@FreeBSD.org> AuthorDate: 2026-04-28 17:27:17 +0000 Commit: Alan Somers <asomers@FreeBSD.org> CommitDate: 2026-05-12 14:13:16 +0000 bsdinstall: do pkgbase installations with the "script" command "bsdinstall script" will now do a pkgbase installation by default. The system components to install can be specified in the COMPONENTS variable, and have the same names as those used in the interactive installer. bsdinstall will still do a legacy distset installation if DISTRIBUTIONS is defined in the installerconfig file. MFC: 1 week PR: 290375 Sponsored by: ConnectWise Reviewed by: ziaee, ivy, jduran Differential Revision: https://reviews.freebsd.org/D56717 UPDATING | 5 +++ usr.sbin/bsdinstall/bsdinstall.8 | 45 ++++++++++++++++----- usr.sbin/bsdinstall/scripts/pkgbase.in | 15 ++++++- usr.sbin/bsdinstall/scripts/script | 71 ++++++++++++++++++++-------------- 4 files changed, 95 insertions(+), 41 deletions(-)
Committed to head. This should be MFCed to stable/15 and releng/15.1 . But it's not needed in stable/14, because pkgbase is still experimental in 14.
A commit in branch stable/15 references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=1f5869130f6ebd299e65a627eff23a8c3d360afb commit 1f5869130f6ebd299e65a627eff23a8c3d360afb Author: Alan Somers <asomers@FreeBSD.org> AuthorDate: 2026-04-28 17:27:17 +0000 Commit: Alan Somers <asomers@FreeBSD.org> CommitDate: 2026-05-13 19:27:34 +0000 bsdinstall: do pkgbase installations with the "script" command "bsdinstall script" will now do a pkgbase installation by default. The system components to install can be specified in the COMPONENTS variable, and have the same names as those used in the interactive installer. bsdinstall will still do a legacy distset installation if DISTRIBUTIONS is defined in the installerconfig file. PR: 290375 Sponsored by: ConnectWise Reviewed by: ziaee, ivy, jduran Differential Revision: https://reviews.freebsd.org/D56717 (cherry picked from commit dc14ae4217a0babb1240f813b642edc2d7b955a6) UPDATING | 5 +++ usr.sbin/bsdinstall/bsdinstall.8 | 45 ++++++++++++++++----- usr.sbin/bsdinstall/scripts/pkgbase.in | 15 ++++++- usr.sbin/bsdinstall/scripts/script | 71 ++++++++++++++++++++-------------- 4 files changed, 95 insertions(+), 41 deletions(-)
A commit in branch releng/15.1 references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=cb7880bb09009c977d3fb70a66b0f57f9fbe83ed commit cb7880bb09009c977d3fb70a66b0f57f9fbe83ed Author: Alan Somers <asomers@FreeBSD.org> AuthorDate: 2026-04-28 17:27:17 +0000 Commit: Colin Percival <cperciva@FreeBSD.org> CommitDate: 2026-05-14 19:04:21 +0000 bsdinstall: do pkgbase installations with the "script" command "bsdinstall script" will now do a pkgbase installation by default. The system components to install can be specified in the COMPONENTS variable, and have the same names as those used in the interactive installer. bsdinstall will still do a legacy distset installation if DISTRIBUTIONS is defined in the installerconfig file. Approved by: re (cperciva) PR: 290375 Sponsored by: ConnectWise Reviewed by: ziaee, ivy, jduran Differential Revision: https://reviews.freebsd.org/D56717 (cherry picked from commit dc14ae4217a0babb1240f813b642edc2d7b955a6) (cherry picked from commit 1f5869130f6ebd299e65a627eff23a8c3d360afb) UPDATING | 5 +++ usr.sbin/bsdinstall/bsdinstall.8 | 45 ++++++++++++++++----- usr.sbin/bsdinstall/scripts/pkgbase.in | 15 ++++++- usr.sbin/bsdinstall/scripts/script | 71 ++++++++++++++++++++-------------- 4 files changed, 95 insertions(+), 41 deletions(-)
^Triage: appears to have been committed and MFCed.