]> git.proxmox.com Git - grub2.git/blob - debian/patches/grub-legacy-0-based-partitions.patch
New upstream release candidate (2.04~rc1)
[grub2.git] / debian / patches / grub-legacy-0-based-partitions.patch
1 From 6385ffa66da8d9c0134b62635bfb5256f9384cdb Mon Sep 17 00:00:00 2001
2 From: Robert Millan <rmh@aybabtu.com>
3 Date: Mon, 13 Jan 2014 12:12:53 +0000
4 Subject: Support running grub-probe in grub-legacy's update-grub
5
6 Author: Colin Watson <cjwatson@debian.org>
7 Forwarded: not-needed
8 Last-Update: 2013-12-25
9
10 Patch-Name: grub-legacy-0-based-partitions.patch
11 ---
12 util/getroot.c | 14 ++++++++++++++
13 1 file changed, 14 insertions(+)
14
15 diff --git a/util/getroot.c b/util/getroot.c
16 index 847406fba..cdd41153c 100644
17 --- a/util/getroot.c
18 +++ b/util/getroot.c
19 @@ -245,6 +245,20 @@ find_partition (grub_disk_t dsk __attribute__ ((unused)),
20
21 if (ctx->start == part_start)
22 {
23 + /* This is dreadfully hardcoded, but there's a limit to what GRUB
24 + Legacy was able to deal with anyway. */
25 + if (getenv ("GRUB_LEGACY_0_BASED_PARTITIONS"))
26 + {
27 + if (partition->parent)
28 + /* Probably a BSD slice. */
29 + ctx->partname = xasprintf ("%d,%d", partition->parent->number,
30 + partition->number + 1);
31 + else
32 + ctx->partname = xasprintf ("%d", partition->number);
33 +
34 + return 1;
35 + }
36 +
37 ctx->partname = grub_partition_get_name (partition);
38 return 1;
39 }