Blame SOURCES/0277-remove-temporary-.bin-files-kernel-and-modules.patch

f725e3
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
f725e3
From: Andrey Borzenkov <arvidjaar@gmail.com>
f725e3
Date: Thu, 31 Dec 2015 23:00:25 +0300
f725e3
Subject: [PATCH] remove temporary .bin files (kernel and modules)
f725e3
f725e3
---
f725e3
 gentpl.py              | 2 ++
f725e3
 grub-core/genmod.sh.in | 2 +-
f725e3
 2 files changed, 3 insertions(+), 1 deletion(-)
f725e3
f725e3
diff --git a/gentpl.py b/gentpl.py
f725e3
index 58430fcd236..c17a18b0ea0 100644
f725e3
--- a/gentpl.py
f725e3
+++ b/gentpl.py
f725e3
@@ -723,9 +723,11 @@ def kernel(defn, platform):
f725e3
 """if test x$(TARGET_APPLE_LINKER) = x1; then \
f725e3
   $(TARGET_STRIP) -S -x $(""" + cname(defn) + """) -o $@.bin $<; \
f725e3
   $(TARGET_OBJCONV) -f$(TARGET_MODULE_FORMAT) -nr:_grub_mod_init:grub_mod_init -nr:_grub_mod_fini:grub_mod_fini -ed2022 -ed2016 -wd1106 -nu -nd $@.bin $@; \
f725e3
+  rm -f $@.bin; \
f725e3
    elif test ! -z '$(TARGET_OBJ2ELF)'; then \
f725e3
      """  + "$(TARGET_STRIP) $(" + cname(defn) + "_STRIPFLAGS) -o $@.bin $< && \
f725e3
      $(TARGET_OBJ2ELF) $@.bin $@ || (rm -f $@; rm -f $@.bin; exit 1); \
f725e3
+     rm -f $@.bin; \
f725e3
 else """  + "$(TARGET_STRIP) $(" + cname(defn) + "_STRIPFLAGS) -o $@ $<; \
f725e3
 fi"""))
f725e3
 
f725e3
diff --git a/grub-core/genmod.sh.in b/grub-core/genmod.sh.in
f725e3
index f74edd55181..ca2e59d5c42 100644
f725e3
--- a/grub-core/genmod.sh.in
f725e3
+++ b/grub-core/genmod.sh.in
f725e3
@@ -91,7 +91,7 @@ else
f725e3
 	    -nr:_grub_mod_init:grub_mod_init \
f725e3
 	    -nr:_grub_mod_fini:grub_mod_fini \
f725e3
 	    -wd1106 -nu -nd $tmpfile.bin $tmpfile || exit 1
f725e3
-	rm -f $name.bin
f725e3
+	rm -f $tmpfile.bin
f725e3
 fi
f725e3
 if test x@platform@ != xemu; then
f725e3
     ./build-grub-module-verifier $tmpfile @target_cpu@