Page MenuHomeFreeBSD

nanobsd: Always define the partition index
ClosedPublic

Authored by jlduran on Nov 29 2024, 12:04 AM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Feb 4, 2:11 PM
Unknown Object (File)
Wed, Jan 29, 2:59 AM
Unknown Object (File)
Mon, Jan 20, 11:34 PM
Unknown Object (File)
Jan 6 2025, 7:22 AM
Unknown Object (File)
Jan 6 2025, 5:01 AM
Unknown Object (File)
Jan 2 2025, 11:46 AM
Unknown Object (File)
Dec 26 2024, 2:06 PM
Unknown Object (File)
Dec 7 2024, 6:07 PM
Subscribers
None

Details

Summary

Print the desired partition index together with the starting sector and
the size in sectors. Otherwise, when only one code partition is
desired, the configuration partition (/cfg) may not end up in the third
slice, thus breaking the scripts that expect it there.

This was the previous approach, changed in 587c054bea0f ("nanobsd: Use
gpart and create code image before full disk image"), where the
partition index was printed as the first column.

Fix it by printing the index as the last column to reduce the chances of
breaking current overrides, and using it as the gpart index.

PR: 262098
Fixes: 587c054bea0f ("nanobsd: Use gpart and create code image before full disk image")

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

jlduran created this revision.

Friendly reminder:

This fix just adds a third column to the _.partitioning file containing the desired partition index. Without this index, gpart will sequentially assign an index.
When there are only two entries, as explained in 262098, the /cfg partition will end up in slice 2, therefore failing all NanoBSD scripts that expect it to be on slice 3.

This commit guarantees that -i 3 is passed to gpart when adding the /cfg partition (-i 2 if needed for the second code partition, and optionally -i 4 for the /data partition).

This revision is now accepted and ready to land.Tue, Feb 4, 3:32 AM
This revision was automatically updated to reflect the committed changes.