Page MenuHomeFreeBSD

mtree: Add missing entries
ClosedPublic

Authored by jlduran on Sat, Mar 21, 8:32 AM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Mar 30, 8:45 AM
Unknown Object (File)
Mon, Mar 30, 8:35 AM
Unknown Object (File)
Mon, Mar 30, 8:35 AM
Unknown Object (File)
Sat, Mar 28, 10:11 AM
Unknown Object (File)
Sat, Mar 28, 9:52 AM
Unknown Object (File)
Sat, Mar 28, 12:21 AM
Unknown Object (File)
Fri, Mar 27, 9:41 PM
Unknown Object (File)
Thu, Mar 26, 11:57 AM
Subscribers

Details

Reviewers
ivy
Group Reviewers
pkgbase
Commits
rG8d99314a044c: mtree: Add missing entries
Summary

Add missing mtree directory entries. Without them, the resulting
worldstage METALOG file would produce an invalid (incomplete) mtree
specification file.

Test Plan

In preparation for pkgbase + NanoBSD, we currently "lint" the resulting METALOG with a final "mtree -C" pass:

cat /usr/obj/usr/src/arm64.aarch64/worldstage/METALOG | sort -u | mtree -C -K uname,gname,tags -R time

The de-duplication of entries can be fixed so that, for example:

./boot type=dir uname=root gname=wheel mode=0755 tags=package=bootloader
./boot type=dir uname=root gname=wheel mode=0755 tags=package=utilities

Can be "unified" as, for example:

./boot type=dir uname=root gname=wheel mode=0755 tags=package=bootloader,utilities

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

jlduran edited the test plan for this revision. (Show Details)
jlduran added a reviewer: pkgbase.

./boot type=dir uname=root gname=wheel mode=0755 tags=package=bootloader,utilities

i don't think this is right (and based on what i remember of mtree-to-plist, i'm not sure it'll even work). /boot should be owned by the bootloader package; if something is adding a package=utilities tag to it, whatever's doing that should be fixed.

not tested, but based on code inspection this looks fine. it's better not to add the correct package= tags on the new entries for now, instead we can do that for the entire file and test it all at once, since that's created subtle issues in the past.

This revision is now accepted and ready to land.Sat, Mar 21, 8:54 AM
In D56013#1281115, @ivy wrote:

./boot type=dir uname=root gname=wheel mode=0755 tags=package=bootloader,utilities

i don't think this is right (and based on what i remember of mtree-to-plist, i'm not sure it'll even work). /boot should be owned by the bootloader package; if something is adding a package=utilities tag to it, whatever's doing that should be fixed.

Yes, I chose a bad example. How about:

./etc type=dir uname=root gname=wheel mode=0755 tags=package=runtime
./etc type=dir uname=root gname=wheel mode=0755 tags=package=utilities

It turns out that NanoBSD's mtree-dedup.awk "chooses" the first package entry, but ideally both should be on a single line. You are correct that mtree-to-plist.awk does not understand a combination like package=runtime,utilities but it is something we will be exploring. Maybe it is better to tag as plural: packages=<pkg1>,<pkg2> and leave the current package= branch logic as is.
It is still too early to tell, as we do not know what the output of pkg info should be on a pkgbase NanoBSD system.

Thank you for the fast review.

This revision was automatically updated to reflect the committed changes.