- 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; \
+ mkimage -A mips -O linux -T kernel -a 0x80060000 -C lzma -e \
+ 0x80060000 \
+ -n 'MIPS OpenWrt Linux-$(LINUX_VERSION)' \
+ -d $(KDIR)/vmlinux-$(2).bin.lzma $(KDIR)/vmlinux-$(2).uImage; \
+ ( \
+ dd if=$(KDIR)/vmlinux-$(2).uImage bs=1024k conv=sync; \
+ dd if=$(KDIR)/root.$(1) \
+ ) > $(call imgname,$(1),$(2))-sysupgrade.bin; \
+ ( \
+ dd if=$(call imgname,$(1),$(2))-sysupgrade.bin; \
+ echo -n "01AP94-AR7161-RT-080619-00"; \
+ ) > $(call imgname,$(1),$(2))-backup-loader.bin; \
+ if [ `stat -c%s $(call imgname,$(1),$(2))-sysupgrade.bin` -gt 4194304 ]; then \
+ echo "Warning: $(call imgname,$(1),$(2))-sysupgrade.bin is too big"; \
+ else \
+ ( \
+ dd if=$(call imgname,$(1),$(2))-sysupgrade.bin bs=4096k conv=sync; \
+ echo -n "00AP94-AR7161-RT-080619-00"; \
+ ) > $(call imgname,$(1),$(2))-factory.bin; \
+ fi; \
+ fi; fi
+endef
+
+define Image/Build/WZRHPG300NH
+ $(call PatchKernelLzma,$(2),$(3))
+ if [ `stat -c%s "$(KDIR)/vmlinux-$(2).bin.lzma"` -gt 1048576 ]; then \
+ echo "Warning: $(KDIR)/vmlinux-$(2).bin.lzma is too big"; \
+ else if [ `stat -c%s $(KDIR)/root.$(1)` -gt 31850496 ]; then \
+ echo "Warning: $(KDIR)/root.$(1) is too big"; \
+ else \
+ mkimage -A mips -O linux -T kernel -a 0x80060000 -C lzma -e \
+ 0x80060000 \
+ -n 'MIPS OpenWrt Linux-$(LINUX_VERSION)' \
+ -d $(KDIR)/vmlinux-$(2).bin.lzma $(KDIR)/vmlinux-$(2).uImage; \
+ ( \
+ dd if=$(KDIR)/vmlinux-$(2).uImage bs=1024k conv=sync; \
+ dd if=$(KDIR)/root.$(1) bs=128k conv=sync; \
+ ) > $(call imgname,$(1),$(2))-sysupgrade.bin; \
+ ( \
+ echo -n -e "# Airstation Public Fmt1\x00\x00\x00\x00\x00\x00\x00\x00"; \
+ dd if=$(call imgname,$(1),$(2))-sysupgrade.bin; \
+ ) > $(call imgname,$(1),$(2))-tftp.bin; \