Based on conversations in another thread, here's a patch documenting
use of /upgrade.site in the sysupgrade(8) man page.

The revised doc references /upgrade.site and includes examples for
updating packages from Sebastien Marie.

--Aaron

Index: sysupgrade.8
===================================================================
RCS file: /cvs/src/usr.sbin/sysupgrade/sysupgrade.8,v
retrieving revision 1.10
diff -u -p -r1.10 sysupgrade.8
--- sysupgrade.8        3 Oct 2019 12:43:58 -0000       1.10
+++ sysupgrade.8        28 Aug 2021 15:22:42 -0000
@@ -46,6 +46,11 @@ The bootloader will automatically choose
 triggering a one-shot upgrade using the files in
 .Pa /home/_sysupgrade .
 .Pp
+If
+.Pa /upgrade.site
+exists and is executable, it is executed at the end of the upgrade
+process, prior to rebooting.
+.Pp
 The options are as follows:
 .Bl -tag -width Ds
 .It Fl f
@@ -73,16 +78,48 @@ This is the default if the system is cur
 Response file for the ramdisk kernel.
 .It Pa /bsd.upgrade
 The ramdisk kernel to trigger an unattended upgrade.
+.It Pa /update.site
+Executable file of actions to run after upgrade.
 .It Pa /etc/installurl
 .Ox
 mirror top-level URL for fetching an upgrade.
 .It Pa /home/_sysupgrade
 Directory the upgrade is downloaded to.
 .El
+.Sh EXAMPLES
+.Pa /upgrade.site
+script to upgrade packages when
+.Pa /etc/rc.firsttime
+runs:
+.Bd -literal
+       #!/bin/sh
+       PATH=/sbin:/bin:/usr/sbin:/usr/bin
+
+       # upgrade packages
+       echo 'pkg_add -Iu' >>/etc/rc.firsttime
+
+       # other commands
+
+       exit 0
+       #
+.Ed
+.Pp
+.Pa /upgrade.site
+addition to also run
+.Xr sysclean 8
+if installed:
+.Bd -literal
+       # other commands
+       # run sysclean (if installed)
+       echo '[ -x /usr/local/sbin/sysclean ] && \\
+       /usr/local/sbin/sysclean | mail -Es sysclean \\
+       root &' >>/etc/rc.firsttime
+.Ed
 .Sh SEE ALSO
 .Xr signify 1 ,
 .Xr installurl 5 ,
 .Xr autoinstall 8 ,
+.Xr rc 8 ,
 .Xr release 8
 .Sh HISTORY
 .Nm

Reply via email to