+ $(call MkuImage,gzip,$(KDIR)/vmlinux.bin.gz,$(UIMAGE)-gzip.bin)
+ $(call MkuImage,lzma,$(KDIR)/vmlinux.bin.lzma,$(UIMAGE)-lzma.bin)
+ $(call Image/Build/Initramfs)
+endef
+
+define Image/Build/WRT400N
+ $(call MkuImageLzma,$(2),$(3))
+ $(call Sysupgrade/KR,$(1),$(2),1310720,6488064)
+ if [ -e "$(call sysupname,$(1),$(2))" ]; then \
+ wrt400n $(KDIR)/vmlinux-$(2).uImage $(KDIR)/root.$(1) $(call factoryname,$(1),$(2)); \
+ fi
+endef
+
+dir825b1_mtdlayout=mtdparts=spi0.0:256k(uboot)ro,64k(config)ro,1024k(kernel),5184k(rootfs),64k(caldata)ro,1600k(unknown)ro,6208k@0x50000(firmware)
+define Image/Build/DIR825B1
+ $(call MkuImageLzma,$(2),$(3) $(dir825b1_mtdlayout))
+ $(call Sysupgrade/KR,$(1),$(2),1048576,5308416)
+ if [ -e "$(call sysupname,$(1),$(2))" ]; then \
+ ( \
+ dd if=$(call sysupname,$(1),$(2)); \
+ echo -n "01AP94-AR7161-RT-080619-00"; \
+ ) > $(call imgname,$(1),$(2))-backup-loader.bin; \
+ if [ `stat -c%s $(call sysupname,$(1),$(2))` -gt 4194304 ]; then \
+ echo "Warning: $(call sysupname,$(1),$(2)) is too big"; \
+ else \
+ ( \
+ dd if=$(call sysupname,$(1),$(2)) bs=4096k conv=sync; \
+ echo -n "00AP94-AR7161-RT-080619-00"; \
+ ) > $(call factoryname,$(1),$(2)); \
+ fi; \
+ fi
+endef
+
+define Image/Build/WZRHPG30XNH
+ $(call MkuImageLzma,$(2),$(3) $(dir825b1_mtdlayout))
+ $(call Sysupgrade/KR,$(1),$(2),1048576,31850496)
+ if [ -e "$(call sysupname,$(1),$(2))" ]; then \
+ ( \
+ echo -n -e "# Airstation Public Fmt1\x00\x00\x00\x00\x00\x00\x00\x00"; \
+ dd if=$(call sysupname,$(1),$(2)); \
+ ) > $(call imgname,$(1),$(2))-tftp.bin; \
+ buffalo-enc -p $(4) -v 1.76 \
+ -i $(call sysupname,$(1),$(2)) \
+ -o $(KDIR)/$(2).enc; \
+ buffalo-tag -b $(4) -p $(4) -a ath -v 1.76 -m 1.01 -l mlang8 \
+ -w 3 -c 0x80041000 -d 0x801e8000 -f 1 -r M_ \
+ -i $(KDIR)/$(2).enc \
+ -o $(call factoryname,$(1),$(2)); \
+ fi
+endef
+
+define Image/Build/Cameo
+ $(call MkuImageLzma,$(2),$(3) $($(4)))
+ $(call Sysupgrade/KR,$(1),$(2),$(5),$(6))
+ if [ -e "$(call sysupname,$(1),$(2))" ]; then \
+ ( \
+ dd if=$(KDIR)/vmlinux-$(2).uImage bs=$(5) conv=sync; \
+ dd if=$(KDIR)/root.$(1) bs=$(6) conv=sync; \
+ echo -n $(7); \
+ ) > $(call factoryname,$(1),$(2)); \
+ fi
+endef
+
+cameo913x_mtdlayout=mtdparts=spi0.0:128k(u-boot)ro,64k(config)ro,896k(kernel),2944k(rootfs),64k(art)ro,3840k@0x30000(firmware)
+define Image/Build/Cameo913x
+ $(call Image/Build/Cameo,$(1),$(2),$(3),$(cameo913x_mtdlayout),917504,2949120,$(4))
+endef
+
+cameo7240_mtdlayout=mtdparts=spi0.0:192k(u-boot)ro,64k(nvram)ro,896k(kernel),2816k(rootfs),64k(mac)ro,64k(art)ro,3712k@0x40000(firmware)
+define Image/Build/Cameo7240
+ $(call Image/Build/Cameo,$(1),$(2),$(3),$(cameo7240_mtdlayout),917504,2818048,$(4))
+endef
+
+define Image/Build/Ath
+ $(call Sysupgrade/$(7),$(1),$(2),$(5),$(6))
+ if [ -e "$(call sysupname,$(1),$(2))" ]; then \
+ dd if=$(KDIR)/vmlinux-$(2).uImage \
+ of=$(call imgname,kernel,$(2)).bin bs=64k conv=sync; \
+ dd if=$(KDIR)/root.$(1) \
+ of=$(call imgname,$(1),$(2)-rootfs).bin bs=128k conv=sync; \
+ fi
+endef
+
+define Image/Build/AthGzip
+ $(call MkuImageGzip,$(2),$(3) $($(4)))
+ $(call Image/Build/Ath,$(1),$(2),$(3),$(4),$(5),$(6),$(7))
+endef
+
+define Image/Build/AthGzip/initramfs
+ $(call MkuImageLzma,$(2),$(3) $($(4)))
+endef
+
+define Image/Build/AthLzma
+ $(call MkuImageLzma,$(2),$(3) $($(4)))
+ $(call Image/Build/Ath,$(1),$(2),$(3),$(4),$(5),$(6),$(7))
+endef
+
+define Image/Build/AthLzma/initramfs
+ $(call MkuImageLzma,$(2),$(3) $($(4)))
+endef
+
+define Image/Build/PB4X
+ $(call PatchKernelLzma,$(2),$(3))
+ dd if=$(KDIR)/vmlinux-$(2).bin.lzma \
+ of=$(call imgname,kernel,$(2)).bin bs=64k conv=sync
+ dd if=$(KDIR)/root.$(1) \
+ of=$(call imgname,$(1),$(2)-rootfs).bin bs=128k conv=sync
+ -sh $(TOPDIR)/scripts/combined-image.sh \
+ "$(call imgname,kernel,$(2)).bin" \
+ "$(call imgname,$(1),$(2)-rootfs).bin" \
+ $(call sysupname,$(1),$(2))