Page MenuHomeFreeBSD

First cut at a loader.conf.d support
ClosedPublic

Authored by kevans on Jul 10 2020, 2:13 AM.

Details

Summary

After we've finished processing all of the loader_conf_files at the root of the include tree, grab loader_conf_dirs and process any files within.

Currently nothing is off-limits; any files placed in one of these directories will be read.

Diff Detail

Repository
R10 FreeBSD src repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

allanjude added a reviewer: allanjude.

Reviewed By: allanjude

This revision is now accepted and ready to land.Jul 10 2020, 2:30 AM
rpokala added inline comments.
stand/lua/config.lua
537

I'm having trouble parsing that pattern...?

stand/lua/config.lua
537

https://www.lua.org/manual/5.3/manual.html#6.4.1

A series of alphanumeric and punctuation characters, since that's also what we used for loader_conf_files. For punctuation, see ispunct(3)

Code LGTM; suggestion for the manpage.

stand/defaults/loader.conf.5
259–261

While here, describe loader_conf_files too, since it doesn't have a description.

stand/lua/config.lua
543

I think we want to restrict this to foo.conf, since emacs likes to leave behind foo.conf~ files.

stand/lua/config.lua
543

I'm on board with this, too. I wouldn't mind being able to move things to foo.conf.disabled or keep around foo.conf.old files, beyond just tolerating obnoxious editor defaults.

stand/lua/config.lua
543

Yeah, making it loader.conf.d/*.conf is probably the safer thing to do.

stand/lua/config.lua
543

Sure, it's trivial to fix so I'll do so pre-commit. At some point I'd like to open up the option of .lua config files, too, but this is a similarly trivial addition later when I get to that point.