+ $(call MkImageLzma,$(2),$(3) $($(4)))
+ $(call Sysupgrade/KRuImage,$(1),$(2),$(5),$(6))
+endef
+
+define BuildFirmware/Generic/initramfs
+ $(call MkImageLzma,$(2),$(3) $($(4)))
+ $(CP) $(KDIR)/vmlinux-$(2).uImage $(call imgname,$(1),$(2))-uImage.bin
+endef
+
+define BuildFirmware/WL341V3
+ $(call MkImageLzma,$(2),$(3) $($(4)))
+ $(call Sysupgrade/KRuImage,$(1),$(2),$(5),$(6))
+ if [ -e "$(call sysupname,$(1),$(2))" ]; then \
+ ( \
+ dd if=/dev/zero bs=195936 count=1; \
+ echo "1.01"; \
+ dd if=/dev/zero bs=581 count=1; \
+ echo -n -e "\x73\x45\x72\x43\x6F\x4D\x6D\x00\x01\x00\x00\x59\x4E\x37\x95\x58\x10\x00\x20\x00\x28\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x11\x03\x00\x00\x80\x00\x00\x00\x00\x03\x00\x00\x10\x12\x00\x00\x00\x10\x73\x45\x72\x43\x6F\x4D\x6D"; \
+ dd if=/dev/zero bs=65552 count=1; \
+ dd if=$(KDIR)/vmlinux-$(2).uImage bs=$(5) conv=sync; \
+ dd if=$(KDIR)/root.$(1) bs=64k conv=sync; \
+ dd if=/dev/zero bs=`expr 4194304 - 262144 - 16 - $(5) - \( \( \( \`stat -c%s $(KDIR)/root.$(1)\` / 65536 \) + 1 \) \* 65536 \)` count=1; \
+ echo -n -e "\x11\x03\x80\x00\x10\x12\x90\xF7\x65\x52\x63\x4F\x6D\x4D\x00\x00"; \
+ ) > $(call imgname,$(1),$(2))-factory.bin; \
+ fi
+endef
+
+define BuildFirmware/Buffalo
+ $(call MkImageLzma,$(2),$(3) $($(4)))
+ $(call Sysupgrade/KRuImage,$(1),$(2),$(5),$(6))
+ if [ -e "$(call sysupname,$(1),$(2))" ]; then \
+ buffalo-enc -p $(3) -v 1.76 \
+ -i $(KDIR)/vmlinux-$(2).uImage \
+ -o $(KDIR)/vmlinux-$(2).uImage.enc; \
+ buffalo-enc -p $(3) -v 1.76 \
+ -i $(KDIR)/root.$(1) \
+ -o $(KDIR)/root.$(2).enc; \
+ buffalo-tag -b $(3) -p $(3) -a ram -v 1.76 -m 1.01 \
+ -l mlang8 -f 1 -r EU \
+ -i $(KDIR)/vmlinux-$(2).uImage.enc \
+ -i $(KDIR)/root.$(2).enc \
+ -o $(call imgname,$(1),$(2))-factory-EU.bin; \
+ fi
+endef
+
+define BuildFirmware/Buffalo2
+ $(call BuildFirmware/Generic,$(1),$(2),board=$(3),$($(4)),$(5),$(6))
+endef
+
+define BuildFirmware/NW718