diff options
author | Christian Weisgerber <naddy@cvs.openbsd.org> | 2019-05-09 21:09:38 +0000 |
---|---|---|
committer | Christian Weisgerber <naddy@cvs.openbsd.org> | 2019-05-09 21:09:38 +0000 |
commit | 9805e9c49f61cbb5b10aa1f1c9e009bcdf6baec2 (patch) | |
tree | 681b98867d192ab1b569ce526b0c4b337c4be93c /usr.sbin | |
parent | a091fb9cdaa7179cf47989a70cdfe9c32475de80 (diff) |
Add a -k flag to keep the files in /home/_sysupgrade, since they
will be deleted after the upgrade by default. ok kn@
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/sysupgrade/sysupgrade.8 | 10 | ||||
-rw-r--r-- | usr.sbin/sysupgrade/sysupgrade.sh | 10 |
2 files changed, 14 insertions, 6 deletions
diff --git a/usr.sbin/sysupgrade/sysupgrade.8 b/usr.sbin/sysupgrade/sysupgrade.8 index a77358e2f1c..ba34190d979 100644 --- a/usr.sbin/sysupgrade/sysupgrade.8 +++ b/usr.sbin/sysupgrade/sysupgrade.8 @@ -1,4 +1,4 @@ -.\" $OpenBSD: sysupgrade.8,v 1.7 2019/05/06 18:33:21 otto Exp $ +.\" $OpenBSD: sysupgrade.8,v 1.8 2019/05/09 21:09:37 naddy Exp $ .\" .\" Copyright (c) 2019 Florian Obser <florian@openbsd.org> .\" @@ -14,7 +14,7 @@ .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd $Mdocdate: May 6 2019 $ +.Dd $Mdocdate: May 9 2019 $ .Dt SYSUPGRADE 8 .Os .Sh NAME @@ -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 diff --git a/usr.sbin/sysupgrade/sysupgrade.sh b/usr.sbin/sysupgrade/sysupgrade.sh index c63360d25a4..f4592a7dc15 100644 --- a/usr.sbin/sysupgrade/sysupgrade.sh +++ b/usr.sbin/sysupgrade/sysupgrade.sh @@ -1,6 +1,6 @@ #!/bin/ksh # -# $OpenBSD: sysupgrade.sh,v 1.17 2019/05/09 21:06:09 naddy Exp $ +# $OpenBSD: sysupgrade.sh,v 1.18 2019/05/09 21:09:37 naddy Exp $ # # Copyright (c) 1997-2015 Todd Miller, Theo de Raadt, Ken Westerback # Copyright (c) 2015 Robert Peichaer <rpe@openbsd.org> @@ -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;; @@ -175,6 +177,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 rm /nbsd.upgrade |