git: 1e75e61d5c2c - main - bsdinstall: Fix broken netconfig persistence for installed system

From: Jessica Clarke <jrtc27_at_FreeBSD.org>
Date: Sat, 03 Feb 2024 23:11:55 UTC
The branch main has been updated by jrtc27:

URL: https://cgit.FreeBSD.org/src/commit/?id=1e75e61d5c2c34ddaf7bfbdba02e00670f9bf231

commit 1e75e61d5c2c34ddaf7bfbdba02e00670f9bf231
Author:     Jessica Clarke <jrtc27@FreeBSD.org>
AuthorDate: 2024-02-03 22:50:47 +0000
Commit:     Jessica Clarke <jrtc27@FreeBSD.org>
CommitDate: 2024-02-03 22:50:47 +0000

    bsdinstall: Fix broken netconfig persistence for installed system
    
    The replacement of echo >> with sysrc -f used sysrc key value, which
    means "read variables key and value" and thus did nothing useful (and in
    fact emitted errors to the log about neither existing). Instead use the
    correct sysrc key=value form so the installed system comes back up with
    working networking.
    
    Fixes:  60b37735f305 ("bsdinstall netconfig: avoid duplicate entries in rc.conf")
---
 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 58fbe1883d40..77b71867eb4a 100755
--- a/usr.sbin/bsdinstall/scripts/netconfig
+++ b/usr.sbin/bsdinstall/scripts/netconfig
@@ -82,7 +82,7 @@ exec 5>&-
 IFCONFIG_PREFIX=""
 if is_wireless_if $INTERFACE; then
 	NEXT_WLAN_IFACE=wlan0	# XXX
-	sysrc -f $BSDINSTALL_TMPETC/._rc.conf.net wlans_$INTERFACE "$NEXT_WLAN_IFACE"
+	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
@@ -116,7 +116,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
-	sysrc -f $BSDINSTALL_TMPETC/._rc.conf.net ifconfig_$INTERFACE "${IFCONFIG_PREFIX}"
+	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 9097a1f9617c..8f747a9d0162 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
-	sysrc -f $BSDINSTALL_TMPETC/._rc.conf.net ifconfig_$INTERFACE "${IFCONFIG_PREFIX}DHCP"
+	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 99ec379197fb..b851069eee14 100755
--- a/usr.sbin/bsdinstall/scripts/netconfig_ipv6
+++ b/usr.sbin/bsdinstall/scripts/netconfig_ipv6
@@ -73,7 +73,7 @@ while : ; do
 				continue
 			fi
 		fi
-		sysrc -f $BSDINSTALL_TMPETC/._rc.conf.net ifconfig_${INTERFACE}_ipv6 "inet6 accept_rtadv"
+		sysrc -f $BSDINSTALL_TMPETC/._rc.conf.net ifconfig_${INTERFACE}_ipv6="inet6 accept_rtadv"
 		exit 0
 	else
 		break