-
Notifications
You must be signed in to change notification settings - Fork 149
blockdev: find esp based on MBR or GPT
#1773
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
Conversation
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We already have this one the DPS spec too as pub const ESP
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.
Yes, simply do not want this to include more dependency, so I copy it from DPS.
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.
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! |
See #1736 (comment)