File: core-in-fs.patch

package info (click to toggle)
grub2 2.12-9
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • 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 (44 lines) | stat: -rw-r--r-- 1,162 bytes parent folder | download | duplicates (3)
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
From: Colin Watson <cjwatson@debian.org>
Date: Mon, 13 Jan 2014 12:12:51 +0000
Subject: Write marker if core.img was written to filesystem

The Debian bug reporting script includes a warning in this case.

Patch-Name: core-in-fs.patch
---
 util/setup.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/util/setup.c b/util/setup.c
index 87a889f..257b9bc 100644
--- a/util/setup.c
+++ b/util/setup.c
@@ -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.
  *
@@ -670,6 +672,8 @@ SETUP (const char *dir,
 #endif
     grub_free (sectors);
 
+    unlink (DEFAULT_DIRECTORY "/" CORE_IMG_IN_FS);
+
     goto finish;
   }
 
@@ -711,6 +715,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.  */