-define Image/Build/AP81
- cp $(KDIR)/vmlinux $(KDIR)/vmlinux-$(2)
- $(STAGING_DIR_HOST)/bin/patch-cmdline $(KDIR)/vmlinux-$(2) '$(strip $(3))'
- $(STAGING_DIR_HOST)/bin/lzma e $(KDIR)/vmlinux-$(2) $(KDIR)/vmlinux-$(2).bin.lzma
- 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=768k conv=sync; \
- dd if=$(KDIR)/root.$(1) bs=3008k conv=sync; \
- ) > $(call imgname,$(1),$(2)).bin
- cp $(call imgname,$(1),$(2)).bin $(call imgname,$(1),$(2)).webui
- echo -n $(4) >> $(call imgname,$(1),$(2)).webui
+define Image/Build/WRT400N
+ $(call PatchKernelLzma,$(2),$(3))
+ if [ `stat -c%s "$(KDIR)/vmlinux-$(2).bin.lzma"` -gt 1310720 ]; then \
+ echo "Warning: $(KDIR)/vmlinux-$(2).bin.lzma is too big"; \
+ else if [ `stat -c%s $(KDIR)/root.$(1)` -gt 6488064 ]; 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=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
+endef
+
+dir825b1_mtdlayout=mtdparts=spi0.0:256k(uboot)ro,64k(config)ro,1024k(kernel),5184k(rootfs),64k(caldata)ro,6208k@0x50000(firmware)
+define Image/Build/DIR825B1
+ $(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
+endef
+
+cameo_mtdlayout=mtdparts=spi0.0:128k(u-boot)ro,64k(config)ro,896k(kernel),2880k(rootfs),64k(art)ro,3776k@0x30000(firmware)
+define Image/Build/Cameo
+ $(call PatchKernelLzma,$(2),$(3) $(cameo_mtdlayout))
+ if [ `stat -c%s "$(KDIR)/vmlinux-$(2).bin.lzma"` -gt 917504 ]; then \
+ echo "Warning: $(KDIR)/vmlinux-$(2).bin.lzma is too big"; \
+ else if [ `stat -c%s $(KDIR)/root.$(1)` -gt 2949120 ]; 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=896k conv=sync; \
+ dd if=$(KDIR)/root.$(1) bs=2880k conv=sync; \
+ echo -n $(4); \
+ ) > $(call imgname,$(1),$(2)).uni; \
+ fi; fi
+endef
+
+define Image/Build/AP83
+ $(call PatchKernelGzip,$(2),$(3))
+ if [ `stat -c%s "$(KDIR)/vmlinux-$(2).bin.gz"` -gt 1310720 ]; then \
+ echo "Warning: $(KDIR)/vmlinux-$(2).bin.gz is too big"; \
+ else if [ `stat -c%s $(KDIR)/root.$(1)` -gt 6619136 ]; then \
+ echo "Warning: $(KDIR)/root.$(1) is too big"; \
+ else \
+ mkimage -A mips -O linux -T kernel -a 0x80060000 -C gzip -e \
+ 0x80060000 \
+ -n 'MIPS OpenWrt Linux-$(LINUX_VERSION)' \
+ -d $(KDIR)/vmlinux-$(2).bin.gz \
+ $(KDIR)/vmlinux-$(2).uImage; \
+ dd if=$(KDIR)/vmlinux-$(2).uImage \
+ of=$(call imgname,kernel,$(2)).bin bs=64k conv=sync; \
+ dd if=$(KDIR)/root.$(1) \
+ of=$(call imgname,$(1),$(2)-rootfs).bin bs=128k conv=sync; \
+ ( \
+ dd if=$(KDIR)/vmlinux-$(2).uImage bs=1280k conv=sync; \
+ dd if=$(KDIR)/root.$(1); \
+ ) > $(call imgname,$(1),$(2)-firmware).bin; \
+ fi; fi