Blame SOURCES/0488-powerpc-fix-prefix-signed-grub-special-case-for-Powe.patch

f20682
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
f20682
From: Daniel Axtens <dja@axtens.net>
f20682
Date: Mon, 16 Aug 2021 16:01:47 +1000
f20682
Subject: [PATCH] powerpc: fix prefix + signed grub special case for PowerVM
f20682
f20682
Mea culpa: when testing the PowerPC special case for signed grub, I
f20682
assumed qemu and PowerVM would behave identically. This was wrong, and
f20682
with hindsight a pretty dumb error.
f20682
f20682
This fixes it. This time, I am actually testing on PowerVM.
f20682
f20682
Signed-off-by: Daniel Axtens <dja@axtens.net>
f20682
---
f20682
 grub-core/kern/main.c | 15 +++++++++++++--
f20682
 1 file changed, 13 insertions(+), 2 deletions(-)
f20682
f20682
diff --git a/grub-core/kern/main.c b/grub-core/kern/main.c
f20682
index 25dbcfef1f6..40a709117f1 100644
f20682
--- a/grub-core/kern/main.c
f20682
+++ b/grub-core/kern/main.c
f20682
@@ -235,9 +235,20 @@ grub_set_prefix_and_root (void)
f20682
 	    which will have now been extended to device=$fwdisk,partition
f20682
 	    and path=/path
f20682
 
f20682
-	 So we only need to act if device = ieee1275/disk exactly.
f20682
+	  - PowerVM will give us device names like
f20682
+	    ieee1275//vdevice/v-scsi@3000006c/disk@8100000000000000
f20682
+	    and we don't want to try to encode some sort of truth table about
f20682
+	    what sorts of paths represent disks with partition tables and those
f20682
+	    without partition tables.
f20682
+
f20682
+	 So we act unless there is a comma in the device, which would indicate
f20682
+	 a partition has already been specified.
f20682
+
f20682
+	 (If we only have a path, the code in normal to discover config files
f20682
+	 will try both without partitions and then with any partitions so we
f20682
+	 will cover both CDs and HDs.)
f20682
        */
f20682
-      if (grub_strncmp (device, "ieee1275/disk", 14) == 0)
f20682
+      if (grub_strchr (device, ',') == NULL)
f20682
         grub_env_set ("prefix", path);
f20682
       else
f20682
 #endif