Skip to content

Conversation

@HuijingHei
Copy link
Contributor

As Fedora IoT on the Raspberry Pi 3 is using MBR by default, we need to find ESP partition via bootable.
See coreos/bootupd#1019

@bootc-bot bootc-bot bot requested a review from gursewak1997 November 6, 2025 08:07
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request correctly adds support for identifying bootable partitions, which is necessary for MBR partition tables. The changes to the data structures and the new helper functions are well-implemented. I've included one suggestion to improve the new test case to make it more robust and idiomatic.

@HuijingHei HuijingHei force-pushed the blockdev-partitions-add-bootable branch 2 times, most recently from babb20d to 4a7c8fd Compare November 6, 2025 08:12
As Fedora IoT on the Raspberry Pi 3 is using `MBR` by default, we
need to find ESP partition via `bootable`.
See coreos/bootupd#1019

Signed-off-by: Huijing Hei <[email protected]>
@HuijingHei HuijingHei force-pushed the blockdev-partitions-add-bootable branch from 4a7c8fd to 14f5f0a Compare November 6, 2025 08:20
@cgwalters
Copy link
Collaborator

Nothing wrong with adding a bootable property, but I don't think that's how we should find the ESP - per Wikipedia

The globally unique identifier (GUID) for the EFI system partition in the GUID Partition Table (GPT) scheme is C12A7328-F81F-11D2-BA4B-00A0C93EC93B, while its ID in the master boot record (MBR) partition-table scheme is 0xEF.

So we should search for 0xEF instead.

@cgwalters cgwalters merged commit 4b83fa3 into bootc-dev:main Nov 6, 2025
37 checks passed
@HuijingHei HuijingHei deleted the blockdev-partitions-add-bootable branch November 6, 2025 13:51
@HuijingHei
Copy link
Contributor Author

Nothing wrong with adding a bootable property, but I don't think that's how we should find the ESP - per Wikipedia

The globally unique identifier (GUID) for the EFI system partition in the GUID Partition Table (GPT) scheme is C12A7328-F81F-11D2-BA4B-00A0C93EC93B, while its ID in the master boot record (MBR) partition-table scheme is 0xEF.

So we should search for 0xEF instead.

Agree, find bootable looks more easier, and 0xEF is more accurate, will add it later, thank you for the pointer!

@cgwalters
Copy link
Collaborator

So we should define a const ESP_ID_MBR and use that both in bootupd and bootc, and move the esp_in() code down to blockdev.rs and have it detect MBR vs GPT.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants