summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/sysupgrade/sysupgrade.810
-rw-r--r--usr.sbin/sysupgrade/sysupgrade.sh14
2 files changed, 18 insertions, 6 deletions
diff --git a/usr.sbin/sysupgrade/sysupgrade.8 b/usr.sbin/sysupgrade/sysupgrade.8
index 27d3d3143c3..7104a269c54 100644
--- a/usr.sbin/sysupgrade/sysupgrade.8
+++ b/usr.sbin/sysupgrade/sysupgrade.8
@@ -1,4 +1,4 @@
-.\" $OpenBSD: sysupgrade.8,v 1.3 2019/05/03 13:04:40 florian Exp $
+.\" $OpenBSD: sysupgrade.8,v 1.4 2019/05/03 14:44:19 ian Exp $
.\"
.\" Copyright (c) 2019 Florian Obser <florian@openbsd.org>
.\"
@@ -24,6 +24,7 @@
.Nm
.Op Fl c
.Op Fl f
+.Op Fl n
.Op Ar installurl
.Sh DESCRIPTION
.Nm
@@ -40,7 +41,8 @@ and copies bsd.rd to
.Pa /bsd.upgrade .
.Pp
.Nm
-then reboots the system and the bootloader will automatically choose
+by default then reboots the system.
+The bootloader will automatically choose
.Pa /bsd.upgrade ,
triggering a one-shot upgrade using the files in
.Pa /home/_sysupgrade .
@@ -57,6 +59,10 @@ downloads the next release.
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 n
+fetch and verify the files and create
+.Pa /bsd.upgrade
+but not do reboot.
.El
.Sh FILES
.Bl -tag -width "/home/_sysupgrade" -compact
diff --git a/usr.sbin/sysupgrade/sysupgrade.sh b/usr.sbin/sysupgrade/sysupgrade.sh
index 7225b0d840f..490880d8980 100644
--- a/usr.sbin/sysupgrade/sysupgrade.sh
+++ b/usr.sbin/sysupgrade/sysupgrade.sh
@@ -1,6 +1,6 @@
#!/bin/ksh
#
-# $OpenBSD: sysupgrade.sh,v 1.9 2019/05/03 13:04:40 florian Exp $
+# $OpenBSD: sysupgrade.sh,v 1.10 2019/05/03 14:44:19 ian 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##*/} [-cf] [installurl]"
+ ug_err "usage: ${0##*/} [-cfn] [installurl]"
}
unpriv()
@@ -64,11 +64,13 @@ rmel() {
CURRENT=false
FORCE=false
+REBOOT=true
while getopts cf arg; do
case ${arg} in
c) CURRENT=true;;
f) FORCE=true;;
+ n) REBOOT=false;;
*) usage;;
esac
done
@@ -161,5 +163,9 @@ cp bsd.rd /nbsd.upgrade
ln -f /nbsd.upgrade /bsd.upgrade
rm /nbsd.upgrade
-echo Upgrading.
-exec reboot
+if ${REBOOT}; then
+ echo Upgrading.
+ exec reboot
+else
+ echo "Will upgrade on next reboot"
+fi