From nobody Fri Oct 13 16:48:59 2023 X-Original-To: dev-commits-src-main@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 4S6XXC6443z4wTYn; Fri, 13 Oct 2023 16:48:59 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4S6XXC5X72z4DVq; Fri, 13 Oct 2023 16:48:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1697215739; 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=8x3yJpyzF9nC8sYrX5yvI9IwJYOzg9uu2mr/ilIML9A=; b=xgeniIo1YXBbLcdOvTk2NY5lwcHWzIDzYp9gyjLbjU7Lp8+Itc481CEFcwOWsrU8CA8g3a 9I+ZZqT+z3m6Q9aymDmHeE65ewoAcA/HgWEk+1XC/5kt/Bb+UefgZTItXanbbeTG+oHVj1 3zt7ieN6lXly9wSgMjnmeEsXHzNXrzGbqbQAOIYee2hAeA1FjWYypH2wa0H6GkUip598/8 ZSjQlWNmDO3oBHiio2OdJtsiEOvug9mQCYMLYZw9nweZaKm1Wt/BmIiER3t9B6w+/fz5XK HBxomZQwHB/0L7Yp43CCm0GTetgbTQSjfzWO7prgYX9jxPHNEWzX4Q8e6XLGOA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1697215739; a=rsa-sha256; cv=none; b=VJO84psJqSRONrqkNdn5OKmjm9XZCRBDnq1o4ncO7EiqVtnHp5nr/7g2WqGPNzEcQoatXT f8tlw7OVSdik6Au4WP119hyGQJUu4zP8ZL0LNHSMXrRff85u2tgJyPeMZobW9cAJ3IosJ6 hAY1mEV+eCqkRkrMStfZo0M1619xi3jtqNckBAxNyAZ26hrIJHC9uO5gPaTLDXoqAYS6Jt N3JKkClxF9Da8gh1ZbCH8/HnrvM9OyqHhNnns0C7blywwqcnic+YLYcIjB+/JeStdv5u7p G4+vJxsuk0TSpQkKIAXB6dT5aPwjT05uh6RhA0zizHC3glmezzX7Z+VcySkhRQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1697215739; 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=8x3yJpyzF9nC8sYrX5yvI9IwJYOzg9uu2mr/ilIML9A=; b=Nn376hcStRVnGUgbCJHI48nh8V4PeGCplRVEmj87Z0/RPC57e026A6NGi6z8JRv1Eox51X w8ywsmBsKnTC6Xb5Y8jG8CEhDWBYr0ZVt2aKu6M+lk5WMCSN97eMnqT9OiKB8TiFNydgxG D8SdfMXjHBPw5dfe9E8BUFQovblB5PO0fl+zVrIIpuxfjkJNLYYxIayjMuEiJBFOsB5oLm pJ6e+CSK3R9471+3EJPFjNTsmHwJQU3dfGYGiztAFXziSKUqChEL90vyW+qcP4P/vPPOa6 +aWTUljmjOn/3tdfOr1qF826UUF1o5xeS3020oMqW2ufu3X3ywZF8jDJlDCkyw== 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 4S6XXC4LSPzvpC; Fri, 13 Oct 2023 16:48:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 39DGmx3U014798; Fri, 13 Oct 2023 16:48:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 39DGmxSS014795; Fri, 13 Oct 2023 16:48:59 GMT (envelope-from git) Date: Fri, 13 Oct 2023 16:48:59 GMT Message-Id: <202310131648.39DGmxSS014795@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: 60b37735f305 - main - bsdinstall netconfig: avoid duplicate entries in rc.conf List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 60b37735f305e72e67695ead029e59ea29b2bc29 Auto-Submitted: auto-generated The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=60b37735f305e72e67695ead029e59ea29b2bc29 commit 60b37735f305e72e67695ead029e59ea29b2bc29 Author: Pierre Pronchery AuthorDate: 2023-10-13 15:45:19 +0000 Commit: Ed Maste CommitDate: 2023-10-13 16:45:54 +0000 bsdinstall netconfig: avoid duplicate entries in rc.conf This uses sysrc to write and update configuration variables in the temporary configuration file for network access, ._rc.conf.net. This replaces the previous mechanism, which was simply appending new values as they were updated. PR: 212396 Reviewed by: emaste Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D42194 --- usr.sbin/bsdinstall/scripts/netconfig | 4 ++-- usr.sbin/bsdinstall/scripts/netconfig_ipv4 | 2 +- usr.sbin/bsdinstall/scripts/netconfig_ipv6 | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/usr.sbin/bsdinstall/scripts/netconfig b/usr.sbin/bsdinstall/scripts/netconfig index 99c129ab61f5..addf5cb527d6 100755 --- a/usr.sbin/bsdinstall/scripts/netconfig +++ b/usr.sbin/bsdinstall/scripts/netconfig @@ -81,7 +81,7 @@ exec 5>&- IFCONFIG_PREFIX="" if is_wireless_if $INTERFACE; then NEXT_WLAN_IFACE=wlan0 # XXX - echo wlans_$INTERFACE=\"$NEXT_WLAN_IFACE\" >> $BSDINSTALL_TMPETC/._rc.conf.net + sysrc -f $BSDINSTALL_TMPETC/._rc.conf.net wlans_$INTERFACE "$NEXT_WLAN_IFACE" IFCONFIG_PREFIX="WPA " if [ ! -z $BSDINSTALL_CONFIGCURRENT ]; then ifconfig $NEXT_WLAN_IFACE create wlandev $INTERFACE @@ -115,7 +115,7 @@ fi # In case wlanconfig left an option and we do not support IPv4 we need to write # it out on its own. We cannot write it out with IPv6 as that suffix. if [ ${IPV4_AVAIL} -eq 0 -a -n ${IFCONFIG_PREFIX} ]; then - echo ifconfig_${INTERFACE}=\"${IFCONFIG_PREFIX}\" >> $BSDINSTALL_TMPETC/._rc.conf.net + sysrc -f $BSDINSTALL_TMPETC/._rc.conf.net ifconfig_$INTERFACE "${IFCONFIG_PREFIX}" fi if [ ${IPV6_AVAIL} -eq 1 ]; then bsddialog --backtitle "$OSNAME Installer" --title 'Network Configuration' \ diff --git a/usr.sbin/bsdinstall/scripts/netconfig_ipv4 b/usr.sbin/bsdinstall/scripts/netconfig_ipv4 index 3da1803cd0d1..9097a1f9617c 100755 --- a/usr.sbin/bsdinstall/scripts/netconfig_ipv4 +++ b/usr.sbin/bsdinstall/scripts/netconfig_ipv4 @@ -63,7 +63,7 @@ if [ $? -eq $BSDDIALOG_OK ]; then exec $0 ${INTERFACE} "${IFCONFIG_PREFIX}" fi fi - echo ifconfig_$INTERFACE=\"${IFCONFIG_PREFIX}DHCP\" >> $BSDINSTALL_TMPETC/._rc.conf.net + sysrc -f $BSDINSTALL_TMPETC/._rc.conf.net ifconfig_$INTERFACE "${IFCONFIG_PREFIX}DHCP" exit 0 fi diff --git a/usr.sbin/bsdinstall/scripts/netconfig_ipv6 b/usr.sbin/bsdinstall/scripts/netconfig_ipv6 index 00ef8791de4b..99ec379197fb 100755 --- a/usr.sbin/bsdinstall/scripts/netconfig_ipv6 +++ b/usr.sbin/bsdinstall/scripts/netconfig_ipv6 @@ -73,7 +73,7 @@ while : ; do continue fi fi - echo ifconfig_${INTERFACE}_ipv6=\"inet6 accept_rtadv\" >> $BSDINSTALL_TMPETC/._rc.conf.net + sysrc -f $BSDINSTALL_TMPETC/._rc.conf.net ifconfig_${INTERFACE}_ipv6 "inet6 accept_rtadv" exit 0 else break