summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorAndrew Fresh <afresh1@cvs.openbsd.org>2024-10-12 23:56:24 +0000
committerAndrew Fresh <afresh1@cvs.openbsd.org>2024-10-12 23:56:24 +0000
commitd28514c24d21c689aa9c170d1f9ecbe924aee310 (patch)
treede5ce0e84773685b6febf31cdfc3ad313223a1e4 /usr.sbin
parentde9e1481c9f058d5051ed4718f062ee580b9b953 (diff)
Make fw_update -a mean all
When downloading or installing, not just deleting. Noticed by Paul de Weerd Help with manual wording from jmc@ Just fix -a, deraadt@
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/fw_update/fw_update.813
-rw-r--r--usr.sbin/fw_update/fw_update.sh9
2 files changed, 12 insertions, 10 deletions
diff --git a/usr.sbin/fw_update/fw_update.8 b/usr.sbin/fw_update/fw_update.8
index 55a9573ea04..bbe17499401 100644
--- a/usr.sbin/fw_update/fw_update.8
+++ b/usr.sbin/fw_update/fw_update.8
@@ -1,4 +1,4 @@
-.\" $OpenBSD: fw_update.8,v 1.3 2022/03/09 22:39:12 jsg Exp $
+.\" $OpenBSD: fw_update.8,v 1.4 2024/10/12 23:56:23 afresh1 Exp $
.\"
.\" Copyright (c) 2011 Alexander Hall <alexander@beard.se>
.\"
@@ -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: March 9 2022 $
+.Dd $Mdocdate: October 12 2024 $
.Dt FW_UPDATE 8
.Os
.Sh NAME
@@ -31,11 +31,9 @@ The
utility installs, updates, or deletes firmware packages for
.Ar driver
from the Internet.
-If no
-.Ar driver
-is specified, the
+By default,
.Nm
-utility tries to determine which firmware is needed on the system.
+tries to determine which firmware packages are needed.
.Pp
Since firmware with an acceptable license is already present in
.Ox ,
@@ -51,9 +49,6 @@ Install or update firmware for all drivers.
It is an error to specify this option with any
.Ar driver
arguments.
-This is enabled by default unless drivers, files or
-.Fl d
-are specified.
.It Fl d
Delete firmware for
.Ar driver .
diff --git a/usr.sbin/fw_update/fw_update.sh b/usr.sbin/fw_update/fw_update.sh
index 912f86ad9b9..63a18f82fdc 100644
--- a/usr.sbin/fw_update/fw_update.sh
+++ b/usr.sbin/fw_update/fw_update.sh
@@ -1,5 +1,5 @@
#!/bin/ksh
-# $OpenBSD: fw_update.sh,v 1.56 2024/03/21 01:02:29 afresh1 Exp $
+# $OpenBSD: fw_update.sh,v 1.57 2024/10/12 23:56:23 afresh1 Exp $
#
# Copyright (c) 2021,2023 Andrew Hewus Fresh <afresh1@openbsd.org>
#
@@ -331,6 +331,11 @@ EOL
return 0
}
+available_firmware() {
+ check_cfile || return $?
+ sed -n 's/.*(\(.*\)-firmware.*/\1/p' "$CFILE"
+}
+
installed_firmware() {
local _pre="$1" _match="$2" _post="$3" _firmware _fw
set -sA _firmware -- $(
@@ -626,6 +631,8 @@ CFILE="$LOCALSRC/$CFILE"
if [ "${devices[*]:-}" ]; then
"$ALL" && warn "Cannot use -a and devices/files" && usage
+elif "$ALL"; then
+ set -sA devices -- $( available_firmware )
else
((VERBOSE > 1)) && echo -n "Detect firmware ..."
set -sA devices -- $( detect_firmware )