blockdev: find esp based on MBR or GPT#1773
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces functionality to locate the EFI System Partition (ESP) on both MBR and GPT partitioned disks. This is achieved by adding constants for the respective partition identifiers and a new method, find_partition_of_esp, to the PartitionTable struct. The implementation is accompanied by comprehensive tests covering both MBR (dos) and GPT scenarios, ensuring the new logic is robust. My review found the changes to be functionally correct and well-tested, with one suggestion to improve code reuse and maintainability in the new method.
a29282c to
d94eef8
Compare
crates/blockdev/src/blockdev.rs
Outdated
| pub const ESP_ID_MBR: &[&str] = &["6", "ef"]; | ||
|
|
||
| /// EFI System Partition (ESP) for UEFI boot on GPT | ||
| pub const ESP_ID_GPT: &str = "c12a7328-f81f-11d2-ba4b-00a0c93ec93b"; |
There was a problem hiding this comment.
We already have this one the DPS spec too as pub const ESP
There was a problem hiding this comment.
Yes, simply do not want this to include more dependency, so I copy it from DPS.
There was a problem hiding this comment.
Update this to ESP too.
e09478b to
4226224
Compare
|
Very minor |
See bootc-dev#1736 (comment) Signed-off-by: Huijing Hei <hhei@redhat.com>
4226224 to
ea8ae3c
Compare
Updated, thank you for the kind review! |
Based on updates in bootc-dev/bootc#1773 Fixes: coreos#1019
See #1736 (comment)