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
lede-17.01
Florian Fainelli 2013-06-27 19:58:31 +00:00
parent eab95ea467
commit 6a4f2922f6
41 changed files with 117 additions and 118 deletions

View File

@ -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))

View File

@ -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))

View File

@ -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)

View File

@ -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

View File

@ -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

View File

@ -20,4 +20,6 @@ define Target/Description
Build firmware images for ATNGW100 board
endef
KERNELNAME:="uImage"
$(eval $(call BuildTarget))

View File

@ -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

View File

@ -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))

View File

@ -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

View File

@ -24,4 +24,6 @@ define Target/Description
Build firmware images for Cavium Networks CNS21XX based boards.
endef
KERNELNAME:="zImage uImage"
$(eval $(call BuildTarget))

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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))

View File

@ -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

View File

@ -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

View File

@ -16,4 +16,6 @@ LINUX_VERSION:=3.3.8
include $(INCLUDE_DIR)/target.mk
KERNELNAME:="zImage"
$(eval $(call BuildTarget))

View File

@ -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
#

View File

@ -18,5 +18,6 @@ LINUX_VERSION:=3.3.8
include $(INCLUDE_DIR)/target.mk
DEFAULT_PACKAGES += ixp4xx-microcode fconfig
KERNELNAME:="zImage"
$(eval $(call BuildTarget))

View File

@ -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

View File

@ -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

View File

@ -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))

View File

@ -20,4 +20,6 @@ define Target/Description
Build images for the Freescale MPC52xx based boards.
endef
KERNELNAME:="zImage"
$(eval $(call BuildTarget))

View File

@ -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

View File

@ -23,4 +23,6 @@ define Target/Description
Build firmware images for Freescale MPC83xx based boards (eg. RouterBoard 600).
endef
KERNELNAME:="uImage"
$(eval $(call BuildTarget))

View File

@ -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

View File

@ -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
)

View File

@ -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))

View File

@ -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))

View File

@ -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

View File

@ -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

View File

@ -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))

View File

@ -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

View File

@ -23,4 +23,6 @@ define Target/Description
Build firmware images for AMCC/IBM PPC44x based boards.
endef
KERNELNAME:="uImage cuImage.taishan"
$(eval $(call BuildTarget))

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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))

View File

@ -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