If GRUB Legacy is still around, tell packaging to ignore it
authorColin Watson <cjwatson@debian.org>
Mon, 13 Jan 2014 12:12:58 +0000 (12:12 +0000)
committerFelix Zielcke <fzielcke@z-51.de>
Wed, 11 Jun 2025 15:42:34 +0000 (17:42 +0200)
Bug-Debian: http://bugs.debian.org/586143
Forwarded: not-needed
Last-Update: 2021-09-24

Patch-Name: install-stage2-confusion.patch

Gbp-Pq: Name install-stage2-confusion.patch

util/grub-install.c

index 7dc5657bb671c848dfeda3ccd9b970b43f4bed03..dc3813b24671831f52e075c388044de73e6af49b 100644 (file)
@@ -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: