Following is patch to add a flag to upgrade packages during
rc.firsttime after a sysupgrade.

--Aaron


Index: sysupgrade.8
===================================================================
RCS file: /cvs/src/usr.sbin/sysupgrade/sysupgrade.8,v
retrieving revision 1.10
diff -u -p -u -r1.10 sysupgrade.8
--- sysupgrade.8        3 Oct 2019 12:43:58 -0000       1.10
+++ sysupgrade.8        27 Aug 2021 19:33:11 -0000
@@ -66,6 +66,11 @@ This is the default if the system is cur
 .It Fl s
 Upgrade to a snapshot.
 This is the default if the system is currently running a snapshot.
+.It Fl u
+Upgrade packages.
+Upgrade installed packages when
+.Xr rc.firsttime 8
+is run.
 .El
 .Sh FILES
 .Bl -tag -width "/auto_upgrade.conf" -compact
@@ -84,6 +89,7 @@ Directory the upgrade is downloaded to.
 .Xr installurl 5 ,
 .Xr autoinstall 8 ,
 .Xr release 8
+.Xr rc.firsttime 8
 .Sh HISTORY
 .Nm
 first appeared in
Index: sysupgrade.sh
===================================================================
RCS file: /cvs/src/usr.sbin/sysupgrade/sysupgrade.sh,v
retrieving revision 1.44
diff -u -p -u -r1.44 sysupgrade.sh
--- sysupgrade.sh       22 Oct 2020 07:19:42 -0000      1.44
+++ sysupgrade.sh       27 Aug 2021 19:29:01 -0000
@@ -77,14 +77,16 @@ SNAP=false
 FORCE=false
 KEEP=false
 REBOOT=true
+PKGS=false
 
-while getopts fknrs arg; do
+while getopts fknrsu arg; do
        case ${arg} in
        f)      FORCE=true;;
        k)      KEEP=true;;
        n)      REBOOT=false;;
        r)      RELEASE=true;;
        s)      SNAP=true;;
+       u)      PKGS=true;;
        *)      usage;;
        esac
 done
@@ -193,6 +195,7 @@ if ! ${KEEP}; then
        cat <<__EOT > /etc/rc.firsttime
 rm -f ${SETSDIR}/{${CLEAN}}
 __EOT
+       ${PKGS} && echo "pkg_add -Iu" >> /etc/rc.firsttime
 fi
 
 echo Fetching updated firmware.

Reply via email to