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:	60b37735f3 ("bsdinstall netconfig: avoid duplicate entries in rc.conf")
This commit is contained in:
Jessica Clarke 2024-02-03 22:50:47 +00:00
parent d682c1eaa5
commit 1e75e61d5c
3 changed files with 4 additions and 4 deletions

View file

@ -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' \

View file

@ -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

View file

@ -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