From nobody Sun Feb 2 20:38:13 2025 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 4YmM0N69cJz5mwXh for ; Sun, 02 Feb 2025 20:38:28 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: from mail-wm1-f48.google.com (mail-wm1-f48.google.com [209.85.128.48]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YmM0M3Ylsz3dHn for ; Sun, 02 Feb 2025 20:38:27 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Authentication-Results: mx1.freebsd.org; dkim=none; spf=pass (mx1.freebsd.org: domain of jrtc27@jrtc27.com designates 209.85.128.48 as permitted sender) smtp.mailfrom=jrtc27@jrtc27.com; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=freebsd.org (policy=none) Received: by mail-wm1-f48.google.com with SMTP id 5b1f17b1804b1-43618283d48so27414335e9.1 for ; Sun, 02 Feb 2025 12:38:27 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1738528705; x=1739133505; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=4Xnmw6Nv8fi0Z0KJQYnRiFh7J19j5hBCN/foa7UDkJ4=; b=thnOwuZVifb/Us+tSQIIMWGLqv+r23JsIeiouVZrtAcDzKOgY/cTrLDvshJ1Ww5aPy SWF2ZXw4oSWy0dFYdEubfUoeEYMWrAvmZEaZxirMj5mAaBgVi8ewieQDZrDCBiz3zpqR SqqHkYlcEUFZnsH8KNUdmT3CNS8E85FQYYMQguz342rIt35f27dKoh5oJIm/3Qzz6HSW n+XmVhIX1Ev/mhGqoyY/f+QL4nxHeqfWF4OPmAH8gnlTyMN/3ht12DiC1Ri6f1EeaMgF DjSof4IfJSpP1/nh+5WFsHm4wSps9A5hcN+TdwlyVUZc3vKr16wHVSn1Rqf9f4SkPH/f 560A== X-Forwarded-Encrypted: i=1; AJvYcCXRGNad1xe8XGa17LeSdJ8m7PAFgYOfGmz3yPuDXcV0VK0OnUUUCyXh98GKC3HgPJBpaQmNnp86Wy6fdk5VjHotihrc@freebsd.org X-Gm-Message-State: AOJu0YwuElS4aTGcY54JH4jOyk1GoIXnsRbs57lIdwUP8OcRWAEiDIff 8K25BqGtWWGXGDIwsUNzFf1ckTZ8nW34AlroFgjSEH58OOmXK8oAztOsvZS5qlg= X-Gm-Gg: ASbGncvvx5hrAMjZ+WRqN1Tt0XM2lI9rbdVRcRTUHYXSr+BNI1hVCgJRf+eqDwh0Wfh kG1pX5vTyPYdbX7ioFcN5S0fvRZox9jZoiGsgQB41FvdyhjdKZfQcMxj0mLE8GveZIzYS7M4RI8 Pni0xiTo88H8vqOVpreHg7qfqdip2yWf9bs7H58V5Oqa35ffFbfwqWpCi6w9/AbpUjtxKpKSUW/ 5JCVyjOwXY8JDwgf5zcHRDPMT0dIDqULByJYbOB3DHHH4Lj3efKNv1Ffdueo2xRlpj3Sq+xnIvk EoIwJIPWJwxnvkxJX6Z9bEhz1nMFgA== X-Google-Smtp-Source: AGHT+IE/270rZzCieUNr6i6w4Hr3BLrMuVFPAlYbLv3xixTevc+rYaYRR0ko572QTsk2Q919INfWWw== X-Received: by 2002:a05:600c:3511:b0:434:f3a1:b214 with SMTP id 5b1f17b1804b1-438dc41ef52mr140137165e9.28.1738528704946; Sun, 02 Feb 2025 12:38:24 -0800 (PST) Received: from smtpclient.apple ([131.111.5.201]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38c5c1b5136sm11044701f8f.65.2025.02.02.12.38.23 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sun, 02 Feb 2025 12:38:23 -0800 (PST) Content-Type: text/plain; charset=utf-8 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 (Mac OS X Mail 16.0 \(3826.300.87.4.3\)) Subject: Re: git: 15f6edf20e4e - stable/14 - bsdinstall: add menu to install firmware From: Jessica Clarke In-Reply-To: <202411210005.4AL05Tjg087697@gitrepo.freebsd.org> Date: Sun, 2 Feb 2025 20:38:13 +0000 Cc: "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-branches@freebsd.org" Content-Transfer-Encoding: quoted-printable Message-Id: <564A369C-8ABC-494F-8955-949237FEA1C7@freebsd.org> References: <202411210005.4AL05Tjg087697@gitrepo.freebsd.org> To: "Bjoern A. Zeeb" X-Mailer: Apple Mail (2.3826.300.87.4.3) X-Spamd-Result: default: False [-1.63 / 15.00]; NEURAL_HAM_MEDIUM(-0.99)[-0.987]; NEURAL_HAM_SHORT(-0.83)[-0.831]; MV_CASE(0.50)[]; NEURAL_HAM_LONG(-0.42)[-0.417]; FORGED_SENDER(0.30)[jrtc27@freebsd.org,jrtc27@jrtc27.com]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17:c]; MIME_GOOD(-0.10)[text/plain]; DMARC_POLICY_SOFTFAIL(0.10)[freebsd.org : SPF not aligned (relaxed), No valid DKIM,none]; TO_DN_SOME(0.00)[]; FREEFALL_USER(0.00)[jrtc27]; MIME_TRACE(0.00)[0:+]; RCPT_COUNT_THREE(0.00)[4]; RCVD_TLS_LAST(0.00)[]; ARC_NA(0.00)[]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_EQ_ADDR_SOME(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; FROM_NEQ_ENVFROM(0.00)[jrtc27@freebsd.org,jrtc27@jrtc27.com]; RBL_SENDERSCORE_REPUT_8(0.00)[209.85.128.48:from]; PREVIOUSLY_DELIVERED(0.00)[dev-commits-src-all@freebsd.org]; R_DKIM_NA(0.00)[]; MLMMJ_DEST(0.00)[dev-commits-src-all@freebsd.org]; RWL_MAILSPIKE_POSSIBLE(0.00)[209.85.128.48:from]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[209.85.128.48:from] X-Spamd-Bar: - X-Rspamd-Queue-Id: 4YmM0M3Ylsz3dHn On 21 Nov 2024, at 00:05, Bjoern A. Zeeb wrote: >=20 > The branch stable/14 has been updated by bz: >=20 > URL: = https://cgit.FreeBSD.org/src/commit/?id=3D15f6edf20e4e1542f2385a9cbd6e996e= 23252858 >=20 > commit 15f6edf20e4e1542f2385a9cbd6e996e23252858 > Author: Bjoern A. Zeeb > AuthorDate: 2024-11-09 01:10:33 +0000 > Commit: Bjoern A. Zeeb > CommitDate: 2024-11-21 00:04:57 +0000 >=20 > bsdinstall: add menu to install firmware >=20 > Add a menu to the installer to run fwget(8) inside the newly = installed > system to install firmware known to be needed. > This requires working netowrking. >=20 > This is needed at least for wireless currently for when we entirely > stop shipping new firmware in src.git to have working networking on > the installed system (we already do need this for at least rtw89). >=20 > Sponsored by: The FreeBSD Foundation > Tested with: 4 different iwlwifi chipsets in a system (earlier = version) > Suggested improvments by: jrtc27 > Differential Revision: https://reviews.freebsd.org/D47491 >=20 > (cherry picked from commit = bbe2a1da2df639c616869aa838244c8094779bd4) This MFC lost the finalconfig hunk, so there=E2=80=99s no option to = revisit the firmware step as there is in main. Presumably this happened because finalconfig isn=E2=80=99t a separate script in 14 and below, but it does = still exist, just as a function in auto, so that conflict should have been resolved by applying the hunk there instead. Jess > --- > usr.sbin/bsdinstall/bsdinstall.8 | 19 +++++- > usr.sbin/bsdinstall/scripts/Makefile | 1 + > usr.sbin/bsdinstall/scripts/auto | 1 + > usr.sbin/bsdinstall/scripts/firmware | 125 = +++++++++++++++++++++++++++++++++++ > 4 files changed, 145 insertions(+), 1 deletion(-) >=20 > diff --git a/usr.sbin/bsdinstall/bsdinstall.8 = b/usr.sbin/bsdinstall/bsdinstall.8 > index c8bf143322ae..50c8948a7989 100644 > --- a/usr.sbin/bsdinstall/bsdinstall.8 > +++ b/usr.sbin/bsdinstall/bsdinstall.8 > @@ -1,6 +1,10 @@ > .\"- > .\" Copyright (c) 2011-2013 Nathan Whitehorn = All rights reserved. > .\" Copyright (c) 2018 Roberto Fernandez Cueto > +.\" Copyright (c) 2024 The FreeBSD Foundation > +.\" > +.\" Portions of this documentation were written by Bj=C3=B6rn Zeeb > +.\" under sponsorship from the FreeBSD Foundation. > .\" > .\" Redistribution and use in source and binary forms, with or without > .\" modification, are permitted provided that the following conditions > @@ -23,7 +27,7 @@ > .\" ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE > .\" POSSIBILITY OF SUCH DAMAGE. > .\" > -.Dd November 18, 2023 > +.Dd November 4, 2024 > .Dt BSDINSTALL 8 > .Os > .Sh NAME > @@ -240,6 +244,12 @@ Extracts the distributions listed in > .Ev DISTRIBUTIONS > into > .Ev BSDINSTALL_CHROOT . > +.It Cm firmware > +executes > +.Xr fwget 8 > +inside the > +.Ev BSDINSTALL_CHROOT > +to install any needed and available firmware for the new system. > .It Cm rootpass > Interactively invokes > .Xr passwd 1 > @@ -323,6 +333,13 @@ Default: > Path to a log file for the installation. > Default: > .Dq Pa $TMPDIR/bsdinstall_log > +.It Ev BSDINSTALL_SKIP_FIRMWARE > +If not empty, the > +.Cm auto > +target > +will not invoke the > +.Cm firmware > +target. > .It Ev BSDINSTALL_SKIP_HARDENING > If not empty, the > .Cm auto > diff --git a/usr.sbin/bsdinstall/scripts/Makefile = b/usr.sbin/bsdinstall/scripts/Makefile > index 2d226f418783..cbe190d85f12 100644 > --- a/usr.sbin/bsdinstall/scripts/Makefile > +++ b/usr.sbin/bsdinstall/scripts/Makefile > @@ -7,6 +7,7 @@ SCRIPTS=3Dauto \ > docsinstall \ > entropy \ > fetchmissingdists \ > + firmware \ > hardening \ > hostname \ > jail \ > diff --git a/usr.sbin/bsdinstall/scripts/auto = b/usr.sbin/bsdinstall/scripts/auto > index fd5b634696ae..6a89b3dfdd81 100755 > --- a/usr.sbin/bsdinstall/scripts/auto > +++ b/usr.sbin/bsdinstall/scripts/auto > @@ -364,6 +364,7 @@ fi > [ -z "$BSDINSTALL_SKIP_TIME" ] && bsdinstall time > [ -z "$BSDINSTALL_SKIP_SERVICES" ] && bsdinstall services > [ -z "$BSDINSTALL_SKIP_HARDENING" ] && bsdinstall hardening > +[ -z "$BSDINSTALL_SKIP_FIRMWARE" ] && bsdinstall firmware >=20 > [ -z "$BSDINSTALL_SKIP_USERS" ] && dialog --backtitle "$OSNAME = Installer" \ > --title "Add User Accounts" --yesno \ > diff --git a/usr.sbin/bsdinstall/scripts/firmware = b/usr.sbin/bsdinstall/scripts/firmware > new file mode 100644 > index 000000000000..a563f0e578e4 > --- /dev/null > +++ b/usr.sbin/bsdinstall/scripts/firmware > @@ -0,0 +1,125 @@ > +#!/bin/sh > +#- > +# SPDX-License-Identifier: BSD-2-Clause > +# > +# Copyright (c) 2024 The FreeBSD Foundation > +# > +# This software was developed by Bj=C3=B6rn Zeeb > +# under sponsorship from the FreeBSD Foundation. > +# > + > +BSDCFG_SHARE=3D"/usr/share/bsdconfig" > +. $BSDCFG_SHARE/common.subr || exit 1 > + > +f_dprintf "%s: loading includes..." "$0" > +f_include $BSDCFG_SHARE/dialog.subr > +f_include $BSDCFG_SHARE/mustberoot.subr > +f_include $BSDCFG_SHARE/packages/packages.subr > + > +msg_freebsd_firmware_installation=3D"$OSNAME Firmware Installation" > +msg_freebsd_installer=3D"$OSNAME Installer" > +msg_firmware_menu_text=3D"This menu allows you to install firmware = packages for your system" > +hline_arrows_space_tab_enter=3D"Use arrows, SPACE, TAB or ENTER" > +hline_ok=3D"Press OK to continue" > + > +dialog_menu_main() > +{ > + local title=3D"$DIALOG_TITLE" > + local btitle=3D"$DIALOG_BACKTITLE" > + local prompt=3D"$msg_firmware_menu_text" > + local hline > + local check_list=3D # Empty; filled below > + local fwlist _fw > + > + fwlist=3D`chroot $BSDINSTALL_CHROOT fwget -q -n` > + case "${fwlist}" in > + "") # No firmware to install > + # Print a dialog with OK and a 3 line timeout bar. > + local height width rows msg > + > + msg=3D"No firmware to install, continuing..." > + hline=3D"$hline_ok" > + > + eval f_dialog_checklist_size height width rows \ > + \"\$title\" \ > + \"\$btitle\" \ > + \"\$msg\" \ > + \"-\" \ > + \"n\" \ > + \"-\" \ > + \"\$hline\" > + > + ${DIALOG} --title "${title}" --backtitle "${btitle}" \ > + --hline "${hline}" \ > + --nocancel --pause "${msg}" $height $width 5 > + f_dialog_menutag_store -s "" > + return $DIALOG_OK > + ;; > + *) > + local desc status height width rows selected retval > + hline=3D"$hline_arrows_space_tab_enter" > + > + for _fw in ${fwlist}; do > + desc=3D"${_fw}" > + f_shell_escape "$desc" desc > + # install each firmware package by default. > + check_list=3D"$check_list > + '$_fw' '$desc' 'on' > + " > + done > + > + eval f_dialog_checklist_size height width rows \ > + \"\$title\" \ > + \"\$btitle\" \ > + \"\$prompt\" \ > + \"\$hline\" \ > + $check_list > + > + selected=3D$( eval $DIALOG \ > + --title \"\$title\" \ > + --backtitle \"\$btitle\" \ > + --separate-output \ > + --hline \"\$hline\" \ > + --ok-label \"\$msg_ok\" \ > + --cancel-label \"\$msg_cancel\" \ > + --checklist \"\$prompt\" \ > + $height $width $rows \ > + $check_list \ > + 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD > + ) > + retval=3D$? > + f_dialog_menutag_store -s "$selected" > + return $retval > + ;; > + esac > +} > + > +# Initialize > +f_dialog_title "$msg_freebsd_firmware_installation" > +f_dialog_backtitle "$msg_freebsd_installer" > + > +# Gather the firmware files and present them to the user > +dialog_menu_main || f_die > +f_dialog_menutag_fetch selected > + > +# Nothing to install? > +if [ "${selected}" =3D=3D "" ]; then > + exit 0 > +fi > + > +f_mustberoot_init > + > +# pkg(8) needs name servers (unless we could use a local repo in the = future). > +f_quietly cp -f $BSDINSTALL_TMPETC/resolv.conf = $BSDINSTALL_CHROOT/etc/ > + > +${DIALOG} --title "$DIALOG_TITLE" --backtitle "$DIALOG_BACKTITLE" \ > + --infobox "Installing firmware. This may take a moment." 0 0 > + > +# Install each of the selected firmware packages > +for fw in ${selected}; do > + # We install one at a time in case one is not avail. > + # pkg-install.8 needs an option to skip unavail. > + ASSUME_ALWAYS_YES=3DYES chroot $BSDINSTALL_CHROOT pkg install -qy = ${fw} > +done > + > +# end