2 # Copyright (C) 2010 OpenWrt.org
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
7 include $(TOPDIR
)/rules.mk
8 include $(INCLUDE_DIR
)/image.mk
11 $(BIN_DIR
)/$(IMG_PREFIX
)-$(2)-$(patsubst jffs2-
%,jffs2
,$(patsubst squashfs-
%,squashfs
,$(1)))
15 $(call imgname
,$(1),$(2))-sysupgrade.bin
19 $(call imgname
,$(1),$(2))-factory.bin
22 ifeq ($(CONFIG_TARGET_ROOTFS_INITRAMFS
),y
)
23 IMAGE_SUFFIX
=-initramfs
26 zImage
:=$(BIN_DIR
)/$(IMG_PREFIX
)-zImage
$(IMAGE_SUFFIX
)
28 DTS_TARGETS
= mpc8548cds_32b p1010rdb tl-wdr4900-v1 p1020rdb
29 BOOT_IMAGES
:=zImage cuImage.tl-wdr4900-v1
32 $(foreach image
,$(BOOT_IMAGES
),
33 cp
$(LINUX_DIR
)/arch
/powerpc
/boot
/$(image
) $(KDIR
)/$(image
)
37 define Image
/BuildKernel
38 cp
$(KDIR
)/zImage
$(IMAGE_SUFFIX
) $(zImage
)
39 $(foreach dts
,$(DTS_TARGETS
),
40 $(LINUX_DIR
)/scripts
/dtc
/dtc
-I dts
-O dtb
$(LINUX_DIR
)/arch
/powerpc
/boot
/dts
/$(dts
).dts
> $(BIN_DIR
)/$(IMG_PREFIX
)-$(dts
).fdt
44 define Image
/Build
/TPLINK
45 -$(STAGING_DIR_HOST
)/bin
/mktplinkfw \
46 -H
$(4) -W
$(5) -F
$(6) -N OpenWrt
-V
$(REVISION
) $(7) \
48 -r
$(KDIR
)/root.
$(1) \
49 -o
$(call factoryname
,$(1),$(2))
50 -$(STAGING_DIR_HOST
)/bin
/mktplinkfw \
51 -H
$(4) -W
$(5) -F
$(6) -N OpenWrt
-V
$(REVISION
) $(7) -s \
53 -r
$(KDIR
)/root.
$(1) \
54 -o
$(call sysupname
,$(1),$(2))
57 define Image
/Build
/Profile
/TLWDR4900
58 $(call Image
/Build
/TPLINK
,$(1),tl-wdr4900-v1
,cuImage.tl-wdr4900-v1
,0x49000001,1,16Mppc
)
61 define Image
/Build
/Profile
/Default
62 $(call Image
/Build
/Profile
/TLWDR4900
,$(1))
65 define Image
/Build
/ext2
66 cp
$(KDIR
)/root.
$(1) $(BIN_DIR
)/$(IMG_PREFIX
)-ext2.img
69 define Image
/Build
/squashfs
70 $(call prepare_generic_squashfs
,$(KDIR
)/root.squashfs
)
71 cp
$(KDIR
)/root.squashfs
$(BIN_DIR
)/$(IMG_PREFIX
)-root.squashfs
77 $(call Image
/Build
/$(1),$(1))
78 $(call Image
/Build
/Profile
/$(PROFILE
),$(1))
81 $(eval
$(call BuildImage
))