From c76da1f01064b2b9a1903b30d4b4c444b85f8724 Mon Sep 17 00:00:00 2001 From: Faraz Vahedi Date: Fri, 1 Oct 2021 13:48:57 -0500 Subject: [PATCH] freebsd-update(8): Add -j flag to support jails Make freebsd-update(8) support jails by adding the -j flag which takes a jail jid or name as an argument. This takes advantage of the recently added -j support to freebsd-version(8) in order to get the version of the installed userland. Reviewed by: dteske, kevans MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D25711 --- usr.sbin/freebsd-update/freebsd-update.8 | 11 ++++++++++- usr.sbin/freebsd-update/freebsd-update.sh | 20 +++++++++++++++++++- 2 files changed, 29 insertions(+), 2 deletions(-) diff --git a/usr.sbin/freebsd-update/freebsd-update.8 b/usr.sbin/freebsd-update/freebsd-update.8 index 54ec17b5ea36..be477d0cdce7 100644 --- a/usr.sbin/freebsd-update/freebsd-update.8 +++ b/usr.sbin/freebsd-update/freebsd-update.8 @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 14, 2020 +.Dd October 1, 2021 .Dt FREEBSD-UPDATE 8 .Os .Sh NAME @@ -37,6 +37,7 @@ .Op Fl d Ar workdir .Op Fl f Ar conffile .Op Fl F +.Op Fl j Ar jail .Op Fl k Ar KEY .Op Fl r Ar newrelease .Op Fl s Ar server @@ -90,6 +91,14 @@ Read configuration options from Force .Nm Cm fetch to proceed in the case of an unfinished upgrade. +.It Fl j Ar jail +Operate on the given jail specified by +.Va jid +or +.Va name . +(The version of the installed userland is detected and the +.Fl -currently-running +option is no more required.) .It Fl k Ar KEY Trust an RSA key with SHA256 of .Ar KEY . diff --git a/usr.sbin/freebsd-update/freebsd-update.sh b/usr.sbin/freebsd-update/freebsd-update.sh index 4fbac58cb562..1776115d0776 100644 --- a/usr.sbin/freebsd-update/freebsd-update.sh +++ b/usr.sbin/freebsd-update/freebsd-update.sh @@ -36,7 +36,7 @@ # --no-stats -- don't show progress statistics while fetching files usage () { cat <