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

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