Page MenuHomeFreeBSD

nanobsd: Change sizes to use bytes exclusively
Needs ReviewPublic

Authored by senguptaangshuman17_gmail.com on Wed, Aug 19, 10:24 AM.
Tags
None
Referenced Files
F168374101: D58969.diff
Thu, Aug 27, 8:31 PM
F168373810: D58969.diff
Thu, Aug 27, 8:29 PM
F168371828: D58969.diff
Thu, Aug 27, 8:13 PM
Unknown Object (File)
Wed, Aug 26, 7:03 PM
Unknown Object (File)
Wed, Aug 26, 4:08 PM
Unknown Object (File)
Wed, Aug 26, 4:08 PM
Unknown Object (File)
Wed, Aug 26, 4:08 PM
Unknown Object (File)
Wed, Aug 26, 4:05 PM
Subscribers

Details

Reviewers
jlduran
jrm
ashish
Summary

Accept sizes in bytes instead of 512-byte sectors. Replace strsuftoll with strtobytes, which accepts powers of two and powers of ten.

For existing configurations migrating to the default plan, users who wish to keep using 512-byte sector counts can append an 's' (for sector) suffix to their variables (e.g., NANO_MEDIASIZE=4000000s, NANO_CONFSIZE=2048s).

Legacy configurations setting NANO_PLAN=legacy continue working with raw sector counts without modification.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 76126
Build 73009: arc lint + arc unit

Event Timeline

Since this is a legacy-breaking change (perhaps the most significant one), we should provide an easy migration path. For example, in the commit message, we can explain that users who want to keep using sector sizes could add an s (for sector) suffix to its current values when migrating to the default plan, this is a deliberate change from strsuftoll, which uses b (for block) for that same purpose.

tools/tools/nanobsd/defaults.sh
1478

This change seems unrelated.

Add metalog file existence check before makefs and calculate md_size in sectors