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 | 704e2ed39d4e157d0c24d4dc3a3078cbacc6505c (patch) | |
tree | ffba1790b89941519ddb5acc2bf8f55df6b65529 /target | |
parent | 5431c1983b51e4f69db63f5d5c94b2ed157e5374 (diff) | |
download | upstream-704e2ed39d4e157d0c24d4dc3a3078cbacc6505c.tar.gz upstream-704e2ed39d4e157d0c24d4dc3a3078cbacc6505c.tar.bz2 upstream-704e2ed39d4e157d0c24d4dc3a3078cbacc6505c.zip |
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>
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@37049 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target')
41 files changed, 117 insertions, 118 deletions
diff --git a/target/linux/adm5120/image/Makefile b/target/linux/adm5120/image/Makefile index 7ced198a21..4ca4d48568 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 bc412a609e..9e25224512 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 fb42e426e5..fc83d6d3f9 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 24c0a00ffc..84a378382d 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 a2f2056d4f..1dfdd9843c 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 55cff25561..83b67b61eb 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 11387b14ea..ad53572dba 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 09109573f7..9a477a6fda 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 4928010280..362738cd97 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 5970906be8..a08679589a 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 dd2d5d0c16..45dab986de 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 4e8d6115f7..96d6ab137c 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 6f13fbaf60..7fa0b35e06 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 f4064e1bbe..0d5a289e69 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 3f3f8d5e6b..0fcc13ae2c 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 5ef900b452..85da8886c8 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 6c647196c1..975328f003 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 90bdc6f2eb..8c66387e6b 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 160067386d..0df51ba5cb 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 58f3ec811e..7cdf7cf665 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 30e5b12498..564cafcf34 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 99bf864260..7be27e6dfb 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 7386db0766..1c814fa4fd 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 0000c34642..d3cf6a2950 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 b63a78dc57..fc7e9cdce6 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 bc52368f06..2a721dace0 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 aabfbad4d1..c7458f1c24 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 a5db79ec18..4c80bb777f 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 bc2dbf6025..af29c2baae 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 5998b4db7e..a91b0d2d13 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 24e9b76744..96dc854231 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 5123c3a0a8..e118122bd4 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 037ede9a1a..39b074a5c7 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 dae5de5dff..86c238a6af 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 1ca1f7876d..45512b55cc 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 af4b26c537..47a7aedc14 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 7f2b5d4123..b8723363da 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 5f2c3113d2..49394692f0 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 da4baaa48a..d1236410db 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 920f946254..0d4fe4764f 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 62d4c73055..039d70ab82 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 |