diff options
author | Florian Fainelli <florian@openwrt.org> | 2013-06-27 19:58:31 +0000 |
---|---|---|
committer | Florian Fainelli <florian@openwrt.org> | 2013-06-27 19:58:31 +0000 |
commit | 6a4f2922f6303a006d66b4bbb79541823b1c12b4 (patch) | |
tree | d3d9644c2a4a2e9b758bab9b84973e078143ed2c /target/linux | |
parent | eab95ea46736f8359c5a19a612f0e39160cab80c (diff) | |
download | mtk-20170518-6a4f2922f6303a006d66b4bbb79541823b1c12b4.zip mtk-20170518-6a4f2922f6303a006d66b4bbb79541823b1c12b4.tar.gz mtk-20170518-6a4f2922f6303a006d66b4bbb79541823b1c12b4.tar.bz2 |
targets: prepare for supporting normal and initramfs images
In order to support both normal images and initramfs, ensure that each
target sets KERNELNAME properly so that the generic kernel building code
can copy the corresponding files over $(KDIR) with the appropriate
extension. Update the various paths to the kernel and wrapper images
from $(LINUX_DIR)/arch/$(ARCH)/boot/$(foo) to $(KDIR)/$(foo).
Signed-off-by: Florian Fainelli <florian@openwrt.org>
SVN-Revision: 37049
Diffstat (limited to 'target/linux')
41 files changed, 117 insertions, 118 deletions
diff --git a/target/linux/adm5120/image/Makefile b/target/linux/adm5120/image/Makefile index 7ced198..4ca4d48 100644 --- a/target/linux/adm5120/image/Makefile +++ b/target/linux/adm5120/image/Makefile @@ -21,14 +21,6 @@ fs_all:=all fs_4k:=4k fs_64k:=64k fs_128k:=128k -ifeq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),y) - fs_squash:=initramfs - fs_all:=initramfs - fs_4k:=initramfs - fs_64k:=initramfs - fs_128k:=initramfs - VMLINUX:=$(BIN_DIR)/$(IMG_PREFIX)-vmlinux-initramfs -endif define Build/Clean $(LOADER_MAKE) clean @@ -111,6 +103,10 @@ endef define Image/BuildKernel cp $(KDIR)/vmlinux.elf $(VMLINUX).elf cp $(KDIR)/vmlinux $(VMLINUX).bin +ifneq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),) + cp $(KDIR)/vmlinux-initramfs.elf $(VMLINUX)-initramfs.elf + cp $(KDIR)/vmlinux $(VMLINUX)-initramfs.bin +endif endef $(eval $(call BuildImage)) diff --git a/target/linux/adm8668/image/Makefile b/target/linux/adm8668/image/Makefile index bc412a6..9e25224 100644 --- a/target/linux/adm8668/image/Makefile +++ b/target/linux/adm8668/image/Makefile @@ -9,10 +9,6 @@ include $(INCLUDE_DIR)/image.mk VMLINUX:=$(BIN_DIR)/$(IMG_PREFIX)-vmlinux UIMAGE:=$(IMG_PREFIX)-uImage -ifeq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),y) - VMLINUX:=$(BIN_DIR)/$(IMG_PREFIX)-vmlinux-initramfs - UIMAGE:=$(IMG_PREFIX)-uImage-initramfs -endif define kernel_entry -a 0x80002000 -e 0x80002000 @@ -53,6 +49,12 @@ define Image/BuildKernel cp $(KDIR)/vmlinux $(VMLINUX).bin $(call CompressGzip,$(KDIR)/vmlinux,$(KDIR)/vmlinux.bin.gz) $(call MkImage,gzip,,$(KDIR)/vmlinux.bin.gz,$(BIN_DIR)/$(UIMAGE)-gzip.bin) +ifeq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),y) + cp $(KDIR)/vmlinux-initramfs.elf $(VMLINUX)-initramfs.elf + cp $(KDIR)/vmlinux $(VMLINUX)-initramfs.bin + $(call CompressGzip,$(KDIR)/vmlinux-initramfs,$(KDIR)/vmlinux-initramfs.bin.gz) + $(call MkImage,gzip,,$(KDIR)/vmlinux-initramfs.bin.gz,$(BIN_DIR)/$(UIMAGE)-initramfs-gzip.bin) +endif endef $(eval $(call BuildImage)) diff --git a/target/linux/ar7/image/Makefile b/target/linux/ar7/image/Makefile index fb42e42..fc83d6d 100644 --- a/target/linux/ar7/image/Makefile +++ b/target/linux/ar7/image/Makefile @@ -44,6 +44,11 @@ define Image/Prepare $(OBJCOPY_SREC) $(KDIR)/vmlinux.elf $(KDIR)/vmlinux.srec srec2bin $(KDIR)/loader.srec $(KDIR)/loader.bin srec2bin $(KDIR)/vmlinux.srec $(KDIR)/vmlinux.bin +ifneq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),) + $(OBJCOPY_SREC) $(KDIR)/vmlinux-initramfs.elf \ + $(KDIR)/vmlinux-initramfs.srec + srec2bin $(KDIR)/vmlinux-initramfs.srec $(KDIR)/vmlinux-initramfs.bin +endif endef define align/jffs2-64k @@ -86,7 +91,7 @@ define Image/Build/EVA endef define Image/Build/Initramfs - $(CP) $(KDIR)/vmlinux.bin $(BIN_DIR)/$(IMG_PREFIX)-initramfs.bin + $(CP) $(KDIR)/vmlinux-initramfs.bin $(BIN_DIR)/$(IMG_PREFIX)-initramfs.bin endef ifeq ($(CONFIG_AR7_TI),y) diff --git a/target/linux/ar71xx/image/Makefile b/target/linux/ar71xx/image/Makefile index 24c0a00..84a3783 100644 --- a/target/linux/ar71xx/image/Makefile +++ b/target/linux/ar71xx/image/Makefile @@ -58,15 +58,6 @@ fs_64k:=64k fs_64kraw:=64kraw fs_128k:=128k fs_256k:=256k -ifeq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),y) - fs_squash:=initramfs - fs_64k:=initramfs - fs_64kraw:=initramfs - fs_128k:=initramfs - fs_256k:=initramfs - VMLINUX:=$(BIN_DIR)/$(IMG_PREFIX)-vmlinux-initramfs - UIMAGE:=$(BIN_DIR)/$(IMG_PREFIX)-uImage-initramfs -endif define CompressLzma $(STAGING_DIR_HOST)/bin/lzma e $(1) -lc1 -lp2 -pb2 $(3) $(2) @@ -200,6 +191,15 @@ define Image/BuildKernel $(call MkuImage,gzip,,$(KDIR)/vmlinux.bin.gz,$(UIMAGE)-gzip.bin) $(call MkuImage,lzma,,$(KDIR)/vmlinux.bin.lzma,$(UIMAGE)-lzma.bin) cp $(KDIR)/loader-generic.elf $(VMLINUX)-lzma.elf +ifneq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),) + cp $(KDIR)/vmlinux-initramfs.elf $(VMLINUX)-initramfs.elf + cp $(KDIR)/vmlinux-initramfs $(VMLINUX)-initramfs.bin + dd if=$(KDIR)/vmlinux-initramfs.bin.lzma of=$(VMLINUX)-initramfs.lzma bs=65536 conv=sync + dd if=$(KDIR)/vmlinux-initramfs.bin.gz of=$(VMLINUX)-initramfs.gz bs=65536 conv=sync + $(call MkuImage,gzip,,$(KDIR)/vmlinux-initramfs.bin.gz,$(UIMAGE)-initramfs-gzip.bin) + $(call MkuImage,lzma,,$(KDIR)/vmlinux-initramfs.bin.lzma,$(UIMAGE)-initramfs-lzma.bin) + cp $(KDIR)/loader-generic.elf $(VMLINUX)-initramfs-lzma.elf +endif -mkdir -p $(KDIR_TMP) $(call Image/Build/Initramfs) endef @@ -1030,6 +1030,10 @@ endef define Image/Prepare gzip -9 -c $(KDIR)/vmlinux > $(KDIR)/vmlinux.bin.gz $(call CompressLzma,$(KDIR)/vmlinux,$(KDIR)/vmlinux.bin.lzma) +ifneq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),) + gzip -9 -c $(KDIR)/vmlinux-initramfs > $(KDIR)/vmlinux-initramfs.bin.gz + $(call CompressLzma,$(KDIR)/vmlinux-initramfs,$(KDIR)/vmlinux-initramfs.bin.lzma) +endif $(call Image/BuildLoader,generic,elf) $(call Image/Build/Profile/$(if $(CONFIG_IB),Default,$(PROFILE)),loader) endef diff --git a/target/linux/au1000/image/Makefile b/target/linux/au1000/image/Makefile index a2f2056..1dfdd98 100644 --- a/target/linux/au1000/image/Makefile +++ b/target/linux/au1000/image/Makefile @@ -51,7 +51,7 @@ define Image/Prepare endef define Image/Build/Initramfs - $(OBJCOPY_SREC) $(BIN_DIR)/$(IMG_PREFIX)-vmlinux.elf $(BIN_DIR)/$(IMG_PREFIX)-vmlinux.srec + $(OBJCOPY_SREC) $(KDIR)/vmlinux-initramfs.elf $(BIN_DIR)/$(IMG_PREFIX)-vmlinux-initramfs.srec endef define Image/Build diff --git a/target/linux/avr32/Makefile b/target/linux/avr32/Makefile index 55cff25..83b67b6 100644 --- a/target/linux/avr32/Makefile +++ b/target/linux/avr32/Makefile @@ -20,4 +20,6 @@ define Target/Description Build firmware images for ATNGW100 board endef +KERNELNAME:="uImage" + $(eval $(call BuildTarget)) diff --git a/target/linux/avr32/image/Makefile b/target/linux/avr32/image/Makefile index 11387b1..ad53572 100644 --- a/target/linux/avr32/image/Makefile +++ b/target/linux/avr32/image/Makefile @@ -17,10 +17,6 @@ ifneq ($(CONFIG_AVR32_UBOOT),) endef endif -define Image/Prepare - cp $(LINUX_DIR)/arch/avr32/boot/images/uImage $(KDIR)/uImage -endef - define Image/BuildKernel cp $(KDIR)/uImage $(BIN_DIR)/$(IMG_PREFIX)-uImage diff --git a/target/linux/brcm47xx/image/Makefile b/target/linux/brcm47xx/image/Makefile index 0910957..9a477a6 100644 --- a/target/linux/brcm47xx/image/Makefile +++ b/target/linux/brcm47xx/image/Makefile @@ -13,6 +13,9 @@ endef define Image/Prepare cat $(KDIR)/vmlinux | $(STAGING_DIR_HOST)/bin/lzma e -si -so -eos -lc1 -lp2 -pb2 > $(KDIR)/vmlinux.lzma +ifneq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),) + cat $(KDIR)/vmlinux-initramfs | $(STAGING_DIR_HOST)/bin/lzma e -si -so -eos -lc1 -lp2 -pb2 > $(KDIR)/vmlinux-initramfs.lzma +endif rm -f $(KDIR)/loader.gz $(MAKE) -C lzma-loader \ BUILD_DIR="$(KDIR)" \ @@ -120,7 +123,7 @@ define Image/Build/squashfs endef define Image/Build/Initramfs - $(STAGING_DIR_HOST)/bin/trx -o $(BIN_DIR)/$(IMG_PREFIX)-initramfs.trx -f $(KDIR)/loader.gz -f $(KDIR)/vmlinux.lzma + $(STAGING_DIR_HOST)/bin/trx -o $(BIN_DIR)/$(IMG_PREFIX)-initramfs.trx -f $(KDIR)/loader.gz -f $(KDIR)/vmlinux-initramfs.lzma endef define Image/Build/Chk @@ -148,6 +151,9 @@ define Image/Build # $(call Image/Build/Chk,$(1),wnr3500U,U12H136T00_NETGEAR,2,$(patsubst jffs2-%,jffs2,$(1))) $(call Image/Build/Chk,$(1),wnr3500v2,U12H127T00_NETGEAR,2,$(patsubst jffs2-%,jffs2,$(1))) # $(call Image/Build/Chk,$(1),wnr3500v2_VC,U12H127T70_NETGEAR,2,$(patsubst jffs2-%,jffs2,$(1))) +ifneq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),) + $(call Image/Build/Initramfs) +endif endef $(eval $(call BuildImage)) diff --git a/target/linux/brcm63xx/image/Makefile b/target/linux/brcm63xx/image/Makefile index 4928010..362738c 100755 --- a/target/linux/brcm63xx/image/Makefile +++ b/target/linux/brcm63xx/image/Makefile @@ -159,7 +159,7 @@ endef define Image/Build/Initramfs # Netgear CVG834G - $(call Image/Build/HCS,initramfs,cvg834g,a020,0001,0022,$(KDIR)/vmlinux) + $(call Image/Build/HCS,initramfs,cvg834g,a020,0001,0022,$(KDIR)/vmlinux-initramfs) endef define Image/Build diff --git a/target/linux/cns21xx/Makefile b/target/linux/cns21xx/Makefile index 5970906..a086795 100644 --- a/target/linux/cns21xx/Makefile +++ b/target/linux/cns21xx/Makefile @@ -24,4 +24,6 @@ define Target/Description Build firmware images for Cavium Networks CNS21XX based boards. endef +KERNELNAME:="zImage uImage" + $(eval $(call BuildTarget)) diff --git a/target/linux/cns21xx/image/Makefile b/target/linux/cns21xx/image/Makefile index dd2d5d0..45dab98 100644 --- a/target/linux/cns21xx/image/Makefile +++ b/target/linux/cns21xx/image/Makefile @@ -40,7 +40,7 @@ endef define prepare_zimage echo -en "\x$(2)\x1c\xa0\xe3\x$(3)\x10\x81\xe3" > $(KDIR)/$(call zimage_name,$(1)) - cat $(LINUX_DIR)/arch/arm/boot/zImage >> $(KDIR)/$(call zimage_name,$(1)) + cat $(KDIR)/zImage >> $(KDIR)/$(call zimage_name,$(1)) endef define prepare_uimage diff --git a/target/linux/cns3xxx/Makefile b/target/linux/cns3xxx/Makefile index 4e8d611..96d6ab1 100644 --- a/target/linux/cns3xxx/Makefile +++ b/target/linux/cns3xxx/Makefile @@ -22,7 +22,7 @@ define Target/Description eg. the Gateworks Laguna family endef -KERNELNAME:="uImage" +KERNELNAME:="zImage uImage" DEFAULT_PACKAGES += kmod-ath9k kmod-usb2 wpad-mini diff --git a/target/linux/cns3xxx/image/Makefile b/target/linux/cns3xxx/image/Makefile index 6f13fba..7fa0b35 100644 --- a/target/linux/cns3xxx/image/Makefile +++ b/target/linux/cns3xxx/image/Makefile @@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk include $(INCLUDE_DIR)/image.mk define mkimage - mkimage -A arm -O linux -T kernel -C none -a $(2) -e $(2) -n 'OpenWrt Linux-$(LINUX_VERSION)' -d $(LINUX_DIR)/arch/arm/boot/zImage $(KDIR)/uImage-$(1) + mkimage -A arm -O linux -T kernel -C none -a $(2) -e $(2) -n 'OpenWrt Linux-$(LINUX_VERSION)' -d $(KDIR)/zImage $(KDIR)/uImage-$(1) endef define Image/Prepare diff --git a/target/linux/ep93xx/image/Makefile b/target/linux/ep93xx/image/Makefile index f4064e1..0d5a289 100644 --- a/target/linux/ep93xx/image/Makefile +++ b/target/linux/ep93xx/image/Makefile @@ -13,22 +13,12 @@ fs_all:=all fs_4k:=4k fs_64k:=64k fs_128k:=128k -ifeq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),y) - fs_squash:=initramfs - fs_all:=initramfs - fs_4k:=initramfs - fs_64k:=initramfs - fs_128k:=initramfs - UIMAGE:=$(BIN_DIR)/$(IMG_PREFIX)-uImage-initramfs -endif - - -define Image/Prepare - cp $(LINUX_DIR)/arch/arm/boot/uImage $(KDIR)/uImage -endef define Image/BuildKernel cp $(KDIR)/uImage $(UIMAGE) +ifeq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),y) + cp $(KDIR)/uImage-initramfs $(UIMAGE)-initramfs +endif endef define Image/Build/jffs2-64k diff --git a/target/linux/gemini/Makefile b/target/linux/gemini/Makefile index 3f3f8d5..0fcc13a 100644 --- a/target/linux/gemini/Makefile +++ b/target/linux/gemini/Makefile @@ -15,6 +15,8 @@ MAINTAINER:=Imre Kaloz <kaloz@openwrt.org> LINUX_VERSION:=3.9.4 +KERNELNAME:="zImage" + include $(INCLUDE_DIR)/target.mk $(eval $(call BuildTarget)) diff --git a/target/linux/gemini/image/Makefile b/target/linux/gemini/image/Makefile index 5ef900b..85da888 100644 --- a/target/linux/gemini/image/Makefile +++ b/target/linux/gemini/image/Makefile @@ -10,10 +10,10 @@ include $(INCLUDE_DIR)/image.mk define Image/Prepare # WBD111: mach id 1690 (0x69a) echo -en "\x06\x1c\xa0\xe3\x9a\x10\x81\xe3" > $(KDIR)/$(IMG_PREFIX)-wbd111-zImage - cat $(LINUX_DIR)/arch/arm/boot/zImage >> $(KDIR)/$(IMG_PREFIX)-wbd111-zImage + cat $(KDIR)/zImage >> $(KDIR)/$(IMG_PREFIX)-wbd111-zImage # WBD222: mach id 2753 (0xAC1) echo -en "\x0a\x1c\xa0\xe3\xc1\x10\x81\xe3" > $(KDIR)/$(IMG_PREFIX)-wbd222-zImage - cat $(LINUX_DIR)/arch/arm/boot/zImage >> $(KDIR)/$(IMG_PREFIX)-wbd222-zImage + cat $(KDIR)/zImage >> $(KDIR)/$(IMG_PREFIX)-wbd222-zImage endef define Image/BuildKernel diff --git a/target/linux/imx6/image/Makefile b/target/linux/imx6/image/Makefile index 6c64719..975328f 100644 --- a/target/linux/imx6/image/Makefile +++ b/target/linux/imx6/image/Makefile @@ -25,7 +25,7 @@ define Image/BuildKernel $(call mkfit,$(board),0x10008000) cp $(LINUX_DIR)/arch/arm/boot/dts/$(board).dtb $(BIN_DIR) ) - cp $(LINUX_DIR)/arch/arm/boot/zImage $(BIN_DIR)/openwrt-$(BOARD)-zImage + cp $(KDIR)/zImage $(BIN_DIR)/openwrt-$(BOARD)-zImage endef # board-specific sysupgrade image diff --git a/target/linux/iop32x/Makefile b/target/linux/iop32x/Makefile index 90bdc6f..8c66387 100644 --- a/target/linux/iop32x/Makefile +++ b/target/linux/iop32x/Makefile @@ -16,4 +16,6 @@ LINUX_VERSION:=3.3.8 include $(INCLUDE_DIR)/target.mk +KERNELNAME:="zImage" + $(eval $(call BuildTarget)) diff --git a/target/linux/iop32x/image/Makefile b/target/linux/iop32x/image/Makefile index 1600673..0df51ba 100644 --- a/target/linux/iop32x/image/Makefile +++ b/target/linux/iop32x/image/Makefile @@ -7,10 +7,6 @@ include $(TOPDIR)/rules.mk include $(INCLUDE_DIR)/image.mk -define Image/Prepare - cp $(LINUX_DIR)/arch/arm/boot/zImage $(KDIR)/zImage -endef - define Image/BuildKernel cp $(KDIR)/zImage $(BIN_DIR)/$(IMG_PREFIX)-zImage # diff --git a/target/linux/ixp4xx/Makefile b/target/linux/ixp4xx/Makefile index 58f3ec8..7cdf7cf 100644 --- a/target/linux/ixp4xx/Makefile +++ b/target/linux/ixp4xx/Makefile @@ -18,5 +18,6 @@ LINUX_VERSION:=3.3.8 include $(INCLUDE_DIR)/target.mk DEFAULT_PACKAGES += ixp4xx-microcode fconfig +KERNELNAME:="zImage" $(eval $(call BuildTarget)) diff --git a/target/linux/ixp4xx/image/Makefile b/target/linux/ixp4xx/image/Makefile index 30e5b12..564cafc 100644 --- a/target/linux/ixp4xx/image/Makefile +++ b/target/linux/ixp4xx/image/Makefile @@ -31,10 +31,6 @@ define Image/Build/Freecom rm -f $(TARGET_DIR)/zImage endef -define Image/Prepare - cp $(LINUX_DIR)/arch/arm/boot/zImage $(KDIR)/zImage -endef - define Image/BuildKernel cp $(KDIR)/zImage $(BIN_DIR)/$(IMG_PREFIX)-zImage BIN_DIR=$(BIN_DIR) IMG_PREFIX="$(IMG_PREFIX)" $(TOPDIR)/scripts/arm-magic.sh diff --git a/target/linux/kirkwood/image/Makefile b/target/linux/kirkwood/image/Makefile index 99bf864..7be27e6 100644 --- a/target/linux/kirkwood/image/Makefile +++ b/target/linux/kirkwood/image/Makefile @@ -9,10 +9,6 @@ include $(INCLUDE_DIR)/image.mk NAND_BLOCKSIZE := 2048:128k -define Image/Prepare - cp $(LINUX_DIR)/arch/arm/boot/uImage $(KDIR)/uImage -endef - define Image/BuildKernel # do mach-id fixup here, if needed cp $(KDIR)/uImage $(BIN_DIR)/$(IMG_PREFIX)-uImage diff --git a/target/linux/mcs814x/image/Makefile b/target/linux/mcs814x/image/Makefile index 7386db0..1c814fa 100644 --- a/target/linux/mcs814x/image/Makefile +++ b/target/linux/mcs814x/image/Makefile @@ -14,9 +14,6 @@ LOADADDR:=0x00008000 JFFS2_BLOCKSIZE = 128k UIMAGE:=$(BIN_DIR)/$(IMG_PREFIX)-uImage -ifeq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),y) - UIMAGE:=$(BIN_DIR)/$(IMG_PREFIX)-uImage-initramfs -endif define Image/Build/MkuImage mkimage -A arm -O linux -T kernel -a $(LOADADDR) -C none -e $(LOADADDR) \ @@ -24,14 +21,10 @@ define Image/Build/MkuImage endef define Image/Build/DTB - cp $(KDIR)/zImage $(KDIR)/zImage-$(1); - cat $(LINUX_DIR)/arch/$(ARCH)/boot/$(1).dtb >> $(KDIR)/zImage-$(1); - $(call Image/Build/MkuImage,$(KDIR)/zImage-$(1),$(KDIR)/uImage-$(1)) - cp $(KDIR)/uImage-$(1) $(UIMAGE)-$(1); -endef - -define Image/Prepare - cp $(LINUX_DIR)/arch/$(ARCH)/boot/zImage $(KDIR)/zImage + cp $(KDIR)/zImage$(2) $(KDIR)/zImage-$(1); + cat $(LINUX_DIR)/arch/$(ARCH)/boot/$(1).dtb >> $(KDIR)/zImage$(2)-$(1); + $(call Image/Build/MkuImage,$(KDIR)/zImage$(2)-$(1),$(KDIR)/uImage$(2)-$(1)) + cp $(KDIR)/uImage$(2)-$(1) $(UIMAGE)$(2)-$(1); endef define Image/Build/Profile/dLAN_USB_Extender @@ -42,7 +35,10 @@ endef define Image/BuildKernel $(foreach dtb,$(TARGET_DTBS),$(call Image/Build/DTB,$(dtb))) - $(call Image/Build/Initramfs) +endef + +define Image/Build/Initramfs + $(foreach dtb,$(TARGET_DTBS),$(call Image/Build/DTB,$(dtb),-initramfs)) endef define Image/Build/squashfs @@ -53,6 +49,9 @@ define Image/Build $(call Image/Build/$(1)) dd if=$(KDIR)/root.$(1) of=$(BIN_DIR)/$(IMG_PREFIX)-root.$(1) bs=128k conv=sync $(call Image/Build/Profile/$(PROFILE),$(1)) +ifneq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),) + $(call Image/Build/Initramfs) +endif endef $(eval $(call BuildImage)) diff --git a/target/linux/mpc52xx/Makefile b/target/linux/mpc52xx/Makefile index 0000c34..d3cf6a2 100644 --- a/target/linux/mpc52xx/Makefile +++ b/target/linux/mpc52xx/Makefile @@ -20,4 +20,6 @@ define Target/Description Build images for the Freescale MPC52xx based boards. endef +KERNELNAME:="zImage" + $(eval $(call BuildTarget)) diff --git a/target/linux/mpc52xx/image/Makefile b/target/linux/mpc52xx/image/Makefile index b63a78d..fc7e9cd 100644 --- a/target/linux/mpc52xx/image/Makefile +++ b/target/linux/mpc52xx/image/Makefile @@ -7,10 +7,6 @@ include $(TOPDIR)/rules.mk include $(INCLUDE_DIR)/image.mk -define Image/Prepare - cp $(LINUX_DIR)/arch/powerpc/boot/zImage $(KDIR)/zImage -endef - define Image/BuildKernel cp $(KDIR)/zImage $(BIN_DIR)/$(IMG_PREFIX)-zImage endef diff --git a/target/linux/mpc83xx/Makefile b/target/linux/mpc83xx/Makefile index bc52368..2a721da 100644 --- a/target/linux/mpc83xx/Makefile +++ b/target/linux/mpc83xx/Makefile @@ -23,4 +23,6 @@ define Target/Description Build firmware images for Freescale MPC83xx based boards (eg. RouterBoard 600). endef +KERNELNAME:="uImage" + $(eval $(call BuildTarget)) diff --git a/target/linux/mpc83xx/image/Makefile b/target/linux/mpc83xx/image/Makefile index aabfbad..c7458f1 100644 --- a/target/linux/mpc83xx/image/Makefile +++ b/target/linux/mpc83xx/image/Makefile @@ -15,7 +15,7 @@ endef define Image/BuildKernel cp $(LINUX_DIR)/arch/powerpc/boot/dtbImage.rb600.elf $(BIN_DIR)/openwrt-$(BOARD)-rb600.elf cp $(LINUX_DIR)/arch/powerpc/boot/dtbImage.rb333.elf $(BIN_DIR)/openwrt-$(BOARD)-rb333.elf - cp $(LINUX_DIR)/arch/powerpc/boot/uImage $(BIN_DIR)/openwrt-$(BOARD)-uImage + cp $(KDIR)/uImage $(BIN_DIR)/openwrt-$(BOARD)-uImage endef define Image/Build diff --git a/target/linux/mpc85xx/image/Makefile b/target/linux/mpc85xx/image/Makefile index a5db79e..4c80bb7 100644 --- a/target/linux/mpc85xx/image/Makefile +++ b/target/linux/mpc85xx/image/Makefile @@ -35,7 +35,7 @@ define Image/Prepare endef define Image/BuildKernel - cp $(KDIR)/zImage $(zImage) + cp $(KDIR)/zImage$(IMAGE_SUFFIX) $(zImage) $(foreach dts,$(DTS_TARGETS), $(LINUX_DIR)/scripts/dtc/dtc -I dts -O dtb $(LINUX_DIR)/arch/powerpc/boot/dts/$(dts).dts > $(BIN_DIR)/$(IMG_PREFIX)-$(dts).fdt ) diff --git a/target/linux/mvebu/image/Makefile b/target/linux/mvebu/image/Makefile index bc2dbf6..af29c2b 100644 --- a/target/linux/mvebu/image/Makefile +++ b/target/linux/mvebu/image/Makefile @@ -15,9 +15,6 @@ LOADADDR:=0x00008000 JFFS2_BLOCKSIZE = 128k UIMAGE:=$(BIN_DIR)/$(IMG_PREFIX)-uImage -ifeq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),y) - UIMAGE:=$(BIN_DIR)/$(IMG_PREFIX)-uImage-initramfs -endif define Image/Build/MkuImage mkimage -A arm -O linux -T kernel -a $(LOADADDR) -C none -e $(LOADADDR) \ @@ -25,14 +22,10 @@ define Image/Build/MkuImage endef define Image/Build/DTB - cp $(KDIR)/zImage $(KDIR)/zImage-$(1); - cat $(LINUX_DIR)/arch/$(ARCH)/boot/dts/$(1).dtb >> $(KDIR)/zImage-$(1); - $(call Image/Build/MkuImage,$(KDIR)/zImage-$(1),$(KDIR)/uImage-$(1)) - cp $(KDIR)/uImage-$(1) $(UIMAGE)-$(1); -endef - -define Image/Prepare - cp $(LINUX_DIR)/arch/$(ARCH)/boot/zImage $(KDIR)/zImage + cp $(KDIR)/zImage$(2) $(KDIR)/zImage$(2)-$(1); + cat $(LINUX_DIR)/arch/$(ARCH)/boot/dts/$(1).dtb >> $(KDIR)/zImage$(2)-$(1); + $(call Image/Build/MkuImage,$(KDIR)/zImage$(2)-$(1),$(KDIR)/uImage$(2)-$(1)) + cp $(KDIR)/uImage$(2)-$(1) $(UIMAGE)$(2)-$(1); endef define Image/BuildKernel @@ -44,9 +37,16 @@ define Image/Build/squashfs $(STAGING_DIR_HOST)/bin/padjffs2 $(KDIR)/root.squashfs 128 endef +define Image/Build/Initramfs + $(foreach dtb,$(TARGET_DTBS),$(call Image/Build/DTB,$(dtb),-initramfs)) +endef + define Image/Build $(call Image/Build/$(1)) dd if=$(KDIR)/root.$(1) of=$(BIN_DIR)/$(IMG_PREFIX)-root.$(1) bs=128k conv=sync +ifneq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),) + $(call Image/Build/Initramfs) +endif endef $(eval $(call BuildImage)) diff --git a/target/linux/omap24xx/Makefile b/target/linux/omap24xx/Makefile index 5998b4d..a91b0d2 100644 --- a/target/linux/omap24xx/Makefile +++ b/target/linux/omap24xx/Makefile @@ -20,6 +20,8 @@ endef CFLAGS:=-Os -pipe -march=armv6 -mtune=arm1136j-s -fno-caller-saves +KERNELNAME:="zImage" + include $(INCLUDE_DIR)/target.mk $(eval $(call BuildTarget)) diff --git a/target/linux/omap24xx/image/Makefile b/target/linux/omap24xx/image/Makefile index 24e9b76..96dc854 100644 --- a/target/linux/omap24xx/image/Makefile +++ b/target/linux/omap24xx/image/Makefile @@ -10,7 +10,7 @@ include $(INCLUDE_DIR)/image.mk NAND_BLOCKSIZE=2048:128k define Image/BuildKernel - $(CP) $(LINUX_DIR)/arch/arm/boot/zImage $(BIN_DIR)/$(IMG_PREFIX)-zImage + $(CP) $(KDIR)/zImage $(BIN_DIR)/$(IMG_PREFIX)-zImage chmod 0644 $(BIN_DIR)/$(IMG_PREFIX)-zImage endef diff --git a/target/linux/omap4/image/Makefile b/target/linux/omap4/image/Makefile index 5123c3a..e118122 100644 --- a/target/linux/omap4/image/Makefile +++ b/target/linux/omap4/image/Makefile @@ -7,10 +7,6 @@ include $(TOPDIR)/rules.mk include $(INCLUDE_DIR)/image.mk -define Image/Prepare - cp $(LINUX_DIR)/arch/arm/boot/uImage $(KDIR)/uImage -endef - define Image/BuildKernel mkimage -A arm -O linux -T script -C none -a 0 -e 0 -n 'Boot Image' -d boot.script $(BIN_DIR)/boot.scr cp $(KDIR)/uImage $(BIN_DIR)/openwrt-$(BOARD)-uImage diff --git a/target/linux/ppc40x/Makefile b/target/linux/ppc40x/Makefile index 037ede9..39b074a 100644 --- a/target/linux/ppc40x/Makefile +++ b/target/linux/ppc40x/Makefile @@ -21,4 +21,6 @@ define Target/Description Build firmware images for AMCC/IBM PPC40x based boards. endef +KERNELNAME:="uImage cuImage.magicbox cuImage.openrb" + $(eval $(call BuildTarget)) diff --git a/target/linux/ppc40x/image/Makefile b/target/linux/ppc40x/image/Makefile index dae5de5..86c238a 100644 --- a/target/linux/ppc40x/image/Makefile +++ b/target/linux/ppc40x/image/Makefile @@ -10,7 +10,6 @@ include $(INCLUDE_DIR)/image.mk JFFS2_BLOCKSIZE=128k 64k define Image/Prepare - cp $(LINUX_DIR)/arch/powerpc/boot/uImage $(KDIR)/uImage $(LINUX_DIR)/scripts/dtc/dtc -O dtb -R 4 -S 0x20000 $(LINUX_DIR)/arch/powerpc/boot/dts/kilauea.dts > $(KDIR)/openwrt-kilauea.dtb endef @@ -29,7 +28,7 @@ endef define Image/Build/jffs2-128k ( \ - dd if=$(LINUX_DIR)/arch/powerpc/boot/uImage bs=1920k conv=sync; \ + dd if=$(KDIR)/uImage bs=1920k conv=sync; \ dd if=$(KDIR)/openwrt-kilauea.dtb bs=128k conv=sync; \ dd if=$(KDIR)/root.$(1) bs=128k conv=sync; \ ) > $(BIN_DIR)/$(IMG_PREFIX)-kilauea-jffs2.img @@ -37,11 +36,11 @@ endef define Image/Build/jffs2-64k ( \ - dd if=$(LINUX_DIR)/arch/powerpc/boot/cuImage.magicbox bs=1408k conv=sync; \ + dd if=$(KDIR)/cuImage.magicbox bs=1408k conv=sync; \ dd if=$(KDIR)/root.$(1) bs=64k conv=sync; \ ) > $(BIN_DIR)/$(IMG_PREFIX)-magicbox-jffs2.img ( \ - dd if=$(LINUX_DIR)/arch/powerpc/boot/cuImage.openrb bs=1408k conv=sync; \ + dd if=$(KDIR)/cuImage.openrb bs=1408k conv=sync; \ dd if=$(KDIR)/root.$(1) bs=64k conv=sync; \ ) > $(BIN_DIR)/$(IMG_PREFIX)-openrb-jffs2.img endef @@ -49,24 +48,24 @@ endef define Image/Build/squashfs $(call prepare_generic_squashfs,$(KDIR)/root.squashfs) ( \ - dd if=$(LINUX_DIR)/arch/powerpc/boot/uImage bs=1920k conv=sync; \ + dd if=$(KDIR)/uImage bs=1920k conv=sync; \ dd if=$(KDIR)/openwrt-kilauea.dtb bs=128k conv=sync; \ dd if=$(KDIR)/root.$(1) bs=128k conv=sync; \ ) > $(BIN_DIR)/$(IMG_PREFIX)-kilauea-$(1).img ( \ - dd if=$(LINUX_DIR)/arch/powerpc/boot/cuImage.magicbox bs=1408k conv=sync; \ + dd if=$(KDIR)/cuImage.magicbox bs=1408k conv=sync; \ dd if=$(KDIR)/root.$(1) bs=64k conv=sync; \ ) > $(BIN_DIR)/$(IMG_PREFIX)-magicbox-$(1).img ( \ - dd if=$(LINUX_DIR)/arch/powerpc/boot/cuImage.openrb bs=1408k conv=sync; \ + dd if=$(KDIR)/cuImage.openrb bs=1408k conv=sync; \ dd if=$(KDIR)/root.$(1) bs=64k conv=sync; \ ) > $(BIN_DIR)/$(IMG_PREFIX)-openrb-$(1).img endef ifneq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),) define Image/Build/Initramfs - cp $(LINUX_DIR)/arch/powerpc/boot/cuImage.magicbox $(BIN_DIR)/openwrt-$(BOARD)-magicbox-initramfs.bin - cp $(LINUX_DIR)/arch/powerpc/boot/cuImage.openrb $(BIN_DIR)/openwrt-$(BOARD)-openrb-initramfs.bin + cp $(KDIR)/cuImage.magicbox-initramfs $(BIN_DIR)/openwrt-$(BOARD)-magicbox-initramfs.bin + cp $(KDIR)/cuImage.openrb-initramfs $(BIN_DIR)/openwrt-$(BOARD)-openrb-initramfs.bin endef endif diff --git a/target/linux/ppc44x/Makefile b/target/linux/ppc44x/Makefile index 1ca1f78..45512b5 100644 --- a/target/linux/ppc44x/Makefile +++ b/target/linux/ppc44x/Makefile @@ -23,4 +23,6 @@ define Target/Description Build firmware images for AMCC/IBM PPC44x based boards. endef +KERNELNAME:="uImage cuImage.taishan" + $(eval $(call BuildTarget)) diff --git a/target/linux/ppc44x/image/Makefile b/target/linux/ppc44x/image/Makefile index af4b26c..47a7aed 100644 --- a/target/linux/ppc44x/image/Makefile +++ b/target/linux/ppc44x/image/Makefile @@ -10,7 +10,6 @@ include $(INCLUDE_DIR)/image.mk JFFS2_BLOCKSIZE=256k define Image/Prepare - cp $(LINUX_DIR)/arch/powerpc/boot/cuImage.taishan $(KDIR)/uImage $(LINUX_DIR)/scripts/dtc/dtc -O dtb -R 4 -S 0x20000 $(LINUX_DIR)/arch/powerpc/boot/dts/canyonlands.dts > $(KDIR)/openwrt-canyonlands.dtb endef @@ -32,11 +31,11 @@ endef define Image/Build/squashfs $(call prepare_generic_squashfs,$(KDIR)/root.squashfs) ( \ - dd if=$(KDIR)/uImage bs=2048k conv=sync; \ + dd if=$(KDIR)/cuImage.taishan bs=2048k conv=sync; \ dd if=$(KDIR)/root.$(1) bs=256k conv=sync; \ ) > $(BIN_DIR)/$(IMG_PREFIX)-taishan-$(1).img ( \ - dd if=$(LINUX_DIR)/arch/powerpc/boot/uImage bs=1920k conv=sync; \ + dd if=$(KDIR)/uImage bs=1920k conv=sync; \ dd if=$(KDIR)/openwrt-canyonlands.dtb bs=128k conv=sync; \ dd if=$(KDIR)/root.$(1) bs=256k conv=sync; \ ) > $(BIN_DIR)/$(IMG_PREFIX)-canyonlands-$(1).img diff --git a/target/linux/pxa/image/Makefile b/target/linux/pxa/image/Makefile index 7f2b5d4..b872336 100644 --- a/target/linux/pxa/image/Makefile +++ b/target/linux/pxa/image/Makefile @@ -7,10 +7,6 @@ include $(TOPDIR)/rules.mk include $(INCLUDE_DIR)/image.mk -define Image/Prepare - cp $(LINUX_DIR)/arch/arm/boot/uImage $(KDIR)/uImage -endef - define Image/BuildKernel cp $(KDIR)/uImage $(BIN_DIR)/$(IMG_PREFIX)-uImage endef diff --git a/target/linux/ramips/image/Makefile b/target/linux/ramips/image/Makefile index 5f2c311..4939469 100644 --- a/target/linux/ramips/image/Makefile +++ b/target/linux/ramips/image/Makefile @@ -19,8 +19,6 @@ VMLINUX:=$(IMG_PREFIX)-vmlinux UIMAGE:=$(IMG_PREFIX)-uImage ifeq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),y) -VMLINUX:=$(IMG_PREFIX)-vmlinux-initramfs -UIMAGE:=$(IMG_PREFIX)-uImage-initramfs define Image/Build/Initramfs $(call Image/Build/Profile/$(PROFILE),initramfs) endef @@ -541,6 +539,13 @@ define Image/BuildKernel $(call CompressLzma,$(KDIR)/vmlinux,$(KDIR)/vmlinux.bin.lzma) $(call MkImage,lzma,$(KDIR)/vmlinux.bin.lzma,$(KDIR)/uImage.lzma) cp $(KDIR)/uImage.lzma $(BIN_DIR)/$(UIMAGE).bin +ifneq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),) + cp $(KDIR)/vmlinux-initramfs.elf $(BIN_DIR)/$(VMLINUX)-initramfs.elf + cp $(KDIR)/vmlinux-initramfs $(BIN_DIR)/$(VMLINUX)-initramfs.bin + $(call CompressLzma,$(KDIR)/vmlinux-initramfs,$(KDIR)/vmlinux-initramfs.bin.lzma) + $(call MkImage,lzma,$(KDIR)/vmlinux-initramfs.bin.lzma,$(KDIR)/uImage-initramfs.lzma) + cp $(KDIR)/uImage-initramfs.lzma $(BIN_DIR)/$(UIMAGE)-initramfs.bin +endif $(call Image/Build/Initramfs) endef diff --git a/target/linux/rb532/image/Makefile b/target/linux/rb532/image/Makefile index da4baaa..d123641 100644 --- a/target/linux/rb532/image/Makefile +++ b/target/linux/rb532/image/Makefile @@ -29,12 +29,12 @@ define Image/Prepare endef VMLINUX:=$(BIN_DIR)/$(IMG_PREFIX)-vmlinux-kernel -ifeq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),y) - VMLINUX:=$(BIN_DIR)/$(IMG_PREFIX)-vmlinux-initramfs -endif define Image/BuildKernel $(CP) $(KDIR)/loader.elf $(VMLINUX) +ifneq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),) + $(CP) $(KDIR)/loader.elf $(BIN_DIR)/$(IMG_PREFIX)-vmlinux-initramfs +endif endef define Image/cmdline/jffs2-64k @@ -65,9 +65,10 @@ endef ifneq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),y) define Image/Prepare - $(STAGING_DIR_HOST)/bin/patch-cmdline $(KDIR)/vmlinux '$(strip $(call Image/cmdline/yaffs2)) ' - cat $(KDIR)/vmlinux | $(STAGING_DIR_HOST)/bin/lzma e -si -so -eos -lc1 -lp2 -pb2 > $(KDIR)/vmlinux.lzma + $(STAGING_DIR_HOST)/bin/patch-cmdline $(KDIR)/vmlinux-initramfs '$(strip $(call Image/cmdline/yaffs2)) ' + cat $(KDIR)/vmlinux-initramfs | $(STAGING_DIR_HOST)/bin/lzma e -si -so -eos -lc1 -lp2 -pb2 > $(KDIR)/vmlinux-initramfs.lzma $(MAKE) -C $(GENERIC_PLATFORM_DIR)/image/lzma-loader $(LOADER_MAKEOPTS) clean compile + $(CP) $(KDIR)/loader.elf $(KDIR)/loader-initramfs.elf endef endif diff --git a/target/linux/x86/Makefile b/target/linux/x86/Makefile index 920f946..0d4fe47 100644 --- a/target/linux/x86/Makefile +++ b/target/linux/x86/Makefile @@ -15,6 +15,8 @@ SUBTARGETS=generic olpc xen_domu ep80579 net5501 kvm_guest geos alix2 thincan \ LINUX_VERSION:=3.3.8 +KERNELNAME:=bzImage + include $(INCLUDE_DIR)/target.mk $(eval $(call BuildTarget)) diff --git a/target/linux/x86/image/Makefile b/target/linux/x86/image/Makefile index 62d4c73..039d70a 100644 --- a/target/linux/x86/image/Makefile +++ b/target/linux/x86/image/Makefile @@ -246,7 +246,7 @@ define Image/Prepare endef define Image/Build/Initramfs - $(CP) $(KDIR)/bzImage $(BIN_DIR)/$(IMG_PREFIX)-ramfs.bzImage + $(CP) $(KDIR)/bzImage-initramfs $(BIN_DIR)/$(IMG_PREFIX)-ramfs.bzImage endef define Image/Build |