- $(call PatchKernelLzma,$(2),$(3) $(dir825b1_mtdlayout))
- $(call MkImageLzma,$(KDIR)/vmlinux-$(2).bin.lzma,$(call imgname,$(1),$(2)).bin)
- if [ `stat -c%s "$(call imgname,$(1),$(2)).bin"` -gt 1048576 ]; then \
- echo "Warning: $(KDIR)/vmlinux-$(2).bin.lzma is too big"; \
- rm -f $(call imgname,$(1),$(2)).bin; \
- else if [ `stat -c%s $(KDIR)/root.$(1)` -gt 5308416 ]; then \
- echo "Warning: $(KDIR)/root.$(1) is too big"; \
- rm -f $(call imgname,$(1),$(2)).bin; \
- else \
- dd if=$(KDIR)/root.$(1) of=$(call imgname,$(1),$(2)).bin bs=1k seek=1024; \
- cp $(call imgname,$(1),$(2)).bin $(call imgname,$(1),$(2))-backup-loader.bin; \
- echo -n "01AP94-AR7161-RT-080619-00" >> $(call imgname,$(1),$(2))-backup-loader.bin; \
- fi; fi
+ $(call MkuImageLzma,$(2),$(3) $(dir825b1_mtdlayout))
+ $(call Sysupgrade/KR,$(1),$(2),1048576,5308416)
+ if [ -e "$(call sysupname,$(1),$(2))" ]; then \
+ ( \
+ 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.99 \
+ -i $(call sysupname,$(1),$(2)) \
+ -o $(KDIR)/$(2).enc; \
+ buffalo-tag -b $(4) -p $(4) -a ath -v 1.99 -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
+endef
+
+define Image/Build/WHRHPG300N
+ $(call MkuImageLzma,$(2),$(3) $($(4)))
+ $(call Sysupgrade/KR,$(1),$(2),917504,2883584)
+ 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 $(5) -v 1.99 \
+ -i $(call sysupname,$(1),$(2)) \
+ -o $(KDIR)/$(2).enc; \
+ buffalo-tag -b $(5) -p $(5) -a ath -v 1.99 -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