Page MenuHomeFreeBSD

Silence down /etc/rc.d/kldxref
ClosedPublic

Authored by trasz on Mar 14 2018, 5:36 PM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, May 2, 1:48 PM
Unknown Object (File)
Thu, May 2, 10:34 AM
Unknown Object (File)
Thu, May 2, 8:44 AM
Unknown Object (File)
Thu, May 2, 8:33 AM
Unknown Object (File)
Wed, May 1, 2:28 AM
Unknown Object (File)
Apr 4 2024, 5:54 AM
Unknown Object (File)
Mar 10 2024, 4:55 AM
Unknown Object (File)
Mar 7 2024, 7:40 AM
Subscribers

Details

Summary

Make /etc/rc.d/kldxref not print anything for empty directories.
This makes the common case completely silent, as it should be.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 16521
Build 16435: arc lint + arc unit

Event Timeline

Almost right...

etc/rc.d/kldxref
27

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.

This revision is now accepted and ready to land.May 9 2018, 1:53 PM

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 revision now requires review to proceed.May 10 2018, 5:44 PM

This looks good. One minor concern about precedence, but if it's good, I'm good.

etc/rc.d/kldxref
28

Is && higher precedence that ||? man sh is silent.

This revision is now accepted and ready to land.May 10 2018, 8:50 PM
etc/rc.d/kldxref
28

It seems so; "sh -x" shows the "*.ko" expansion is not done when the linker.hints file exists.

This revision was automatically updated to reflect the committed changes.