From b3aa898f7f6ac20df2f4fc05413b0d81ab46fb9a Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Wed, 31 Jul 2024 14:51:02 -0400 Subject: [PATCH] install/ppc64le: Also handle MBR partitions These may exist in the wild, even if we want to encourage GPT in the future. Closes: https://github.com/containers/bootc/issues/742 Signed-off-by: Colin Walters --- lib/src/bootloader.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/src/bootloader.rs b/lib/src/bootloader.rs index d73577f5..e90b365e 100644 --- a/lib/src/bootloader.rs +++ b/lib/src/bootloader.rs @@ -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. @@ -20,7 +23,7 @@ fn get_bootupd_device(device: &PartitionTable) -> Result { 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}") })