From 84442e366d27113d23a770cc17d145b6042e95d7 Mon Sep 17 00:00:00 2001 From: Rolv Apneseth Date: Mon, 18 May 2026 09:58:18 +0100 Subject: [PATCH 1/2] mdraid: fix metadata 1.0 detection in userspace utilities on IEEE1275 The powerpc guard in grub_mdraid_detect skips metadata 1.0 to avoid a firmware block issue, but also ends up applying to userspace utilities where reads will be going through the kernel. Extend the conditional with !defined(GRUB_UTIL) so utilities like grub-install can detect metadata 1.0 arrays. Signed-off-by: Rolv Apneseth --- grub-core/disk/mdraid1x_linux.c | 2 +- grub-core/disk/mdraid_linux.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/grub-core/disk/mdraid1x_linux.c b/grub-core/disk/mdraid1x_linux.c index 3b5b6c4234..f4cb048b42 100644 --- a/grub-core/disk/mdraid1x_linux.c +++ b/grub-core/disk/mdraid1x_linux.c @@ -130,7 +130,7 @@ grub_mdraid_detect (grub_disk_t disk, struct grub_diskfilter_vg *array; char *uuid; -#ifdef __powerpc__ +#if defined(__powerpc__) && !defined(GRUB_UTIL) /* Firmware will yell at us for reading too far. */ if (minor_version == 0) continue; diff --git a/grub-core/disk/mdraid_linux.c b/grub-core/disk/mdraid_linux.c index 98fcfb1be6..79145f8e16 100644 --- a/grub-core/disk/mdraid_linux.c +++ b/grub-core/disk/mdraid_linux.c @@ -189,7 +189,7 @@ grub_mdraid_detect (grub_disk_t disk, grub_uint32_t level; struct grub_diskfilter_vg *ret; -#ifdef __powerpc__ +#if defined(__powerpc__) && !defined(GRUB_UTIL) /* Firmware will yell at us for reading too far. */ return NULL; #endif From 01d7dfc89bc40b16363d6a5a5fe6089866706e80 Mon Sep 17 00:00:00 2001 From: Rolv Apneseth Date: Mon, 18 May 2026 10:07:03 +0100 Subject: [PATCH 2/2] grub-install: use search.fs_uuid for RAID1 on IEEE1275 On IEEE1275, grub-install hardcodes an mduuid prefix for RAID abstractions, requiring array assembly at boot. This fails on metadata 1.0 partitions because detection is skipped due to a firmware issue. Since RAID1 mirrors are individually readable, use search.fs_uuid on IEEE1275 to find the boot filesystem on any member partition and avoid requiring array assembly. Signed-off-by: Rolv Apneseth --- util/grub-install.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/util/grub-install.c b/util/grub-install.c index 314b6143b8..746fc73466 100644 --- a/util/grub-install.c +++ b/util/grub-install.c @@ -1422,7 +1422,12 @@ main (int argc, char *argv[]) debug_image); } - if (!have_abstractions) + int is_ieee1275_raid1 = have_abstractions + && (platform == GRUB_INSTALL_PLATFORM_POWERPC_IEEE1275) + && grub_dev->disk + && probe_raid_level (grub_dev->disk) == 1; + + if (!have_abstractions || is_ieee1275_raid1) { if ((disk_module && grub_strcmp (disk_module, "biosdisk") != 0) || grub_drives[1]