Page MenuHomeFreeBSD

kldxref: skip .pkgsave files
ClosedPublic

Authored by freebsd_igalic.co on Jan 4 2021, 9:29 PM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Oct 8, 2:28 PM
Unknown Object (File)
Thu, Oct 3, 3:08 PM
Unknown Object (File)
Tue, Oct 1, 4:36 AM
Unknown Object (File)
Fri, Sep 27, 4:49 AM
Unknown Object (File)
Fri, Sep 27, 3:18 AM
Unknown Object (File)
Tue, Sep 24, 4:03 AM
Unknown Object (File)
Tue, Sep 24, 3:49 AM
Unknown Object (File)
Tue, Sep 24, 1:27 AM

Details

Summary

add .pkgsave to list of skipped files, by skipping all files that
contain two '.'

Motivation: This should help people transitioning from
traditional setups to pkgbase experience a lot less friction.

Test Plan

update your system to pkgbase (using, for instance https://alpha.pkgbase.live/ ;)
or, copy .ko files in /boot/kernel to .ko.pkgsave

service kldxref onerestart
reboot, see unhappy boot messages

apply this patch
rebuild kldxref
reboot and see *no* unhappy boot messages!

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

freebsd_igalic.co created this revision.
emaste added a subscriber: emaste.

LGTM even though we're probably close to the point where it makes sense to have a loop with a list of extensions to ignore.

This revision is now accepted and ready to land.Jan 4 2021, 10:42 PM

LGTM even though we're probably close to the point where it makes sense to have a loop with a list of extensions to ignore.

alternatively, we could say: if it has >= 2 '.', skip it

alternatively, we could say: if it has >= 2 '.', skip it

Yes I think that's reasonable if you're up for updating this review with that change (or I'll take this one as is).

alternatively, we could say: if it has >= 2 '.', skip it

Yes I think that's reasonable if you're up for updating this review with that change (or I'll take this one as is).

naïvely, i'd implement this like,

char *first_dot  = strchr(p->fts_name, '.');
char *last_dot = strchrt(p->fts_name, '.');
if (first_dot != NULL && last_dot != NULL && first_dot != last_dot)
        continue;

assuming that .symbols and .debug files usually look like: foo.ko.debug and bar.ko.symbols like with .pkgsave files.

same functionality, written in C instead of python style C. thanks to RhodiumToad:

char *dot = strchr(p->fts_name, '.');
if (dot && strchr(dot+1, '.') != NULL)
        continue;

i don't suppose dot+1 will push us *past* \0, so we don't need to check if we still have enough string left

This revision now requires review to proceed.Jan 5 2021, 10:06 PM
kevans added inline comments.
usr.sbin/kldxref/kldxref.c
759–762

I think we can safely drop .symbols from this list, @emaste transitioned to .debug in 05117b57a54a -- surely enough time has passed that we can stop explicitly caring about or referencing them, hopefully...

freebsd_igalic.co marked an inline comment as done.

address @kevans' feedback.

address @kevans' feedback, by moving local_rc *.pkgsave skipping into the skipping of scratch files, since that issues a warning.

unfucked this differential, after accidentally updating with the wrong diff

I'm going to update this review with an edit to the man page, and then we can revive it.

You didn't ask for manpages approval. Is that deliberate?

usr.sbin/kldxref/kldxref.8
55 ↗(On Diff #117644)

at least two.

Also, is it acceptable to ignore "foo.bar.ko"?

usr.sbin/kldxref/kldxref.8
55 ↗(On Diff #117644)

true, we just stop counting after two.

There's currently no module named that way

In D27959#880578, @pauamma wrote:

You didn't ask for manpages approval. Is that deliberate?

I thought requiring manpages is automatic as soon as you add/modify a man page

Please remember to bump .Dd :)

Please remember to bump .Dd :)

Yeah. Whole text shows it already there for me, but in both old and new, so I suspect something.

This revision is now accepted and ready to land.Feb 21 2023, 5:38 PM

I think this is now missing the .c code changes.

one day, i will use arc and it will not mess up my review.
one day, really soon.

This revision now requires review to proceed.Feb 21 2023, 10:25 PM

It's fine this way...
Or we could also just whine less with weird files we encounter, though that's likely riskier than this tactic.

usr.sbin/kldxref/kldxref.c
760

This should be

/*
 * Skip files that generate errors like .debug, .symbol and .pkgsave
 * by generally skipping all files with two dots.
 */

since it's a multi-line comment.

Minor nit fixable on commit.

usr.sbin/kldxref/kldxref.8
61 ↗(On Diff #117725)

I'd either remove the comma or add another before "however".

This revision is now accepted and ready to land.Feb 21 2023, 11:10 PM
This revision was automatically updated to reflect the committed changes.