+define Image/Build/Template/squashfs-only/squashfs
+ $(call Image/Build/$(1),squashfs,$(2),$(3),$(4),$(5),$(6),$(7),$(8))
+endef
+
+define Image/Build/Template/4k/squashfs
+ $(call Image/Build/$(1),squashfs-4k,$(2),$(3),$(4),$(5),$(6),$(7),$(8))
+endef
+
+define Image/Build/Template/64k/squashfs
+ $(call Image/Build/$(1),squashfs-64k,$(2),$(3),$(4),$(5),$(6),$(7),$(8))
+endef
+
+define Image/Build/Template/64k/jffs2-64k
+ $(call Image/Build/$(1),jffs2-64k,$(2),$(3),$(4),$(5),$(6),$(7),$(8))
+endef
+
+define Image/Build/Template/128k/squashfs
+ $(call Image/Build/$(1),squashfs,$(2),$(3),$(4),$(5),$(6),$(7),$(8))
+endef
+
+define Image/Build/Template/128k/jffs2-128k
+ $(call Image/Build/$(1),jffs2-128k,$(2),$(3),$(4),$(5),$(6),$(7),$(8))
+endef
+
+
+ap121_mtdlayout_2M=mtdparts=spi0.0:64k(u-boot)ro,1216k(rootfs),704k(kernel),64k(art)ro,1920k@0x10000(firmware)
+ap121_mtdlayout_4M=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,2752k(rootfs),896k(kernel),64k(nvram),64k(art)ro,3648k@0x50000(firmware)
+
+ap121_cmdline=board=AP121 console=ttyATH0,115200
+define Image/Build/Profile/AP121
+ $(call Image/Build/Template/$(fs_4k)/$(1),AthLzma,ap121-2M,$(ap121_cmdline),ap121_mtdlayout_2M,720896,1245184,RK)
+ $(call Image/Build/Template/$(fs_64k)/$(1),AthLzma,ap121-4M,$(ap121_cmdline),ap121_mtdlayout_4M,917504,2818048,RK)
+endef
+
+ap121_mini_cmdline=board=AP121-MINI console=ttyATH0,115200
+define Image/Build/Profile/AP121MINI
+ $(call Image/Build/Template/$(fs_64k)/$(1),AthLzma,ap121-mini,$(ap121_mini_cmdline),ap121_mtdlayout_4M,917504,2818048,RK)
+endef
+
+ap81_cmdline=board=AP81 console=ttyS0,115200
+define Image/Build/Profile/AP81
+ $(call Image/Build/Template/$(fs_64k)/$(1),AthGzip,ap81,$(ap81_cmdline),,1310720,6619136,KR)
+endef
+
+ap83_cmdline=board=AP83 console=ttyS0,115200
+define Image/Build/Profile/AP83
+ $(call Image/Build/Template/$(fs_64k)/$(1),AthGzip,ap83,$(ap83_cmdline),,1310720,6619136,KR)
+endef
+
+ap96_cmdline=board=AP96 console=ttyS0,115200
+define Image/Build/Profile/AP96
+ $(call Image/Build/Template/$(fs_64k)/$(1),AthGzip,ap96,$(ap96_cmdline),ap96_mtdlayout,1769472,6291456,RK)
+endef
+
+db120_cmdline=board=DB120 console=ttyS0,115200
+define Image/Build/Profile/DB120
+ $(call Image/Build/Template/$(fs_64k)/$(1),AthLzma,db120,$(db120_cmdline),,1441792,6488064,RK)
+endef
+
+pb42_cmdline=board=PB42 console=ttyS0,115200
+define Image/Build/Profile/PB42
+ $(call Image/Build/Template/$(fs_64k)/$(1),PB4X,pb42,$(pb42_cmdline))
+endef
+
+pb44_cmdline=board=PB44 console=ttyS0,115200
+define Image/Build/Profile/PB44
+ $(call Image/Build/Template/$(fs_64k)/$(1),PB4X,pb44,$(pb44_cmdline))
+endef
+
+pb92_cmdline=board=PB92 console=ttyS0,115200
+define Image/Build/Profile/PB92
+ $(call Image/Build/Template/$(fs_64k)/$(1),AthLzma,pb92,$(pb92_cmdline),,917504,2818048,KR)