]> git.proxmox.com Git - grub2.git/commitdiff
[PATCH] sparc64: Fix BIOS Boot Partition support
authorJames Clarke <jrtc27@jrtc27.com>
Thu, 18 Jul 2019 12:31:55 +0000 (14:31 +0200)
committerColin Watson <cjwatson@debian.org>
Sat, 7 Mar 2020 12:21:23 +0000 (12:21 +0000)
Currently, gpt_offset is uninitialised when using a BIOS Boot Partition
but is used unconditionally inside save_blocklists. Instead, ensure it
is always initialised to 0 (note that there is already separate code to
do the equivalent adjustment after we call save_blocklists on this code
path).

This patch has been tested on a T5-2 LDOM.

Signed-off-by: James Clarke <jrtc27@jrtc27.com>
Tested-by: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
Reviewed-by: Vladimir Serbinenko <phcoder@gmail.com>
Reviewed-by: Eric Snowberg <eric.snowberg@oracle.com>
Origin: upstream, https://git.savannah.gnu.org/cgit/grub.git/commit/?id=4e75b2ae313b13b5bfb54cc5e5c53368d6eb2a08
Bug-Debian: https://bugs.debian.org/931969
Last-Update: 2019-08-06

Patch-Name: sparc64-fix-bios-boot-partition-support.patch

util/setup.c

index fbdf2fcc59dd1bb504c3b33113612f0b11120d08..512977000d5d88cbaf705d05681341d0f49d8ec0 100644 (file)
@@ -272,6 +272,9 @@ SETUP (const char *dir,
 #ifdef GRUB_SETUP_BIOS
   bl.current_segment =
     GRUB_BOOT_I386_PC_KERNEL_SEG + (GRUB_DISK_SECTOR_SIZE >> 4);
+#endif
+#ifdef GRUB_SETUP_SPARC64
+  bl.gpt_offset = 0;
 #endif
   bl.last_length = 0;
 
@@ -738,7 +741,6 @@ unable_to_embed:
 #ifdef GRUB_SETUP_SPARC64
   {
     grub_partition_t container = root_dev->disk->partition;
-    bl.gpt_offset = 0;
 
     if (grub_strstr (container->partmap->name, "gpt"))
       bl.gpt_offset = grub_partition_get_start (container);