Skip to content

Commit

Permalink
install/ppc64le: Also handle MBR partitions
Browse files Browse the repository at this point in the history
These may exist in the wild, even if we want to encourage GPT
in the future.

Closes: containers#742
Signed-off-by: Colin Walters <[email protected]>
  • Loading branch information
cgwalters committed Jul 31, 2024
1 parent 2fbda2a commit b3aa898
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/src/bootloader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ use crate::task::Task;
pub(crate) const EFI_DIR: &str = "efi";
pub(crate) const PREPBOOT_GUID: &str = "9E1A2D38-C612-4316-AA26-8B49521E5A8B";
pub(crate) const PREPBOOT_LABEL: &str = "PowerPC-PReP-boot";
#[cfg(target_arch = "powerpc64")]
/// We make a best-effort to support MBR partitioning too.
pub(crate) const PREPBOOT_MBR_TYPE: &str = "41";

/// Find the device to pass to bootupd. Only on powerpc64 right now
/// we explicitly find one with a specific label.
Expand All @@ -20,7 +23,7 @@ fn get_bootupd_device(device: &PartitionTable) -> Result<Utf8PathBuf> {
return device
.partitions
.iter()
.find(|p| p.parttype.as_str() == PREPBOOT_GUID)
.find(|p| matches!(p.parttype.as_str(), PREPBOOT_GUID | PREPBOOT_MBR_TYPE))
.ok_or_else(|| {
anyhow::anyhow!("Failed to find PReP partition with GUID {PREPBOOT_GUID}")
})
Expand Down

0 comments on commit b3aa898

Please sign in to comment.