Add a -k flag to sysupgrade to keep the files in /home/_sysupgrade,
since they will be deleted after the upgrade by default.
Florian already added the installer part yesterday.

OK?

Index: sysupgrade.8
===================================================================
RCS file: /cvs/src/usr.sbin/sysupgrade/sysupgrade.8,v
retrieving revision 1.7
diff -u -p -r1.7 sysupgrade.8
--- sysupgrade.8        6 May 2019 18:33:21 -0000       1.7
+++ sysupgrade.8        9 May 2019 17:54:35 -0000
@@ -22,7 +22,7 @@
 .Nd upgrade system to the next release or a new snapshot
 .Sh SYNOPSIS
 .Nm
-.Op Fl fn
+.Op Fl fkn
 .Op Fl r | s
 .Op Ar installurl
 .Sh DESCRIPTION
@@ -52,6 +52,10 @@ The options are as follows:
 Force an already applied upgrade.
 The default is to upgrade to latest snapshot only if available.
 This option has no effect on releases.
+.It Fl k
+Keep the files in
+.Pa /home/_sysupgrade .
+By default they will be deleted after the upgrade.
 .It Fl n
 Fetch and verify the files and create
 .Pa /bsd.upgrade
Index: sysupgrade.sh
===================================================================
RCS file: /cvs/src/usr.sbin/sysupgrade/sysupgrade.sh,v
retrieving revision 1.16
diff -u -p -r1.16 sysupgrade.sh
--- sysupgrade.sh       8 May 2019 15:06:20 -0000       1.16
+++ sysupgrade.sh       9 May 2019 17:54:35 -0000
@@ -33,7 +33,7 @@ ug_err()
 
 usage()
 {
-       ug_err "usage: ${0##*/} [-fn] [-r | -s] [installurl]"
+       ug_err "usage: ${0##*/} [-fkn] [-r | -s] [installurl]"
 }
 
 unpriv()
@@ -72,11 +72,13 @@ rmel() {
 RELEASE=false
 SNAP=false
 FORCE=false
+KEEP=false
 REBOOT=true
 
-while getopts fnrs arg; do
+while getopts fknrs arg; do
        case ${arg} in
        f)      FORCE=true;;
+       k)      KEEP=true;;
        n)      REBOOT=false;;
        r)      RELEASE=true;;
        s)      SNAP=true;;
@@ -174,6 +176,8 @@ done
 
 echo Verifying sets.
 [[ -n ${DL} ]] && unpriv cksum -qC SHA256 ${DL}
+
+${KEEP} && > keep
 
 cp bsd.rd /nbsd.upgrade
 ln -f /nbsd.upgrade /bsd.upgrade
-- 
Christian "naddy" Weisgerber                          na...@mips.inka.de

Reply via email to