diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2024-10-25 03:42:07 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2024-10-25 03:42:07 +0000 |
commit | 0101a674c1e705f9050ebdcfa9cb0c0f6f0ccd84 (patch) | |
tree | 4a22d4f7452c8a13a814c3cac7316954ba3a17c0 | |
parent | 241b6b701c0435a31b2a941bcee6de2e696274a8 (diff) |
Add support for performing a sysupgrade from a path. This is convenient
for offline machines if you can pull the snapshot or release to there there,
but want sysupgrade to locally perform signify validation before performing
the /home/_sysupgrade and other boot-upgrade steps.
ok florian
-rw-r--r-- | usr.sbin/sysupgrade/sysupgrade.8 | 6 | ||||
-rw-r--r-- | usr.sbin/sysupgrade/sysupgrade.sh | 13 |
2 files changed, 13 insertions, 6 deletions
diff --git a/usr.sbin/sysupgrade/sysupgrade.8 b/usr.sbin/sysupgrade/sysupgrade.8 index 805432800c5..a3c3804d84d 100644 --- a/usr.sbin/sysupgrade/sysupgrade.8 +++ b/usr.sbin/sysupgrade/sysupgrade.8 @@ -1,4 +1,4 @@ -.\" $OpenBSD: sysupgrade.8,v 1.21 2024/10/11 14:12:05 deraadt Exp $ +.\" $OpenBSD: sysupgrade.8,v 1.22 2024/10/25 03:42:06 deraadt 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: October 11 2024 $ +.Dd $Mdocdate: October 25 2024 $ .Dt SYSUPGRADE 8 .Os .Sh NAME @@ -25,7 +25,7 @@ .Op Fl fkns .Op Fl b Ar base-directory .Op Fl R Ar version -.Op Ar installurl +.Op Ar installurl | path .Sh DESCRIPTION .Nm is a utility to upgrade diff --git a/usr.sbin/sysupgrade/sysupgrade.sh b/usr.sbin/sysupgrade/sysupgrade.sh index 9e5b304b31d..b01ccd3878d 100644 --- a/usr.sbin/sysupgrade/sysupgrade.sh +++ b/usr.sbin/sysupgrade/sysupgrade.sh @@ -1,6 +1,6 @@ #!/bin/ksh # -# $OpenBSD: sysupgrade.sh,v 1.56 2024/10/11 14:12:05 deraadt Exp $ +# $OpenBSD: sysupgrade.sh,v 1.57 2024/10/25 03:42:06 deraadt Exp $ # # Copyright (c) 1997-2015 Todd Miller, Theo de Raadt, Ken Westerback # Copyright (c) 2015 Robert Peichaer <rpe@openbsd.org> @@ -35,7 +35,7 @@ err() usage() { - echo "usage: ${0##*/} [-fkns] [-b base-directory] [-R version] [installurl]" 1>&2 + echo "usage: ${0##*/} [-fkns] [-b base-directory] [-R version] [installurl | path]" 1>&2 return 1 } @@ -73,6 +73,7 @@ rmel() { } SNAP=false +FILE=false FORCE=false FORCE_VERSION=false KEEP=false @@ -111,7 +112,7 @@ case $# in *) usage esac [[ $MIRROR == @(file|ftp|http|https)://* ]] || - err "invalid installurl: $MIRROR" + FILE=true $FORCE_VERSION && $SNAP && err "incompatible options: -s -R $NEXT_VERSION" $FORCE && ! $SNAP && @@ -125,6 +126,12 @@ else $FORCE_VERSION || ALT_URL=${MIRROR}/${VERSION}/${ARCH}/ fi +# Oh wait, this is a path install +if $FILE; then + URL=file://$MIRROR/ + ALT_URL= +fi + install -d -o 0 -g 0 -m 0755 ${SETSDIR} cd ${SETSDIR} |