Make /etc/rc.d/kldxref not print anything for empty directories.
This makes the common case completely silent, as it should be.
Details
Diff Detail
- Repository
- rS FreeBSD src repository - subversion
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
Almost right...
etc/rc.d/kldxref | ||
---|---|---|
28 ↗ | (On Diff #40289) | I'd check the kdlxref_clobber setting first, and then linker.hints and then do the module_dir expansion to see if it's empty or not. Otherwise you'll do a lot of I/O needlessly, which can be a problem on some of our platforms before the caches are warmed up during early boot (and it will also pollute the dircache for a time too). Doing it as separate 'test' invocations should allow the short-circuiting mechanisms to prevent that. |
Change the order as suggested by imp@, and also tweak the logic somewhat: ignore directories that don't contain any '*.ko' files, as opposed to directories that are empty. Otherwise we still descend into /boot/dtb/, as it contains /boot/dtb/overlays/.
This looks good. One minor concern about precedence, but if it's good, I'm good.
etc/rc.d/kldxref | ||
---|---|---|
28 ↗ | (On Diff #42375) | Is && higher precedence that ||? man sh is silent. |
etc/rc.d/kldxref | ||
---|---|---|
28 ↗ | (On Diff #42375) | It seems so; "sh -x" shows the "*.ko" expansion is not done when the linker.hints file exists. |