[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH]: grub: Allow to control objcopy '-B' argument from foo.rmk files
From: |
David Miller |
Subject: |
[PATCH]: grub: Allow to control objcopy '-B' argument from foo.rmk files. |
Date: |
Sat, 11 Apr 2009 01:08:31 -0700 (PDT) |
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 <address@hidden>
* 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}
address@hidden: #{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
- [PATCH]: grub: Allow to control objcopy '-B' argument from foo.rmk files.,
David Miller <=