nalika / rpms / grub2

Forked from rpms/grub2 2 years ago
Clone

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

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