From nobody Tue Nov 19 00:38:43 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Xslwh33zgz5dGnp; Tue, 19 Nov 2024 00:38:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Xslwh14FTz4jdb; Tue, 19 Nov 2024 00:38:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1731976724; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=pZrvPl8YaCI4AsKRJP2WbzRHauTPBIGPcBmwMuJQcdI=; b=nEP98sbVwsUhjhhlGCTYjoXcf2ngfiwAR9UwndME9qoeUHlC6Y2xW/kIsT71pw3nkLNE2N KFYYBSp/nlFbdOCMo1oOMw4YI6Zs13SGWEMrWMmmB8EoHUoG4HEzzLi24o5O87d0W5m9q9 FiA9rzDeBXYQsYgCOoskzWxY83QNMakiCO+rZksfNhc+G6+zT8rXfpxy+/Ds5S6B3WvFHj MBR87zcaDFcIu45VeJLoQz9KQ68tVBDfhHwqYu5G++bMRIZA82RiB7/+4gOg5A27jgEAEy B3A+OyzstJHI0g6hv63DsWe9GcpmbuwZzVnifEoTRtSkQwKUjRAlJoh9GGmdbQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1731976724; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=pZrvPl8YaCI4AsKRJP2WbzRHauTPBIGPcBmwMuJQcdI=; b=rM2UQyJvtKkpw7tbCVSsn3IZUzcC3Koc1V/GtCWmCgZZDQdOIoztRpxkIFhMbVCu+j/aJL pYaH20iu2LMjT60CmNacakCdgT5lg8xPAhIK0C/4sZl1CXhGM21uBTLBNIee0f66TVE4ds WWdBDqT9x2Od0wFHFaGIQpTRRg1VBWF9ajVRkOyAaCVKRu9XBAkJAn2zPJs9MACG/rc7zA nZYGuNzFa6Xm7AOeBwztmNQ/Qn5mcusP1+S8sDSDfT1SHo9WdiulCHpJK0tWUQm7NmMVg8 H3g/LbLL+uJX4WHeo3ThcGdEEgaegzAQOHPh0Zvtgxe6nhTmKFywFwlE3AXDcA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1731976724; a=rsa-sha256; cv=none; b=AN9xPaeFrd/ZSaT113oiSgcxOYtieN25dr4X+SXDFVh9ieCJk8+9mmHVHiCp8lX7rnsf9B lds0AlVTBHx59Xna2ex73tlCZ0aq9qsy4PiNwmTs391SDxdMtMfs5nbse4ubUeiXsYYb4A kK7OLN+MuP6mhx4pol+45xi8s1JWn2kFva0fCxW6pVetD5Ze0IsseU7ptpvES3qZU4wKas Bjk9SpCa9xDPxmsUW9hXvY2k4S6qzeVP35vO2vhMinIpHCrvrMhbmsUlj4Qo2jCxHTeQFu oaCMgiQN/mBgPTL3QCRKSe8W4FKGPl9KrkubuuzBfkkdRx3+r+tuecP0BC5vdg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Xslwg75p9z132c; Tue, 19 Nov 2024 00:38:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4AJ0chce083993; Tue, 19 Nov 2024 00:38:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4AJ0chxq083990; Tue, 19 Nov 2024 00:38:43 GMT (envelope-from git) Date: Tue, 19 Nov 2024 00:38:43 GMT Message-Id: <202411190038.4AJ0chxq083990@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: dc647e4df990 - releng/14.2 - fwget: add -q for quiet output List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/releng/14.2 X-Git-Reftype: branch X-Git-Commit: dc647e4df9900eae1611803ba481d9cc355fc5e3 Auto-Submitted: auto-generated The branch releng/14.2 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=dc647e4df9900eae1611803ba481d9cc355fc5e3 commit dc647e4df9900eae1611803ba481d9cc355fc5e3 Author: Bjoern A. Zeeb AuthorDate: 2024-11-04 23:59:58 +0000 Commit: Bjoern A. Zeeb CommitDate: 2024-11-19 00:36:49 +0000 fwget: add -q for quiet output Introduce -q to quieten other output (unless -v is also given). pkg-install(8) currently has no option to allow skipping unavail packages but it will just fail. We would realy want to try to install as much firmware found as possible from the installer. Work around this by doing one firmware package at a time. For that it is highly helpful to be able to query (or possibly re-query) all outstanding fimrware packages. -q together with -n only shows each package to be installed one by line. Once https://github.com/freebsd/pkg/issues/2195 will be implemented we could undo this part of the change and future changes to the installer and use the new option for pkg-install(8) there. While here switch to getopts so -qn works and not just -q -n. Sponsored by: The FreeBSD Foundation Reviewed by: manu Approved by: re (cperciva) Differential Revision: https://reviews.freebsd.org/D47445 (cherry picked from commit 1eb3f15c149b9a2e5b6f5e10aed454fc85945bbd) (cherry picked from commit 814a49d65ace83b7a955cca32ff243f4abe7cd50) --- usr.sbin/fwget/fwget.sh | 48 +++++++++++++++++++++++++++++++++--------------- 1 file changed, 33 insertions(+), 15 deletions(-) diff --git a/usr.sbin/fwget/fwget.sh b/usr.sbin/fwget/fwget.sh old mode 100644 new mode 100755 index 154fb7dc92e1..3e2181e53b73 --- a/usr.sbin/fwget/fwget.sh +++ b/usr.sbin/fwget/fwget.sh @@ -38,7 +38,8 @@ Supported subsystems pci Options: - -n -- Do not install package, only print the results + -n -- Do not install packages, only print the results + -q -- Quiet mode. If used with -n only prints a package a line -v -- More verbose EOF exit 1 @@ -75,22 +76,27 @@ addpkg() } DRY_RUN=n +QUIET=n VERBOSE=n -while [ $# -gt 0 ]; do - case $1 in - -n) - DRY_RUN=y - ;; - -v) - VERBOSE=y - ;; - *) - subsystems="${subsystems} $1" - ;; +while getopts ":nqv" _arg; do + case ${_arg} in + n) + DRY_RUN=y + ;; + q) + QUIET=y + ;; + v) + VERBOSE=y + ;; + ?) + usage + ;; esac - shift done +shift $(($OPTIND - 1)) +subsystems="$@" # Default searching PCI subsystem if [ -z "${subsystems}" ]; then @@ -112,13 +118,25 @@ done case "${packages}" in ""|^[[:space:]]*$) - echo "No firmware packages to install." + if [ "${QUIET}" != "y" ]; then + echo "No firmware packages to install." + fi exit 0 ;; esac -echo "Needed firmware packages: '${packages}'" +if [ "${QUIET}" != "y" ]; then + echo "Needed firmware packages: '${packages}'" +fi if [ "${DRY_RUN}" = "y" ]; then + if [ "${QUIET}" = "y" ]; then + for pkg in ${packages}; do + case "${pkg}" in + ""|^[[:space:]]*$) continue ;; + esac + echo "${pkg}" + done + fi exit 0 fi