nalika / rpms / grub2

Forked from rpms/grub2 2 years ago
Clone

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

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