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)
Sat, Oct 11, 11:31 PM
Unknown Object (File)
Wed, Oct 8, 10:21 AM
Unknown Object (File)
Wed, Oct 8, 9:40 AM
Unknown Object (File)
Sat, Sep 27, 2:42 AM
Unknown Object (File)
Sep 14 2025, 6:54 PM
Unknown Object (File)
Sep 11 2025, 12:39 AM
Unknown Object (File)
Sep 10 2025, 11:57 PM
Unknown Object (File)
Aug 14 2025, 5:46 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 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.

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 ↗(On Diff #42375)

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 ↗(On Diff #42375)

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.