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

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