+define MkImageLzma
+ $(call PatchKernelLzma,$(1),$(2))
+ $(call MkImage,lzma,$(KDIR)/vmlinux-$(1).bin.lzma,$(KDIR)/vmlinux-$(1).uImage)
+endef
+
+define CatFiles
+ if [ `stat -c%s "$(1)"` -gt $(2) ]; then \
+ echo "Warning: $(1) is too big"; \
+ else if [ `stat -c%s $(3)` -gt $(4) ]; then \
+ echo "Warning: $(3) is too big"; \
+ else \
+ ( dd if=$(1) bs=$(2) conv=sync; dd if=$(3) ) > $(5); \
+ fi; fi
+endef
+
+define Sysupgrade/KRuImage
+ $(call CatFiles,$(KDIR)/vmlinux-$(2).uImage,$(3),$(KDIR)/root.$(1),$(4),$(call sysupname,$(1),$(2)))
+endef
+
+define mkmtd
+mtdparts=$(1):$(2)
+endef
+
+define mkmtd/phys
+$(call mkmtd,physmap-flash.0,$(1))
+endef
+
+define mkmtd/spi
+$(call mkmtd,spi0.0,$(1))
+endef
+