The visionfive2 riscv SBC has odd requirements for startup partitions.
The design of mkimg only allows it to create predetermined types of partitions that don't include some of those needed for the visionfive2 system.
This change adds the two types needed (hifive-fsbl and xbootldr) as well as hifive-bbl (used in the downloadable riscv64 images but not used by visionfive2).
Details
Verify existing test suite for mkimg runs.
I haven't written any specific tests for the new partition types.
An image created with the new partition types and mounted with mdconfig should show the correct partition types. Note that 'gpart show' only understands the hifive-fsbl and hifive-bbl types. The xbootldr partition type will show as !bc13c2ff-59e6-4262-a352-b275fd6f7172.
Diff Detail
- Repository
- rG FreeBSD src repository
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
Looks good, with one required change.
Seems like the "xbootldr" partition type is a systemd-boot thing. It is a useful alias.
It should be straightforward to add this to the gpart utility as well. Would you like to handle this too? (Start by looking at g_part_alias_list[] in sys/geom/part/g_part.c.)
| usr.bin/mkimg/gpt.c | ||
|---|---|---|
| 56–57 | This definition should be added to sys/sys/disk/gpt.h instead. | |
Definition of XBOOTLDR partition type moved to gpt.h
Changes to gpart utility suggested still being tested so not shown
Change now includes update allowing creation of xbootldr partition type with gpart (without specifying uuid).
System with change boots normally (the actual table is in the kernel, not the gpart utility).
Gpart utility now creates and reports on xbootldr partition type as well as existing types (about 20 tested on a memory disk).
| usr.bin/mkimg/scheme.c | ||
|---|---|---|
| 63 | Doesn't have to be fixed here, but I'm surprised these aren't listed in the mkimg(1) man page or in the usage message... | |