From: mglocker Date: Wed, 8 Jun 2022 09:03:11 +0000 (+0000) Subject: Add a new option which allows to set an alternative base-directory to X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=fa02c594c67822c41fca99b4fc0f2f316bb15999;p=openbsd Add a new option which allows to set an alternative base-directory to download the installation files to. This is helpful if the default base-directory /home isn't available for writing, i.e. when using auto mounted home directories. Discussed with and input received from florian@, jmc@, sthen@, schwarze@, and ajacoutot@. OK florian@, jmc@, sthen@ --- diff --git a/usr.sbin/sysupgrade/sysupgrade.8 b/usr.sbin/sysupgrade/sysupgrade.8 index 444c74aa64b..2dad07706b4 100644 --- a/usr.sbin/sysupgrade/sysupgrade.8 +++ b/usr.sbin/sysupgrade/sysupgrade.8 @@ -1,4 +1,4 @@ -.\" $OpenBSD: sysupgrade.8,v 1.12 2021/11/08 16:12:10 kn Exp $ +.\" $OpenBSD: sysupgrade.8,v 1.13 2022/06/08 09:03:11 mglocker Exp $ .\" .\" Copyright (c) 2019 Florian Obser .\" @@ -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: November 8 2021 $ +.Dd $Mdocdate: June 8 2022 $ .Dt SYSUPGRADE 8 .Os .Sh NAME @@ -24,6 +24,7 @@ .Nm .Op Fl fkn .Op Fl r | s +.Op Fl b Ar base-directory .Op Ar installurl .Sh DESCRIPTION .Nm @@ -48,6 +49,11 @@ triggering a one-shot upgrade using the files in .Pp The options are as follows: .Bl -tag -width Ds +.It Fl b Ar base-directory +Download files to +.Ar base-directory Ns / Ns Pa _sysupgrade +instead of +.Pa /home/_sysupgrade . .It Fl f Force an already applied upgrade. The default is to upgrade to latest snapshot only if available. diff --git a/usr.sbin/sysupgrade/sysupgrade.sh b/usr.sbin/sysupgrade/sysupgrade.sh index 6386081b492..d80ff127ffa 100644 --- a/usr.sbin/sysupgrade/sysupgrade.sh +++ b/usr.sbin/sysupgrade/sysupgrade.sh @@ -1,6 +1,6 @@ #!/bin/ksh # -# $OpenBSD: sysupgrade.sh,v 1.47 2022/06/02 07:44:18 florian Exp $ +# $OpenBSD: sysupgrade.sh,v 1.48 2022/06/08 09:03:11 mglocker Exp $ # # Copyright (c) 1997-2015 Todd Miller, Theo de Raadt, Ken Westerback # Copyright (c) 2015 Robert Peichaer @@ -35,7 +35,7 @@ err() usage() { - echo "usage: ${0##*/} [-fkn] [-r | -s] [installurl]" 1>&2 + echo "usage: ${0##*/} [-fkn] [-r | -s] [-b base-directory] [installurl]" 1>&2 return 1 } @@ -78,8 +78,9 @@ FORCE=false KEEP=false REBOOT=true -while getopts fknrs arg; do +while getopts b:fknrs arg; do case ${arg} in + b) SETSDIR=${OPTARG}/_sysupgrade;; f) FORCE=true;; k) KEEP=true;; n) REBOOT=false;;