]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
[PATCH] powerpc: Add support for building uImages
authorKumar Gala <galak@gate.crashing.org>
Wed, 23 Nov 2005 18:43:15 +0000 (12:43 -0600)
committerPaul Mackerras <paulus@samba.org>
Mon, 9 Jan 2006 03:50:21 +0000 (14:50 +1100)
powerpc: Add support for building uImages

Add support to build a kernel image bootable by u-boot.
Most of the makefile foo is taken from arch/ppc/boot/images/Makefile

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
arch/powerpc/Makefile
arch/powerpc/boot/Makefile

index a13eb575f834c2520d30276aba3e5545ac66f310..5f80e58e5cb34aa4d20e1c0a8c2d13e8c04b2fb3 100644 (file)
@@ -151,7 +151,7 @@ CPPFLAGS_vmlinux.lds        := -Upowerpc
 # All the instructions talk about "make bzImage".
 bzImage: zImage
 
-BOOT_TARGETS = zImage zImage.initrd znetboot znetboot.initrd vmlinux.sm
+BOOT_TARGETS = zImage zImage.initrd znetboot znetboot.initrd vmlinux.sm uImage
 
 .PHONY: $(BOOT_TARGETS)
 
index 9770f587af73a73fe2db976c67d7d75ab18d54bf..dfc7eacd9bdbb0fbb064af1d42f76565ac189264 100644 (file)
@@ -143,6 +143,36 @@ $(obj)/zImage.initrd: $(obj)/zImage.initrd.vmode $(obj)/addnote
        @cp -f $< $@
        $(call if_changed,addnote)
 
+#-----------------------------------------------------------
+# build u-boot images
+#-----------------------------------------------------------
+quiet_cmd_mygzip = GZIP $@
+cmd_mygzip = gzip -f -9 < $< > $@.$$$$ && mv $@.$$$$ $@
+
+quiet_cmd_objbin = OBJCOPY $@
+      cmd_objbin = $(OBJCOPY) -O binary $< $@
+
+quiet_cmd_uimage = UIMAGE $@
+      cmd_uimage = $(CONFIG_SHELL) $(MKIMAGE) -A ppc -O linux -T kernel \
+               -C gzip -a 00000000 -e 00000000 -n 'Linux-$(KERNELRELEASE)' \
+               -d $< $@
+
+MKIMAGE                := $(srctree)/scripts/mkuboot.sh
+targets                += uImage
+extra-y                += vmlinux.bin vmlinux.gz
+
+$(obj)/vmlinux.bin: vmlinux FORCE
+       $(call if_changed,objbin)
+
+$(obj)/vmlinux.gz: $(obj)/vmlinux.bin FORCE
+       $(call if_changed,mygzip)
+
+$(obj)/uImage: $(obj)/vmlinux.gz
+       $(Q)rm -f $@
+       $(call if_changed,uimage)
+       @echo -n '  Image: $@ '
+       @if [ -f $@ ]; then echo 'is ready' ; else echo 'not made'; fi
+
 install: $(CONFIGURE) $(BOOTIMAGE)
        sh -x $(srctree)/$(src)/install.sh "$(KERNELRELEASE)" vmlinux System.map "$(INSTALL_PATH)" "$(BOOTIMAGE)"