: Allow targets to define boot block image format.
PATCH 1/1 : Allow targets to define boot block image format.
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 <[email protected]>
* 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(-)
conf/i386-pc.mk +7 -6
@@ -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)
conf/i386-pc.rmk +1 -0
@@ -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
genmk.rb +1 -1
@@ -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)
Signature · 1 line
1.6.1.2.253.ga34a