Skip to content

Commit

Permalink
Merge pull request #745 from cgwalters/ppc64le-handle-mbr
Browse files Browse the repository at this point in the history
install/ppc64le: Also handle MBR partitions
  • Loading branch information
cgwalters committed Aug 1, 2024
2 parents 0610971 + b3aa898 commit ee11428
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 ee11428

Please sign in to comment.