Page MenuHomeFreeBSD

[PATCH 2/2] netconfig: avoid duplicate entries in rc.conf
ClosedPublic

Authored by khorben_defora.org on Oct 13 2023, 3:56 PM.
Tags
None
Referenced Files
Unknown Object (File)
Apr 6 2024, 3:08 AM
Unknown Object (File)
Mar 13 2024, 1:55 AM
Unknown Object (File)
Jan 19 2024, 12:11 PM
Unknown Object (File)
Jan 13 2024, 6:33 PM
Unknown Object (File)
Dec 20 2023, 4:24 AM
Unknown Object (File)
Dec 10 2023, 8:40 PM
Unknown Object (File)
Dec 1 2023, 7:17 AM
Subscribers

Details

Summary

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.

This addresses #212396, while the previous patch in this series addresses #211617.

Sponsored by: The FreeBSD Foundation

Test Plan

I have created a stand-alone copy of usr.sbin/bsdinstall, slightly modified in order to allow local testing without requiring a new installation image for every change.

$ git clone --branch khorben/netconfig https://github.com/khorben/bsdinstall.git
$ cd bsdinstall
$ less README.md
[...]
$ cat > test.sh << EOF
#!/bin/sh

BSDINSTALLDIR="\$PWD"
DESTDIR="\$BSDINSTALLDIR/destdir"
BSDINSTALL_DISTDIR="\$DESTDIR/usr/freebsd-dist"; export BSDINSTALL_DISTDIR
SRCDIR="/usr/src"

TMPDIR="\$(mktemp -d)"; export TMPDIR
for target in "\$@"; do
    BSDCFG_SHARE="\$SRCDIR/usr.sbin/bsdconfig/share" \
        BSDINSTALL_CHROOT="\$DESTDIR" \
        BSDINSTALL_CONFIGCURRENT="yes" \
        BSDINSTALL_SCRIPTS="\$BSDINSTALLDIR/scripts" \
        LOCAL_DISTRIBUTIONS="base.txz kernel.txz lib32.txz" \
        DISTRIBUTIONS="lib32-dbg.txz" \
        ./bsdinstall "\$target"
done
EOF
$ sh test.sh netconfig

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable