Page MenuHomeFreeBSD

nanobsd: Use mtree -C to produce the metalog
ClosedPublic

Authored by jlduran on Jan 24 2026, 12:03 AM.
Tags
None
Referenced Files
F148017717: D54854.diff
Sun, Mar 15, 5:28 AM
Unknown Object (File)
Fri, Mar 13, 3:20 AM
Unknown Object (File)
Fri, Mar 13, 3:14 AM
Unknown Object (File)
Wed, Mar 11, 12:49 PM
Unknown Object (File)
Mon, Mar 9, 5:02 PM
Unknown Object (File)
Fri, Mar 6, 4:23 PM
Unknown Object (File)
Mon, Mar 2, 12:18 PM
Unknown Object (File)
Sat, Feb 21, 11:04 AM
Subscribers

Details

Summary

Prefer an mtree -C output, which is guaranteed to be mtree-compatible.
Add "gname", "uname", and "tags" to the default keyword set, while
removing "size" and "time", the latter being set on kernel file entries
and taking precedence over makefs -T (when paired with -F).

As a side effect, this produces a cleaner file with sorted keywords.

Test Plan
# sh nanobsd.sh -U -n -c ~/nano.conf
...
# shasum /usr/obj/nanobsd.full/_.disk.image
<matching hash>  /usr/obj/nanobsd.full/_.disk.image
# sh nanobsd.sh -U -n -c ~/nano.conf
...
# shasum /usr/obj/nanobsd.full/_.disk.image
<matching hash>  /usr/obj/nanobsd.full/_.disk.image

Diff Detail

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

Event Timeline

jlduran added a reviewer: imp.
  • Update the comment to indicate that we also remove the time keyword
imp added inline comments.
tools/tools/nanobsd/defaults.sh
569

Do you want -u on the sort?

This revision is now accepted and ready to land.Jan 24 2026, 12:57 AM
tools/tools/nanobsd/defaults.sh
569

I guess it does not hurt to have it. mtree-dedup.awk should take care of duplicates, furthermore mtree -C removes the duplicate entries. But I'll add it when committing, just in case. Thanks!

tools/tools/nanobsd/defaults.sh
569

I should have emphasized: mtree -C NOW removes the duplicate entries.

This revision was automatically updated to reflect the committed changes.
jlduran marked an inline comment as done.