diff --git a/.gitignore b/.gitignore index 5535e8b..9e6851a 100644 --- a/.gitignore +++ b/.gitignore @@ -18,6 +18,7 @@ # tags vmlinux* +uImage System.map Module.symvers diff --git a/arch/mips/Makefile b/arch/mips/Makefile index 61359b7..f16ebdc 100644 --- a/arch/mips/Makefile +++ b/arch/mips/Makefile @@ -705,10 +705,14 @@ vmlinux.ecoff vmlinux.rm200: $(vmlinux-3 vmlinux.srec: $(vmlinux-32) +@$(call makeboot,$@) +uImage: $(vmlinux-32) + +@$(call makeboot,$@) + CLEAN_FILES += vmlinux.ecoff \ vmlinux.srec \ vmlinux.rm200.tmp \ - vmlinux.rm200 + vmlinux.rm200 \ + uImage archclean: @$(MAKE) $(clean)=arch/mips/boot diff --git a/arch/mips/boot/.gitignore b/arch/mips/boot/.gitignore index ba63401..a9f343e 100644 --- a/arch/mips/boot/.gitignore +++ b/arch/mips/boot/.gitignore @@ -2,3 +2,4 @@ mkboot elf2ecoff zImage zImage.tmp +Image diff --git a/arch/mips/boot/Makefile b/arch/mips/boot/Makefile index 0dc8441..19e9fc3 100644 --- a/arch/mips/boot/Makefile +++ b/arch/mips/boot/Makefile @@ -7,6 +7,9 @@ # Copyright (C) 2004 Maciej W. Rozycki # +MKIMAGE := $(srctree)/scripts/mkuboot.sh +OBJCOPYFLAGS = -O binary -R .note -R .comment -S + # # Some DECstations need all possible sections of an ECOFF executable # @@ -23,9 +26,11 @@ endif drop-sections = .reginfo .mdebug .comment .note .pdr .options .MIPS.options strip-flags = $(addprefix --remove-section=,$(drop-sections)) -VMLINUX = vmlinux +VMLINUX = vmlinux +TEXT_ADDR := $(shell awk '/_text/ { printf "0x%s", $$1 ; exit }' < $(TOPDIR)/System.map) +ENTRY_ADDR := $(shell awk '/kernel_entry/ { printf "0x%s", $$1 ; exit }' < $(TOPDIR)/System.map) -all: vmlinux.ecoff vmlinux.srec addinitrd +all: vmlinux.ecoff vmlinux.srec addinitrd uImage vmlinux.ecoff: $(obj)/elf2ecoff $(VMLINUX) $(obj)/elf2ecoff $(VMLINUX) vmlinux.ecoff $(E2EFLAGS) @@ -42,12 +47,30 @@ vmlinux.srec: $(VMLINUX) $(obj)/addinitrd: $(obj)/addinitrd.c $(HOSTCC) -o $@ $^ +$(obj)/Image: $(VMLINUX) FORCE + $(call if_changed,objcopy) + @echo ' Kernel: $@ is ready' + +$(obj)/zImage: $(obj)/Image FORCE + $(call if_changed,gzip) + +quiet_cmd_uimage = UIMAGE $@ + cmd_uimage = $(CONFIG_SHELL) $(MKIMAGE) -A mips -O linux -T kernel \ + -C gzip -a $(TEXT_ADDR) -e $(ENTRY_ADDR) \ + -n 'Linux-$(KERNELRELEASE)' -d $< $@ + +uImage: $(obj)/zImage FORCE + $(call if_changed,uimage) + @echo ' Image $@ is ready' + archhelp: @echo '* vmlinux.ecoff - ECOFF boot image' @echo '* vmlinux.srec - SREC boot image' + @echo '* uImage - U-Boot boot image' clean-files += addinitrd \ elf2ecoff \ vmlinux.bin \ vmlinux.ecoff \ - vmlinux.srec + vmlinux.srec \ + Image uImage