+ -o $(call imgname,$(1),$(2))-universal.bin
+endef
+
+define Image/Build/TPLINK/initramfs
+ $(call PatchKernelGzip,$(2),$(3))
+ -$(STAGING_DIR_HOST)/bin/mktplinkfw -c \
+ -B $(4) -N OpenWrt -V $(REVISION)\
+ -k $(KDIR)/vmlinux-$(2).bin.gz \
+ -o $(call imgname,$(1),$(2))-uImage.bin
+endef
+
+define Image/Build/CyberTAN
+ $(call PatchKernelGzip,$(2),$(3))
+ $(call MkImageGzip,$(KDIR)/vmlinux-$(2).bin.gz,$(KDIR)/vmlinux-$(2).uImage)
+ ( \
+ dd if=$(KDIR)/vmlinux-$(2).uImage bs=64k conv=sync; \
+ dd if=/dev/zero bs=1 count=65476; \
+ dd if=$(KDIR)/root.$(1) bs=64k; \
+ ) > $(KDIR)/vmlinux-$(2).image
+ $(STAGING_DIR_HOST)/bin/trx -o $(KDIR)/vmlinux-$(2).trx \
+ -f $(KDIR)/vmlinux-$(2).image
+ -$(STAGING_DIR_HOST)/bin/addpattern -B $(2) -v v$(4) -g \
+ -i $(KDIR)/vmlinux-$(2).trx \
+ -o $(call imgname,$(1),$(2)).bin
+endef
+
+wndr3700_mtdlayout=mtdparts=spi0.0:320k(u-boot)ro,128k(u-boot-env)ro,1024k(kernel),6656k(rootfs),64k(art)ro,7680k@0x70000(firmware)
+define Image/Build/WNDR3700
+ $(call PatchKernelLzma,$(2),$(3) $(wndr3700_mtdlayout))
+ $(call MkImageLzma,$(KDIR)/vmlinux-$(2).bin.lzma,$(KDIR)/vmlinux-$(2).uImage)
+ mkdir -p $(KDIR)/wndr3700/image
+ $(STAGING_DIR_HOST)/bin/wndr3700 \
+ $(KDIR)/vmlinux-$(2).uImage \
+ $(KDIR)/wndr3700/image/uImage
+ $(STAGING_DIR_HOST)/bin/mksquashfs-lzma \
+ $(KDIR)/wndr3700 $(KDIR)/vmlinux-$(2).uImage.squashfs.tmp \
+ -nopad -noappend -root-owned -be
+ -rm -rf $(KDIR)/wndr3700
+ mkimage -A mips -O linux -T filesystem -C none \
+ -a 0xbf070000 -e 0xbf070000 \
+ -n 'MIPS OpenWrt Linux-$(LINUX_VERSION)' \
+ -d $(KDIR)/vmlinux-$(2).uImage.squashfs.tmp \
+ $(KDIR)/vmlinux-$(2).uImage.squashfs.tmp2
+ $(STAGING_DIR_HOST)/bin/wndr3700 \
+ $(KDIR)/vmlinux-$(2).uImage.squashfs.tmp2 \
+ $(KDIR)/vmlinux-$(2).uImage.squashfs
+ -rm -f $(KDIR)/vmlinux-$(2).uImage.squashfs.tmp*
+ ( \
+ dd if=$(KDIR)/vmlinux-$(2).uImage.squashfs bs=1024k conv=sync; \
+ dd if=$(KDIR)/root.$(1) bs=64k; \
+ ) > $(call imgname,$(1),$(2))-sysupgrade.bin
+ $(STAGING_DIR_HOST)/bin/mkdniimg \
+ -B WNDR3700 -v OpenWrt.$(REVISION) \
+ -i $(call imgname,$(1),$(2))-sysupgrade.bin \
+ -o $(call imgname,$(1),$(2))-factory.img
+endef
+
+define Image/Build/WNDR3700/initramfs
+ $(call PatchKernelLzma,$(2),$(3) $(wndr3700_mtdlayout))
+ $(call MkImageLzma,$(KDIR)/vmlinux-$(2).bin.lzma,$(KDIR)/vmlinux-$(2).uImage)
+ $(STAGING_DIR_HOST)/bin/wndr3700 \
+ $(KDIR)/vmlinux-$(2).uImage \
+ $(call imgname,$(1),$(2))-uImage.bin
+endef
+
+define Image/Build/Template/initramfs/initramfs
+ $(call Image/Build/$(1)/initramfs,initramfs,$(2),$(3),$(4),$(5),$(6),$(7))