File: install-stage2-confusion.patch

package info (click to toggle)
grub2 2.12-9
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie, trixie-updates
  • size: 70,780 kB
  • sloc: ansic: 424,740; asm: 16,228; sh: 9,525; cpp: 2,095; makefile: 1,590; python: 1,468; sed: 431; lex: 393; yacc: 268; awk: 85; lisp: 54; perl: 31
file content (45 lines) | stat: -rw-r--r-- 1,219 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
From: Colin Watson <cjwatson@debian.org>
Date: Mon, 13 Jan 2014 12:12:58 +0000
Subject: If GRUB Legacy is still around, tell packaging to ignore it

Bug-Debian: http://bugs.debian.org/586143
Forwarded: not-needed
Last-Update: 2021-09-24

Patch-Name: install-stage2-confusion.patch
---
 util/grub-install.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/util/grub-install.c b/util/grub-install.c
index 7dc5657..dc3813b 100644
--- a/util/grub-install.c
+++ b/util/grub-install.c
@@ -42,6 +42,7 @@
 #include <grub/emu/config.h>
 #include <grub/util/ofpath.h>
 #include <grub/hfsplus.h>
+#include <grub/emu/hostfile.h>
 
 #include <string.h>
 
@@ -1776,6 +1777,19 @@ main (int argc, char *argv[])
 
 	    grub_set_install_backup_ponr ();
 	  }
+
+	/* If vestiges of GRUB Legacy still exist, tell the Debian packaging
+	   that they can ignore them.  */
+	if (!rootdir && grub_util_is_regular ("/boot/grub/stage2") &&
+	    grub_util_is_regular ("/boot/grub/menu.lst"))
+	  {
+	    grub_util_fd_t fd;
+
+	    fd = grub_util_fd_open ("/boot/grub/grub2-installed",
+				    GRUB_UTIL_FD_O_WRONLY);
+	    grub_util_fd_close (fd);
+	  }
+
 	break;
       }
     case GRUB_INSTALL_PLATFORM_SPARC64_IEEE1275: