]> git.proxmox.com Git - grub2.git/commitdiff
Support running grub-probe in grub-legacy's update-grub
authorRobert Millan <rmh@aybabtu.com>
Mon, 13 Jan 2014 12:12:53 +0000 (12:12 +0000)
committerColin Watson <cjwatson@debian.org>
Fri, 24 May 2019 22:16:30 +0000 (23:16 +0100)
Author: Colin Watson <cjwatson@debian.org>
Forwarded: not-needed
Last-Update: 2013-12-25

Patch-Name: grub-legacy-0-based-partitions.patch

util/getroot.c

index 847406fbab0e8d6fefb70cf6ed5c15fa9ba0b6b6..cdd41153c5bb52f13734e09ef8a9e9817cad058c 100644 (file)
@@ -245,6 +245,20 @@ find_partition (grub_disk_t dsk __attribute__ ((unused)),
 
   if (ctx->start == part_start)
     {
+      /* This is dreadfully hardcoded, but there's a limit to what GRUB
+         Legacy was able to deal with anyway.  */
+      if (getenv ("GRUB_LEGACY_0_BASED_PARTITIONS"))
+       {
+         if (partition->parent)
+           /* Probably a BSD slice.  */
+           ctx->partname = xasprintf ("%d,%d", partition->parent->number,
+                                      partition->number + 1);
+         else
+           ctx->partname = xasprintf ("%d", partition->number);
+
+         return 1;
+       }
+
       ctx->partname = grub_partition_get_name (partition);
       return 1;
     }