On Wed, Oct 27, 2021 at 07:35:28PM -0500, Aaron Poffenberger wrote:
> Looks good. Nice to see this moving forward. Thanks.
>
> On 2021-10-27 21:13 +0000, Klemens Nanni <[email protected]> wrote:
> > On Mon, Sep 06, 2021 at 02:29:50PM -0500, Aaron Poffenberger wrote:
> > > Ping.
> > >
> > > Will someone commit this? Seems like no one knows about /upgrade.site and
> > > it
> > > fits well with sysupgrade(8).
> >
> > sysupgrade(8) is one potential /upgrade.site user but I disagree about
> > documenting the latter through the former.
> >
> > Here is a new manual roughly merging the FAQ bits with what you, Aaron,
> > provided.
> >
> > site(8) is a lame but fitting name; autoinstall(8) and sysypgrade(8)
> > reference it and both sets and scripts are documented.
> >
> > Examples are intentionally brief to be shorter and more concise than the
> > FAQ while showing enough to get going.
> >
> >
> > I am quite certain that wording, examples and the references from other
> > manuals can be tweaked, but this diff looks like a good enough start
> > and --if this is the way to go-- I'd prefer to commit and keep polishing
> > in-tree.
> >
> > Feedback? Objections? OK?
I have not received any feedback on this except from Aaron.
Anyone? Anything?
Index: distrib/sets/lists/man/mi
===================================================================
RCS file: /cvs/src/distrib/sets/lists/man/mi,v
retrieving revision 1.1645
diff -u -p -r1.1645 mi
--- distrib/sets/lists/man/mi 2 Nov 2021 22:07:33 -0000 1.1645
+++ distrib/sets/lists/man/mi 3 Nov 2021 02:26:16 -0000
@@ -2561,6 +2561,7 @@
./usr/share/man/man8/security.8
./usr/share/man/man8/sendmail.8
./usr/share/man/man8/sensorsd.8
+./usr/share/man/man8/site.8
./usr/share/man/man8/sftp-server.8
./usr/share/man/man8/showmount.8
./usr/share/man/man8/shutdown.8
Index: usr.sbin/sysupgrade/sysupgrade.8
===================================================================
RCS file: /cvs/src/usr.sbin/sysupgrade/sysupgrade.8,v
retrieving revision 1.10
diff -u -p -r1.10 sysupgrade.8
--- usr.sbin/sysupgrade/sysupgrade.8 3 Oct 2019 12:43:58 -0000 1.10
+++ usr.sbin/sysupgrade/sysupgrade.8 27 Oct 2021 20:42:26 -0000
@@ -67,6 +67,10 @@ This is the default if the system is cur
Upgrade to a snapshot.
This is the default if the system is currently running a snapshot.
.El
+.Pp
+See
+.Xr site 8
+for how to customize the upgrade process.
.Sh FILES
.Bl -tag -width "/auto_upgrade.conf" -compact
.It Pa /auto_upgrade.conf
@@ -83,7 +87,8 @@ Directory the upgrade is downloaded to.
.Xr signify 1 ,
.Xr installurl 5 ,
.Xr autoinstall 8 ,
-.Xr release 8
+.Xr release 8 ,
+.Xr site 8
.Sh HISTORY
.Nm
first appeared in
Index: share/man/man8/Makefile
===================================================================
RCS file: /cvs/src/share/man/man8/Makefile,v
retrieving revision 1.102
diff -u -p -r1.102 Makefile
--- share/man/man8/Makefile 1 May 2021 16:11:10 -0000 1.102
+++ share/man/man8/Makefile 27 Oct 2021 20:38:11 -0000
@@ -6,7 +6,7 @@ MAN= afterboot.8 autoinstall.8 boot_conf
crash.8 daily.8 \
diskless.8 genassym.sh.8 intro.8 netstart.8 rc.8 \
rc.conf.8 rc.d.8 rc.shutdown.8 rc.subr.8 release.8 \
- security.8 ssl.8 starttls.8 sticky.8 yp.8
+ security.8 site.8 ssl.8 starttls.8 sticky.8 yp.8
SUBDIR= man8.alpha man8.amd64 man8.arm64 man8.armv7 \
man8.hppa man8.i386 man8.landisk \
Index: share/man/man8/autoinstall.8
===================================================================
RCS file: /cvs/src/share/man/man8/autoinstall.8,v
retrieving revision 1.23
diff -u -p -r1.23 autoinstall.8
--- share/man/man8/autoinstall.8 18 Jul 2021 11:08:34 -0000 1.23
+++ share/man/man8/autoinstall.8 27 Oct 2021 20:42:24 -0000
@@ -32,6 +32,10 @@ file and HTTP to fetch the file.
If that fails, the installer asks for the location which can either be
a URL or a local path.
.Pp
+See
+.Xr site 8
+for how to provide custom configuration.
+.Pp
To start unattended installation or upgrade choose '(A)utoinstall' at the
install prompt.
If there is only one network interface, the installer fetches the response
@@ -235,7 +239,8 @@ host foo {
.Sh SEE ALSO
.Xr dhcp-options 5 ,
.Xr dhcpd.conf 5 ,
-.Xr diskless 8
+.Xr diskless 8 ,
+.Xr site 8
.Sh HISTORY
The
.Nm
Index: share/man/man8/site.8
===================================================================
RCS file: share/man/man8/site.8
diff -N share/man/man8/site.8
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ share/man/man8/site.8 27 Oct 2021 21:11:48 -0000
@@ -0,0 +1,87 @@
+.\" $OpenBSD: $
+.\"
+.\" Copyright (c) 2021 Klemens Nanni <[email protected]>
+.\"
+.\" Permission to use, copy, modify, and distribute this software for any
+.\" purpose with or without fee is hereby granted, provided that the above
+.\" copyright notice and this permission notice appear in all copies.
+.\"
+.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+.\"
+.Dd $Mdocdate: October 27 2021 $
+.Dt SITE 8
+.Os
+.Sh NAME
+.Nm site
+.Nd OpenBSD installation and upgrade customization
+.Sh DESCRIPTION
+The
+.Ox
+installer allows user-created sets and scripts to complement
+and modify the files from a default install prior to rebooting.
+.Pp
+Like the official file sets, generic
+.Pa site${ Ns Va VERSION Ns }.tgz
+and
+hostname-specific
+.Pa site${ Ns Va VERSION Ns }-$( Ns Ic hostname Fl s Ns ).tgz
+sets are
+.Xr gzip 1
+compressed
+.Xr tar 1
+archives rooted in
+.Pa /
+and untarred with the
+.Fl xzphf
+options.
+.Pp
+.Nm sets
+must be included in
+.Pa index.txt
+in order to be fetched via
+HTTP(S) and selectable in the installer.
+.Pp
+If existent and executable,
+.Pa /install.site
+and
+.Pa /upgrade.site
+are run last during install and upgrade, respectively, with
+.Xr chroot 8
+based at the system's root.
+.Sh FILES
+.Bl -tag -width "site${VERSION}-$(hostname -s).tgz" -compact
+.It Pa site${ Ns Va VERSION Ns }.tgz
+Generic set.
+.It Pa site${ Ns Va VERSION Ns }-$( Ns Ic hostname Fl s Ns ).tgz
+Host-specific set.
+.It Pa /upgrade.site
+Generic post-upgrade script.
+.It Pa /install.site
+Generic post-install script.
+.El
+.Sh EXAMPLES
+Create
+.Nm
+sets and update the index:
+.Bd -literal -offset indent
+# tar -czhf site70.tgz generic/
+# tar -czhf site70-puffy.tgz puffy/
+# ls -lT > index.txt
+.Ed
+.Pp
+Trigger an upgrade of
+.Xr packages 7
+upon next boot:
+.Bd -literal -offset indent
+echo 'pkg_add -Iu' >>/etc/rc.firsttime
+.Ed
+.Sh SEE ALSO
+.Xr autoinstall 8 ,
+.Xr rc 8 ,
+.Xr sysupgrade 8