Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1Lemtq-0000of-9A for mharc-grub-devel@gnu.org; Wed, 04 Mar 2009 03:56:22 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Lemtp-0000nV-5O for grub-devel@gnu.org; Wed, 04 Mar 2009 03:56:21 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Lemto-0000mz-DT for grub-devel@gnu.org; Wed, 04 Mar 2009 03:56:20 -0500 Received: from [199.232.76.173] (port=33138 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Lemto-0000mn-6D for grub-devel@gnu.org; Wed, 04 Mar 2009 03:56:20 -0500 Received: from [74.93.104.97] (port=45458 helo=sunset.davemloft.net) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Lemtn-0002kW-8r for grub-devel@gnu.org; Wed, 04 Mar 2009 03:56:19 -0500 Received: from localhost (localhost [127.0.0.1]) by sunset.davemloft.net (Postfix) with ESMTP id 32EDC35C04E for ; Wed, 4 Mar 2009 00:56:05 -0800 (PST) Date: Wed, 04 Mar 2009 00:56:05 -0800 (PST) Message-Id: <20090304.005605.137471418.davem@davemloft.net> To: grub-devel@gnu.org From: David Miller X-Mailer: Mew version 6.1 on Emacs 22.1 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Subject: [PATCH]: Allow targets to define boot block image format. X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GRUB 2 List-Id: The development of GRUB 2 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Mar 2009 08:56:21 -0000 This facility will be used on sparc because the bootblocks I will generate will be in A.OUT, so we need to pass that to objcopy instead of 'binary'. 2009-03-04 David S. Miller * genmk.rb: Allow rmk file to specify pkglib_IMAGES object file format in IMG_FMT. * conf/i386-pc.rmk (IMG_FMT): Define. * conf/i386-pc.mk: Regenerate. --- conf/i386-pc.mk | 13 +++++++------ conf/i386-pc.rmk | 1 + genmk.rb | 2 +- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/conf/i386-pc.mk b/conf/i386-pc.mk index 7b56782..98dcbd2 100644 --- a/conf/i386-pc.mk +++ b/conf/i386-pc.mk @@ -11,6 +11,7 @@ COMMON_LDFLAGS = -m32 -nostdlib normal/lexer.c_DEPENDENCIES = grub_script.tab.h # Images. +IMG_FMT = binary pkglib_IMAGES = boot.img diskboot.img kernel.img pxeboot.img lnxboot.img \ cdboot.img @@ -20,7 +21,7 @@ CLEANFILES += boot.img boot.exec boot_img-boot_i386_pc_boot.o MOSTLYCLEANFILES += boot_img-boot_i386_pc_boot.d boot.img: boot.exec - $(OBJCOPY) -O binary -R .note -R .comment -R .note.gnu.build-id $< $@ + $(OBJCOPY) -O $(IMG_FMT) -R .note -R .comment -R .note.gnu.build-id $< $@ boot.exec: boot_img-boot_i386_pc_boot.o $(TARGET_CC) -o $@ $^ $(TARGET_LDFLAGS) $(boot_img_LDFLAGS) @@ -38,7 +39,7 @@ CLEANFILES += pxeboot.img pxeboot.exec pxeboot_img-boot_i386_pc_pxeboot.o MOSTLYCLEANFILES += pxeboot_img-boot_i386_pc_pxeboot.d pxeboot.img: pxeboot.exec - $(OBJCOPY) -O binary -R .note -R .comment -R .note.gnu.build-id $< $@ + $(OBJCOPY) -O $(IMG_FMT) -R .note -R .comment -R .note.gnu.build-id $< $@ pxeboot.exec: pxeboot_img-boot_i386_pc_pxeboot.o $(TARGET_CC) -o $@ $^ $(TARGET_LDFLAGS) $(pxeboot_img_LDFLAGS) @@ -56,7 +57,7 @@ CLEANFILES += diskboot.img diskboot.exec diskboot_img-boot_i386_pc_diskboot.o MOSTLYCLEANFILES += diskboot_img-boot_i386_pc_diskboot.d diskboot.img: diskboot.exec - $(OBJCOPY) -O binary -R .note -R .comment -R .note.gnu.build-id $< $@ + $(OBJCOPY) -O $(IMG_FMT) -R .note -R .comment -R .note.gnu.build-id $< $@ diskboot.exec: diskboot_img-boot_i386_pc_diskboot.o $(TARGET_CC) -o $@ $^ $(TARGET_LDFLAGS) $(diskboot_img_LDFLAGS) @@ -74,7 +75,7 @@ CLEANFILES += lnxboot.img lnxboot.exec lnxboot_img-boot_i386_pc_lnxboot.o MOSTLYCLEANFILES += lnxboot_img-boot_i386_pc_lnxboot.d lnxboot.img: lnxboot.exec - $(OBJCOPY) -O binary -R .note -R .comment -R .note.gnu.build-id $< $@ + $(OBJCOPY) -O $(IMG_FMT) -R .note -R .comment -R .note.gnu.build-id $< $@ lnxboot.exec: lnxboot_img-boot_i386_pc_lnxboot.o $(TARGET_CC) -o $@ $^ $(TARGET_LDFLAGS) $(lnxboot_img_LDFLAGS) @@ -92,7 +93,7 @@ CLEANFILES += cdboot.img cdboot.exec cdboot_img-boot_i386_pc_cdboot.o MOSTLYCLEANFILES += cdboot_img-boot_i386_pc_cdboot.d cdboot.img: cdboot.exec - $(OBJCOPY) -O binary -R .note -R .comment -R .note.gnu.build-id $< $@ + $(OBJCOPY) -O $(IMG_FMT) -R .note -R .comment -R .note.gnu.build-id $< $@ cdboot.exec: cdboot_img-boot_i386_pc_cdboot.o $(TARGET_CC) -o $@ $^ $(TARGET_LDFLAGS) $(cdboot_img_LDFLAGS) @@ -121,7 +122,7 @@ CLEANFILES += kernel.img kernel.exec kernel_img-kern_i386_pc_startup.o kernel_im MOSTLYCLEANFILES += kernel_img-kern_i386_pc_startup.d kernel_img-kern_main.d kernel_img-kern_device.d kernel_img-kern_disk.d kernel_img-kern_dl.d kernel_img-kern_file.d kernel_img-kern_fs.d kernel_img-kern_err.d kernel_img-kern_misc.d kernel_img-kern_mm.d kernel_img-kern_loader.d kernel_img-kern_rescue.d kernel_img-kern_term.d kernel_img-kern_time.d kernel_img-kern_list.d kernel_img-kern_handler.d kernel_img-kern_i386_dl.d kernel_img-kern_i386_pc_init.d kernel_img-kern_i386_pc_mmap.d kernel_img-kern_parser.d kernel_img-kern_partition.d kernel_img-kern_i386_tsc.d kernel_img-kern_i386_pit.d kernel_img-kern_generic_rtc_get_time_ms.d kernel_img-kern_generic_millisleep.d kernel_img-kern_env.d kernel_img-term_i386_pc_console.d kernel_img-term_i386_vga_common.d kernel_img-symlist.d kernel.img: kernel.exec - $(OBJCOPY) -O binary -R .note -R .comment -R .note.gnu.build-id $< $@ + $(OBJCOPY) -O $(IMG_FMT) -R .note -R .comment -R .note.gnu.build-id $< $@ kernel.exec: kernel_img-kern_i386_pc_startup.o kernel_img-kern_main.o kernel_img-kern_device.o kernel_img-kern_disk.o kernel_img-kern_dl.o kernel_img-kern_file.o kernel_img-kern_fs.o kernel_img-kern_err.o kernel_img-kern_misc.o kernel_img-kern_mm.o kernel_img-kern_loader.o kernel_img-kern_rescue.o kernel_img-kern_term.o kernel_img-kern_time.o kernel_img-kern_list.o kernel_img-kern_handler.o kernel_img-kern_i386_dl.o kernel_img-kern_i386_pc_init.o kernel_img-kern_i386_pc_mmap.o kernel_img-kern_parser.o kernel_img-kern_partition.o kernel_img-kern_i386_tsc.o kernel_img-kern_i386_pit.o kernel_img-kern_generic_rtc_get_time_ms.o kernel_img-kern_generic_millisleep.o kernel_img-kern_env.o kernel_img-term_i386_pc_console.o kernel_img-term_i386_vga_common.o kernel_img-symlist.o $(TARGET_CC) -o $@ $^ $(TARGET_LDFLAGS) $(kernel_img_LDFLAGS) diff --git a/conf/i386-pc.rmk b/conf/i386-pc.rmk index 4221db4..5e97c0e 100644 --- a/conf/i386-pc.rmk +++ b/conf/i386-pc.rmk @@ -10,6 +10,7 @@ COMMON_LDFLAGS = -m32 -nostdlib normal/lexer.c_DEPENDENCIES = grub_script.tab.h # Images. +IMG_FMT = binary pkglib_IMAGES = boot.img diskboot.img kernel.img pxeboot.img lnxboot.img \ cdboot.img diff --git a/genmk.rb b/genmk.rb index c41872c..fe022cd 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 $(IMG_FMT) -R .note -R .comment -R .note.gnu.build-id $< $@ #{exe}: #{objs_str} $(TARGET_CC) -o $@ $^ $(TARGET_LDFLAGS) $(#{prefix}_LDFLAGS) -- 1.6.1.2.253.ga34a