When the system first boots, install the pkg(8) tools (if not already
installed) and packages listed in the $firstboot_pkgs_list rc.conf
variable. If the installed packages added new rc.d scripts, request
a reboot.
Obviously, this port is not useful after a system is already running; it is
intended to be included as part of the installation or disk image building
process.
sysutils/firstboot-pkgs: Refactor examples
Some of the examples in the rc script points to older versions of ports
which are no longer in the tree. There is no change in the
dunctionality of the ports. This is just a cosmetic change.
Approved by: cperciva (slack)
sysutils/firstboot-pkgs: Bootstrap and update pkg unconditionally
The background of this patch is available at:
https://lists.freebsd.org/pipermail/freebsd-cloud/2020-April/000234.html
Even a `pkg -N` success, the following `pkg install` may still fail because of
the repository version doesn't match between client and server.
Therefore, unconditionally bootstrap and update pkg at firstboot to ensure pkg
and local metadata are update-to-date.
Approved by: cperciva (maintainer)
MFH: 2020Q2
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D24517
sysutils/firstboot-pkgs: Loop through the list installing one at a time to
handle missing pkgs in the repo.
Reviewed by: allanjude
Approved by: cperciva, bdrewery (implicit)
Nominate myself for the useful-use-of-cat award.
pkg detects if its stdout is a terminal and prints many 'done%' lines,
which are useful for interactive use on modern terminals, but not so
useful on a serial console; piping through cat silences these.
pkg uses "is stdin a terminal?" to decide if it's running interactively
and thereby whether it should display a progress bar during downloads.
While rc.d scripts have a terminal attached, for the common case of
unattended installation of servers, this script is not being used
interactively; so redirect stdin from /dev/null to silence the progress
bars and reduce console spew.
The -q option could be used to accomplish this, but that would also
eliminate other more useful information, such as the names and versions
of packages being installed.
Fix dumb typo: Need to check if the number of rc.d scripts has changed
between pre-package-installation and post-package-installation, not
between pre- and pre-.
To prevent fallout of lowering __FreeBSD_version in releng/10.0 branch,
adjust OSVERSION evaluation in ports that specifically use '100050N'.
Approved by: affected maintainers (implicit)
Sponsored by: The FreeBSD Foundation
Add firstboot-pkgs:
When the system first boots, install the pkg(8) tools (if not already
installed) and packages listed in the $firstboot_pkgs_list rc.conf
variable.
Obviously, this port is not useful after a system is already running; it is
intended to be included as part of the installation or disk image building
process.