summaryrefslogtreecommitdiffstats
path: root/debian/patches/grub-legacy-0-based-partitions.patch
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 16:29:52 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 16:29:52 +0000
commitca67b09c015d4af3ae3cce12aa72e60941dbb8b5 (patch)
treeb7316d7b06c373e08dabb79a2c866c568e08f49e /debian/patches/grub-legacy-0-based-partitions.patch
parentAdding upstream version 2.06. (diff)
downloadgrub2-ca67b09c015d4af3ae3cce12aa72e60941dbb8b5.tar.xz
grub2-ca67b09c015d4af3ae3cce12aa72e60941dbb8b5.zip
Adding debian version 2.06-13+deb12u1.debian/2.06-13+deb12u1debian
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'debian/patches/grub-legacy-0-based-partitions.patch')
-rw-r--r--debian/patches/grub-legacy-0-based-partitions.patch39
1 files changed, 39 insertions, 0 deletions
diff --git a/debian/patches/grub-legacy-0-based-partitions.patch b/debian/patches/grub-legacy-0-based-partitions.patch
new file mode 100644
index 0000000..31dc3c1
--- /dev/null
+++ b/debian/patches/grub-legacy-0-based-partitions.patch
@@ -0,0 +1,39 @@
+From ae648ba6160a334707f8a8fc0768ec1bc60c4442 Mon Sep 17 00:00:00 2001
+From: Robert Millan <rmh@aybabtu.com>
+Date: Mon, 13 Jan 2014 12:12:53 +0000
+Subject: Support running grub-probe in grub-legacy's update-grub
+
+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 | 14 ++++++++++++++
+ 1 file changed, 14 insertions(+)
+
+diff --git a/util/getroot.c b/util/getroot.c
+index a5eaa64fd..6ae35ecaa 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;
+ }