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
F93000823: D42194.id128742.diff
Fri, Sep 6, 4:10 AM
Unknown Object (File)
Sat, Aug 31, 11:04 AM
Unknown Object (File)
Thu, Aug 8, 3:36 AM
Unknown Object (File)
Aug 3 2024, 7:35 PM
Unknown Object (File)
Jul 29 2024, 6:38 AM
Unknown Object (File)
Jul 25 2024, 1:45 AM
Unknown Object (File)
Jul 24 2024, 8:55 AM
Unknown Object (File)
Jul 23 2024, 7:45 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