Page MenuHomeFreeBSD

nanobsd: Adjust the order of the flags in makefs
ClosedPublic

Authored by jlduran on May 24 2026, 11:01 AM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Jun 8, 8:53 AM
Unknown Object (File)
Mon, Jun 8, 6:58 AM
Unknown Object (File)
Sun, Jun 7, 7:58 PM
Unknown Object (File)
Thu, Jun 4, 5:34 PM
Unknown Object (File)
Thu, Jun 4, 5:34 PM
Unknown Object (File)
Tue, Jun 2, 4:11 PM
Unknown Object (File)
Tue, Jun 2, 1:57 PM
Unknown Object (File)
Mon, Jun 1, 6:14 PM
Subscribers

Details

Summary

The order of the flags matter in makefs(8). The -t (type) flag must come
before the -o (options), otherwise the options are reset.

Move the -t flag before the -o flag and remove the shim function
_xxx_adjust_code_size() that was created to align to the default makefs
FFS values.

It effectively prevented us from generating NanoBSD images using
unprivileged builds with the partitions internally aligned as intended.

Test Plan
sh nanobsd.sh -U

Diff Detail

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

Event Timeline

Finally I was able to "unveil" the mystery of makefs' partition alignment. This was the actual issue: the -t ffs option should appear before the -o option. In my brief testing, I was finally able to produce an image that is partitioned exactly as the root-built one, doing it as an unprivileged user. While at it, I also fixed a number of other tangentially-related issues regarding non-privileged builds on NanoBSD (the rest of the stack). As well as preparing the ground for some changes that are yet to come as part of the GSoC project.

This revision is now accepted and ready to land.May 24 2026, 6:58 PM