+define Image/Build/ALFA
+ $(call MkuImageLzma,$(2),$(3) $($(4)))
+ $(call Sysupgrade/RK,$(1),$(2),$(5),$(6))
+ if [ -e "$(call sysupname,$(1),$(2))" ]; then \
+ rm -rf $(KDIR)/$(1); \
+ mkdir -p $(KDIR)/$(1); \
+ cd $(KDIR)/$(1); \
+ cp $(KDIR)/vmlinux-$(2).uImage $(KDIR)/$(1)/vmlinux.gz.uImage; \
+ cp $(KDIR)/root.$(1) $(KDIR)/$(1)/pb9x-2.6.31-jffs2; \
+ $(TAR) zcf $(call factoryname,$(1),$(2)) -C $(KDIR)/$(1) \
+ vmlinux.gz.uImage pb9x-2.6.31-jffs2; \
+ ( \
+ echo $(7) | dd bs=32 count=1 conv=sync; \
+ echo -ne '\xfe'; \
+ ) >> $(call factoryname,$(1),$(2)); \
+ fi
+endef
+
+define Image/Build/TPLINKOLD
+ $(call Image/BuildLoaderAlone,$(2),gz,$(3),0x22000,0)
+ $(call MkuImageOKLI,$(2))
+ ( \
+ dd if=$(KDIR)/loader-$(2).gz bs=7680 count=1 conv=sync; \
+ dd if=$(KDIR)/vmlinux-$(2).okli conv=sync; \
+ ) > $(KDIR)/kernel-$(2).bin
+ -$(STAGING_DIR_HOST)/bin/mktplinkfw \
+ -H $(4) -W $(5) -F $(6) -N OpenWrt -V $(REVISION)\
+ -k $(KDIR)/kernel-$(2).bin \
+ -r $(KDIR)/root.$(1) \
+ -o $(call factoryname,$(1),$(2))
+ -$(STAGING_DIR_HOST)/bin/mktplinkfw \
+ -H $(4) -W $(5) -F $(6) -N OpenWrt -V $(REVISION) -s\
+ -k $(KDIR)/kernel-$(2).bin \
+ -r $(KDIR)/root.$(1) \
+ -o $(call sysupname,$(1),$(2))
+endef
+
+define Image/Build/TPLINKOLD/initramfs
+ $(call Image/BuildLoader,$(2),gz,$(3),0x80060000)
+ -$(STAGING_DIR_HOST)/bin/mktplinkfw -c \
+ -H $(4) -W $(5) -F $(6) -N OpenWrt -V $(REVISION) -s\
+ -k $(KDIR)/loader-$(2).gz \
+ -o $(call imgname,$(1),$(2))-uImage.bin
+endef
+