From: Robert Millan Date: Mon, 13 Jan 2014 12:12:53 +0000 (+0000) Subject: Support running grub-probe in grub-legacy's update-grub X-Git-Tag: archive/raspbian/2.12-8+rpi1~74 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=93a8bc015cbb7f61c7c9e03bb3725e5b6d59b1d6;p=grub2.git Support running grub-probe in grub-legacy's update-grub Author: Colin Watson Forwarded: not-needed Last-Update: 2013-12-25 Patch-Name: grub-legacy-0-based-partitions.patch Gbp-Pq: Name grub-legacy-0-based-partitions.patch --- diff --git a/util/getroot.c b/util/getroot.c index 75a7d5f..b64b95e 100644 --- a/util/getroot.c +++ b/util/getroot.c @@ -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; }