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 Passed - Unit
No Test Coverage - Build Status
Buildable 15563 Build 15600: arc lint + arc unit
Event Timeline
Almost right...
etc/rc.d/kldxref | ||
---|---|---|
28 | 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 | ||
---|---|---|
30 | Is && higher precedence that ||? man sh is silent. |
etc/rc.d/kldxref | ||
---|---|---|
30 | It seems so; "sh -x" shows the "*.ko" expansion is not done when the linker.hints file exists. |