-
Notifications
You must be signed in to change notification settings - Fork 77
sfdisk: check for extended partitions with MBR #2120
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
Note: This is required for the automotive project to build MBR based rpi4 bootc images. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let me preface with: it's been a while since I thought about extended partitions. Are the additional partitions actually contained inside the extended partition or do the follow the extended partition and the extended partition only contains the information about the (potentially multiple) following partition?
If the former then I think it'd be nicer to len(o.Partitions) - len(PartitionsThatAreExtended). If the latter then, while I can probably make up more validation, we can keep it as is :)
Separate question for @alexlarsson what partition layout are you aiming for that you need more than 4 on an RPi4? Fedora images usually have 3 (or 2).
|
The (physical) extended partition will cover the remaining space of the disk and the logical partitions are within it. There is however not really a "this partition is extended" info in the json format, so your example isn't that easy to do. I think what we want to check is that either the len is <= 4, or there is an extended partition in the first four slots. |
When we use UKIBoot we need at least these partitions: EFI, ukiboot_a, ukiboot_b, ukibootctl, rootfs. Then additionally we may need a separate /var. |
|
@supakeen and the problem we have is that the bootROM for many automotive grade SoCs only know how to parse MBR and not GPT. Albert mentioned the rpi4 but for that the first stage firmware can actually be updated so is no longer a limitation, but other platforms (e.g,: TI AM69) has the first stage firmware in a ROM and can't be updated. |
So iiuc it should only check/iterate the first four partitions in the validate loop? |
When validating a `dos` partition (MBR) with more than 4 partitions, check also if there is an extended partition type (0f) before actually failing. The updated check verifies that len(partitions) <= 4 or there is an extended partition in the first four slots. Signed-off-by: Albert Esteve <[email protected]>
18a2f97 to
8c30a56
Compare
supakeen
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks OK to me, @achilleas-k is most knowledgeable about this part so let's see what he thinks too.
When validating a
dospartition (MBR) with more than 4 partitions, check also if there is an extended partition type (0f) before actually failing.