All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH]: grub: Allow to control objcopy '-B' argument from foo.rmk files.
@ 2009-04-11  8:08 David Miller
  2009-04-11 10:23 ` Yoshinori K. Okuji
  2009-04-13 14:29 ` Robert Millan
  0 siblings, 2 replies; 6+ messages in thread
From: David Miller @ 2009-04-11  8:08 UTC (permalink / raw)
  To: grub-devel


This patch allows a platform to specify the image file output
format, it also adds the --strip-unneeded option to the objcopy
invocation as well.

I've left the i386-pc.mk portion of this patch out of the posting,
but rest assured I will check that part in once this gets an ACK :-)

2009-04-11  David S. Miller  <davem@davemloft.net>

	* genmk.rb: Add more flexible image type specification, also
	pass --strip-unneeded to objcopy.
	* conf/i386-pc.rmk: Use *_IMG_FMT.
	* conf/i386-pc.mk: Rebuilt.
---
 conf/i386-pc.mk  |   18 ++++++++++++------
 conf/i386-pc.rmk |    6 ++++++
 genmk.rb         |    2 +-
 3 files changed, 19 insertions(+), 7 deletions(-)

diff --git a/conf/i386-pc.rmk b/conf/i386-pc.rmk
index 7dfb854..b4f1353 100644
--- a/conf/i386-pc.rmk
+++ b/conf/i386-pc.rmk
@@ -17,26 +17,31 @@ pkglib_IMAGES = boot.img diskboot.img kernel.img pxeboot.img lnxboot.img \
 boot_img_SOURCES = boot/i386/pc/boot.S
 boot_img_ASFLAGS = $(COMMON_ASFLAGS)
 boot_img_LDFLAGS = $(COMMON_LDFLAGS) $(TARGET_IMG_LDFLAGS) -Wl,-Ttext,7C00
+boot_img_IMG_FMT = binary
 
 # For pxeboot.img
 pxeboot_img_SOURCES = boot/i386/pc/pxeboot.S
 pxeboot_img_ASFLAGS = $(COMMON_ASFLAGS)
 pxeboot_img_LDFLAGS = $(COMMON_LDFLAGS) $(TARGET_IMG_LDFLAGS) -Wl,-Ttext,7C00
+pxeboot_img_IMG_FMT = binary
 
 # For diskboot.img.
 diskboot_img_SOURCES = boot/i386/pc/diskboot.S
 diskboot_img_ASFLAGS = $(COMMON_ASFLAGS)
 diskboot_img_LDFLAGS = $(COMMON_LDFLAGS) $(TARGET_IMG_LDFLAGS) -Wl,-Ttext,8000
+diskboot_img_IMG_FMT = binary
 
 # For lnxboot.img.
 lnxboot_img_SOURCES = boot/i386/pc/lnxboot.S
 lnxboot_img_ASFLAGS = $(COMMON_ASFLAGS)
 lnxboot_img_LDFLAGS = $(COMMON_LDFLAGS) $(TARGET_IMG_LDFLAGS) -Wl,-Ttext,6000
+lnxboot_img_IMG_FMT = binary
 
 # For cdboot.img.
 cdboot_img_SOURCES = boot/i386/pc/cdboot.S
 cdboot_img_ASFLAGS = $(COMMON_ASFLAGS)
 cdboot_img_LDFLAGS = $(COMMON_LDFLAGS) $(TARGET_IMG_LDFLAGS) -Wl,-Ttext,7C00
+cdboot_img_IMG_FMT = binary
 
 # For kernel.img.
 kernel_img_SOURCES = kern/i386/pc/startup.S kern/main.c kern/device.c \
@@ -60,6 +65,7 @@ kernel_img_HEADERS = boot.h cache.h device.h disk.h dl.h elf.h elfload.h \
 kernel_img_CFLAGS = $(COMMON_CFLAGS)
 kernel_img_ASFLAGS = $(COMMON_ASFLAGS)
 kernel_img_LDFLAGS = $(COMMON_LDFLAGS) $(TARGET_IMG_LDFLAGS) -Wl,-Ttext,$(GRUB_MEMORY_MACHINE_LINK_ADDR) $(COMMON_CFLAGS)
+kernel_img_IMG_FMT = binary
 
 MOSTLYCLEANFILES += symlist.c kernel_syms.lst
 DEFSYMFILES += kernel_syms.lst
diff --git a/genmk.rb b/genmk.rb
index 62e5066..c7264db 100644
--- a/genmk.rb
+++ b/genmk.rb
@@ -57,7 +57,7 @@ class Image
 MOSTLYCLEANFILES += #{deps_str}
 
 #{@name}: #{exe}
-	$(OBJCOPY) -O binary -R .note -R .comment -R .note.gnu.build-id $< $@
+	$(OBJCOPY) -O $(#{prefix}_IMG_FMT) --strip-unneeded -R .note -R .comment -R .note.gnu.build-id $< $@
 
 #{exe}: #{objs_str}
 	$(TARGET_CC) -o $@ $^ $(TARGET_LDFLAGS) $(#{prefix}_LDFLAGS)
-- 
1.6.2.2




^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2009-04-13 20:33 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-04-11  8:08 [PATCH]: grub: Allow to control objcopy '-B' argument from foo.rmk files David Miller
2009-04-11 10:23 ` Yoshinori K. Okuji
2009-04-11 11:46   ` David Miller
2009-04-13  6:38     ` David Miller
2009-04-13 14:29 ` Robert Millan
2009-04-13 20:33   ` David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.