]> git.proxmox.com Git - grub2.git/commitdiff
Write marker if core.img was written to filesystem
authorColin Watson <cjwatson@debian.org>
Mon, 13 Jan 2014 12:12:51 +0000 (12:12 +0000)
committerColin Watson <cjwatson@debian.org>
Tue, 9 Jul 2019 10:42:33 +0000 (11:42 +0100)
The Debian bug reporting script includes a warning in this case.

Patch-Name: core-in-fs.patch

util/setup.c

index 6f88f3cc43f14921079cd4177d147e3278aa89f7..fbdf2fcc59dd1bb504c3b33113612f0b11120d08 100644 (file)
@@ -58,6 +58,8 @@
 
 #include <errno.h>
 
+#define CORE_IMG_IN_FS         "setup_left_core_image_in_filesystem"
+
 /* On SPARC this program fills in various fields inside of the 'boot' and 'core'
  * image files.
  *
@@ -666,6 +668,8 @@ SETUP (const char *dir,
 #endif
     grub_free (sectors);
 
+    unlink (DEFAULT_DIRECTORY "/" CORE_IMG_IN_FS);
+
     goto finish;
   }
 
@@ -707,6 +711,10 @@ unable_to_embed:
   /* The core image must be put on a filesystem unfortunately.  */
   grub_util_info ("will leave the core image on the filesystem");
 
+  fp = grub_util_fd_open (DEFAULT_DIRECTORY "/" CORE_IMG_IN_FS,
+                         GRUB_UTIL_FD_O_WRONLY);
+  grub_util_fd_close (fp);
+
   grub_util_biosdisk_flush (root_dev->disk);
 
   /* Clean out the blocklists.  */