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, Apr 4, 5:54 AM
Unknown Object (File)
Mar 10 2024, 4:55 AM
Unknown Object (File)
Mar 7 2024, 7:40 AM
Unknown Object (File)
Mar 7 2024, 7:40 AM
Unknown Object (File)
Jan 13 2024, 12:18 PM
Unknown Object (File)
Jan 5 2024, 10:33 PM
Unknown Object (File)
Dec 20 2023, 4:40 AM
Unknown Object (File)
Dec 18 2023, 11:25 PM
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.