dcavalca / rpms / grub2

Forked from rpms/grub2 3 years ago
Clone

Blame SOURCES/0034-use-MODULE_FILES-for-genemuinit-instead-of-MOD_FILES.patch

f725e3
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
f725e3
From: Andrey Borzenkov <arvidjaar@gmail.com>
f725e3
Date: Sat, 18 Jan 2014 23:15:40 +0400
f725e3
Subject: [PATCH] use MODULE_FILES for genemuinit* instead of MOD_FILES
f725e3
f725e3
MinGW native nm does not support ELF binaries.
f725e3
---
f725e3
 ChangeLog                     | 8 ++++++++
f725e3
 grub-core/Makefile.am         | 8 ++++----
f725e3
 grub-core/genemuinit.sh       | 4 ++--
f725e3
 grub-core/genemuinitheader.sh | 4 ++--
f725e3
 4 files changed, 16 insertions(+), 8 deletions(-)
f725e3
f725e3
diff --git a/ChangeLog b/ChangeLog
f725e3
index 9360345efc2..4688ff4e6d3 100644
f725e3
--- a/ChangeLog
f725e3
+++ b/ChangeLog
f725e3
@@ -1,3 +1,11 @@
f725e3
+2014-01-18  Andrey Borzenkov <arvidjaar@gmail.com>
f725e3
+
f725e3
+	* grub-core/Makefile.am: Build grub_emu_init.[ch] from MODULE_FILES
f725e3
+	instead of MOD_FILES.
f725e3
+	* grub-core/genemuinit.sh: Simplify stripping of suffix so it works
f725e3
+	both with and without .exe.
f725e3
+	* grub-core/genemuinitheader.sh: Same.
f725e3
+
f725e3
 2014-01-18  Vladimir Serbinenko  <phcoder@gmail.com>
f725e3
 
f725e3
 	* util/grub-install.c: Fix a typo.
f725e3
diff --git a/grub-core/Makefile.am b/grub-core/Makefile.am
f725e3
index 826b3dd7c1a..5c087c83b8f 100644
f725e3
--- a/grub-core/Makefile.am
f725e3
+++ b/grub-core/Makefile.am
f725e3
@@ -294,12 +294,12 @@ grub_emu-grub_emu_init.$(OBJEXT):grub_emu_init.h
f725e3
 kern/emu/grub_emu_dyn-main.$(OBJEXT):grub_emu_init.h
f725e3
 grub_emu_dyn-grub_emu_init.$(OBJEXT):grub_emu_init.h
f725e3
 
f725e3
-grub_emu_init.h: genemuinitheader.sh $(MOD_FILES)
f725e3
-	rm -f $@; echo $(MOD_FILES) | sh $(srcdir)/genemuinitheader.sh $(TARGET_NM) > $@
f725e3
+grub_emu_init.h: genemuinitheader.sh $(MODULE_FILES)
f725e3
+	rm -f $@; echo $(MODULE_FILES) | sh $(srcdir)/genemuinitheader.sh $(TARGET_NM) > $@
f725e3
 CLEANFILES += grub_emu_init.h
f725e3
 
f725e3
-grub_emu_init.c: grub_emu_init.h genemuinit.sh $(MOD_FILES)
f725e3
-	rm -f $@; echo $(MOD_FILES) | sh $(srcdir)/genemuinit.sh $(TARGET_NM) > $@
f725e3
+grub_emu_init.c: grub_emu_init.h genemuinit.sh $(MODULE_FILES)
f725e3
+	rm -f $@; echo $(MODULE_FILES) | sh $(srcdir)/genemuinit.sh $(TARGET_NM) > $@
f725e3
 CLEANFILES += grub_emu_init.c
f725e3
 endif
f725e3
 
f725e3
diff --git a/grub-core/genemuinit.sh b/grub-core/genemuinit.sh
f725e3
index 45c15ecb9f4..8c6bb1c18ff 100644
f725e3
--- a/grub-core/genemuinit.sh
f725e3
+++ b/grub-core/genemuinit.sh
f725e3
@@ -47,7 +47,7 @@ EOF
f725e3
 read mods
f725e3
 for line in $mods; do
f725e3
   if ${nm} --defined-only -P -p ${line} | grep grub_mod_init > /dev/null; then
f725e3
-      echo "grub_${line}_init ();" | sed 's,\.mod,,g;'
f725e3
+      echo "grub_${line%%.*}_init ();"
f725e3
   fi
f725e3
 done
f725e3
 
f725e3
@@ -63,7 +63,7 @@ EOF
f725e3
 
f725e3
 for line in $mods; do
f725e3
   if ${nm} --defined-only -P -p ${line} | grep grub_mod_fini > /dev/null; then
f725e3
-      echo "grub_${line}_fini ();" | sed 's,\.mod,,g;'
f725e3
+      echo "grub_${line%%.*}_fini ();"
f725e3
   fi
f725e3
 done
f725e3
 
f725e3
diff --git a/grub-core/genemuinitheader.sh b/grub-core/genemuinitheader.sh
f725e3
index 6b83f599317..a99a15d06f1 100644
f725e3
--- a/grub-core/genemuinitheader.sh
f725e3
+++ b/grub-core/genemuinitheader.sh
f725e3
@@ -44,9 +44,9 @@ EOF
f725e3
 read mods
f725e3
 for line in $mods; do
f725e3
   if ${nm} --defined-only -P -p ${line} | grep grub_mod_init > /dev/null; then
f725e3
-      echo "void grub_${line}_init (void);" | sed 's,\.mod,,g;'
f725e3
+      echo "void grub_${line%%.*}_init (void);"
f725e3
   fi
f725e3
   if ${nm} --defined-only -P -p ${line} | grep grub_mod_fini > /dev/null; then
f725e3
-      echo "void grub_${line}_fini (void);" | sed 's,\.mod,,g;'
f725e3
+      echo "void grub_${line%%.*}_fini (void);"
f725e3
   fi
f725e3
 done