Page MenuHomeFreeBSD

mtree: TESTSBASE directory always starts with a /
ClosedPublic

Authored by jlduran on Nov 24 2024, 6:32 AM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Feb 24, 9:37 PM
Unknown Object (File)
Tue, Feb 18, 3:26 AM
Unknown Object (File)
Wed, Feb 12, 10:48 AM
Unknown Object (File)
Feb 6 2025, 6:08 PM
Unknown Object (File)
Jan 25 2025, 3:05 AM
Unknown Object (File)
Jan 23 2025, 6:27 PM
Unknown Object (File)
Jan 6 2025, 2:14 AM
Unknown Object (File)
Jan 6 2025, 12:23 AM
Subscribers

Details

Summary

Remove the extra forward slash ("/"), otherwise the mtree specification
file will have the double slash and will not be parsed by makefs when
attempting to build NanoBSD with NO_ROOT privileges.

Fixes: 07670b30fa43 ("Create /usr/tests *.debug file directory hierarchy")

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

jlduran created this revision.

This is fine with me, but you could instead strip a leading / from TESTBASE if present, e.g. /usr/lib/debug/${TESTBASE:S,^/,,}. This will be robust against a possible TESTBASE without a leading slash.

This revision is now accepted and ready to land.Nov 29 2024, 4:46 PM

This is fine with me, but you could instead strip a leading / from TESTBASE if present, e.g. /usr/lib/debug/${TESTBASE:S,^/,,}. This will be robust against a possible TESTBASE without a leading slash.

I like this suggestion, I'll submit it on a separate review, as TESTSBASE is used in some other places as well.

Also, I have yet to investigate if the mtree parsing under makefs is too strict (https://cgit.freebsd.org/src/tree/usr.sbin/makefs/mtree.c#n1004). But I'll check that once I have finished polishing building NanoBSD without root privileges (https://reviews.freebsd.org/D47653#1086475, https://www.youtube.com/watch?v=5qCaOMQ3ZnQ&t=2917s).

Also, I have yet to investigate if the mtree parsing under makefs is too strict (https://cgit.freebsd.org/src/tree/usr.sbin/makefs/mtree.c#n1004). But I'll check that once I have finished polishing building NanoBSD without root privileges (https://reviews.freebsd.org/D47653#1086475, https://www.youtube.com/watch?v=5qCaOMQ3ZnQ&t=2917s).

The underlying issue was that, when sorting the metalog, the double slash came up first. For example:

./base/aaa type=dir
./base//aaa/bbb type=dir

If sorted, would turn out:

./base//aaa/bbb type=dir
./base/aaa type=dir

Effectively, missing the ./base/aaa directory in the specification.