- dd if=$(KDIR)/vmlinux-$(2).uImage bs=1280k conv=sync; \
- dd if=$(KDIR)/root.$(1) bs=6336k conv=sync; \
- echo -n $(4); \
- ) > $(call imgname,$(1),$(2)).bin; \
- wrt400n $(KDIR)/vmlinux-$(2).uImage $(KDIR)/root.$(1) $(call imgname,$(1),$(2)).webui; \
- fi; fi
+ 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))
+ $(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