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)
Mon, Oct 7, 12:38 PM
Unknown Object (File)
Oct 1 2024, 5:47 PM
Unknown Object (File)
Sep 28 2024, 2:57 PM
Unknown Object (File)
Sep 25 2024, 6:24 AM
Unknown Object (File)
Sep 25 2024, 4:33 AM
Unknown Object (File)
Sep 24 2024, 1:15 AM
Unknown Object (File)
Sep 16 2024, 9:19 AM
Unknown Object (File)
Sep 9 2024, 10:22 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 Skipped
Unit
Tests Skipped