X-Git-Url: http://git.rohieb.name/openwrt.git/blobdiff_plain/fc50c6a3b68a37b8a07cf29bb89fcd882f9f1833..b6c46c6358cc0113e3e6306b74e98d33949b36d9:/target/linux/ar71xx/image/Makefile?ds=inline diff --git a/target/linux/ar71xx/image/Makefile b/target/linux/ar71xx/image/Makefile index 8e5bfa40d..cc45e4e85 100644 --- a/target/linux/ar71xx/image/Makefile +++ b/target/linux/ar71xx/image/Makefile @@ -276,6 +276,28 @@ define Image/Build/DB120 fi endef +define Image/Build/AP121 + $(call PatchKernelLzma,$(2),$(3) $($(4))) + $(call MkImageLzma,$(KDIR)/vmlinux-$(2).bin.lzma,$(KDIR)/vmlinux-$(2).uImage) + if [ `stat -c%s $(KDIR)/vmlinux-$(2).uImage` -gt $(5) ]; then \ + echo "Warning: $(KDIR)/vmlinux-$(2).uImage is too big"; \ + elif [ `stat -c%s $(BIN_DIR)/$(IMG_PREFIX)-root.$(1)` -gt $(6) ]; then \ + echo "Warning: $(KDIR)/root.$(1) is too big"; \ + else \ + cp $(KDIR)/vmlinux-$(2).uImage $(call imgname,kernel,$(2)).bin; \ + cp $(BIN_DIR)/$(IMG_PREFIX)-root.$(1) $(call imgname,$(1),$(2)-rootfs).bin; \ + ( \ + dd if=$(BIN_DIR)/$(IMG_PREFIX)-root.$(1) bs=$(6) conv=sync; \ + dd if=$(KDIR)/vmlinux-$(2).uImage; \ + ) > $(call imgname,$(1),$(2))-sysupgrade.bin; \ + fi +endef + +define Image/Build/AP121/initramfs + $(call PatchKernelLzma,$(2),$(3) $($(4))) + $(call MkImageLzma,$(KDIR)/vmlinux-$(2).bin.lzma,$(call imgname,$(1),$(2))-uImage.bin) +endef + define Image/Build/MyLoader -$(STAGING_DIR_HOST)/bin/mkmylofw -B $(2) -s $(3) \ -p0x030000:0xe0000:al:0x80060000:kernel:$(KDIR)/vmlinux.bin.lzma \ @@ -398,14 +420,13 @@ define Image/Build/Netgear dd if=$(KDIR)/vmlinux-$(2).uImage.squashfs bs=1024k conv=sync; \ dd if=$(KDIR)/root.$(1) bs=64k; \ ) > $(call imgname,$(1),$(2))-sysupgrade.bin - $(STAGING_DIR_HOST)/bin/mkdniimg \ - -B $(6) -v OpenWrt.$(REVISION) \ - -i $(call imgname,$(1),$(2))-sysupgrade.bin \ - -o $(call imgname,$(1),$(2))-factory.img - $(STAGING_DIR_HOST)/bin/mkdniimg \ - -B $(6) -v OpenWrt.$(REVISION) -r "NA" \ - -i $(call imgname,$(1),$(2))-sysupgrade.bin \ - -o $(call imgname,$(1),$(2))-factory-NA.img + for r in $(7) ; do \ + [ -n "$$$$r" ] && dashr="-$$$$r" || dashr= ; \ + $(STAGING_DIR_HOST)/bin/mkdniimg \ + -B $(6) -v OpenWrt.$(REVISION) -r "$$$$r" $(8) \ + -i $(call imgname,$(1),$(2))-sysupgrade.bin \ + -o $(call imgname,$(1),$(2))-factory$$$$dashr.img; \ + done endef define Image/Build/Netgear/initramfs @@ -459,43 +480,58 @@ define Image/Build/Zcomax endef define Image/Build/Template/initramfs/initramfs - $(call Image/Build/$(1)/initramfs,initramfs,$(2),$(3),$(4),$(5),$(6),$(7)) + $(call Image/Build/$(1)/initramfs,initramfs,$(2),$(3),$(4),$(5),$(6),$(7),$(8)) endef define Image/Build/Template/all/squashfs - $(call Image/Build/$(1),squashfs,$(2),$(3),$(4),$(5),$(6),$(7)) + $(call Image/Build/$(1),squashfs,$(2),$(3),$(4),$(5),$(6),$(7),$(8)) endef define Image/Build/Template/all/jffs2-64k - $(call Image/Build/$(1),jffs2-64k,$(2),$(3),$(4),$(5),$(6),$(7)) + $(call Image/Build/$(1),jffs2-64k,$(2),$(3),$(4),$(5),$(6),$(7),$(8)) endef define Image/Build/Template/all/jffs2-128k - $(call Image/Build/$(1),jffs2-128k,$(2),$(3),$(4),$(5),$(6),$(7)) + $(call Image/Build/$(1),jffs2-128k,$(2),$(3),$(4),$(5),$(6),$(7),$(8)) endef define Image/Build/Template/squashfs-only/squashfs - $(call Image/Build/$(1),squashfs,$(2),$(3),$(4),$(5),$(6),$(7)) + $(call Image/Build/$(1),squashfs,$(2),$(3),$(4),$(5),$(6),$(7),$(8)) endef define Image/Build/Template/4k/squashfs - $(call Image/Build/$(1),squashfs-4k,$(2),$(3),$(4),$(5),$(6),$(7)) + $(call Image/Build/$(1),squashfs-4k,$(2),$(3),$(4),$(5),$(6),$(7),$(8)) endef define Image/Build/Template/64k/squashfs - $(call Image/Build/$(1),squashfs,$(2),$(3),$(4),$(5),$(6),$(7)) + $(call Image/Build/$(1),squashfs-64k,$(2),$(3),$(4),$(5),$(6),$(7),$(8)) endef define Image/Build/Template/64k/jffs2-64k - $(call Image/Build/$(1),jffs2-64k,$(2),$(3),$(4),$(5),$(6),$(7)) + $(call Image/Build/$(1),jffs2-64k,$(2),$(3),$(4),$(5),$(6),$(7),$(8)) endef define Image/Build/Template/128k/squashfs - $(call Image/Build/$(1),squashfs,$(2),$(3),$(4),$(5),$(6),$(7)) + $(call Image/Build/$(1),squashfs,$(2),$(3),$(4),$(5),$(6),$(7),$(8)) endef define Image/Build/Template/128k/jffs2-128k - $(call Image/Build/$(1),jffs2-128k,$(2),$(3),$(4),$(5),$(6),$(7)) + $(call Image/Build/$(1),jffs2-128k,$(2),$(3),$(4),$(5),$(6),$(7),$(8)) +endef + + +ap121_mtdlayout_2M=mtdparts=spi0.0:64k(u-boot)ro,1216k(rootfs),704k(kernel),64k(art)ro,1920k@0x10000(firmware) +ap121_mtdlayout_4M=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,2752k(rootfs),896k(kernel),64k(nvram),64k(art)ro,3648k@0x50000(firmware) + +ap121_cmdline=board=AP121 console=ttyATH0,115200 +define Image/Build/Profile/AP121 + $(call Image/Build/Template/$(fs_4k)/$(1),AP121,ap121-2M,$(ap121_cmdline),ap121_mtdlayout_2M,720896,1245184) + $(call Image/Build/Template/$(fs_64k)/$(1),AP121,ap121-4M,$(ap121_cmdline),ap121_mtdlayout_4M,917504,2818048) +endef + +ap121_mini_cmdline=board=AP121-MINI console=ttyATH0,115200 +define Image/Build/Profile/AP121MINI + $(call Image/Build/Template/$(fs_64k)/$(1),AP121,ap121-mini,$(ap121_mini_cmdline),ap121_mtdlayout_4M,917504,2818048) endef ap81_cmdline=board=AP81 console=ttyS0,115200 @@ -643,32 +679,32 @@ endef tlmr3220_cmdline=board=TL-MR3220 console=ttyS0,115200 define Image/Build/Profile/TLMR3220V1 - $(call Image/Build/Template/$(fs_4k)/$(1),TPLINK,tl-mr3220-v1,$(tlmr3220_cmdline),TL-MR3220v1) + $(call Image/Build/Template/$(fs_64k)/$(1),TPLINK,tl-mr3220-v1,$(tlmr3220_cmdline),TL-MR3220v1) endef tlmr3420_cmdline=board=TL-MR3420 console=ttyS0,115200 define Image/Build/Profile/TLMR3420V1 - $(call Image/Build/Template/$(fs_4k)/$(1),TPLINK,tl-mr3420-v1,$(tlmr3420_cmdline),TL-MR3420v1) + $(call Image/Build/Template/$(fs_64k)/$(1),TPLINK,tl-mr3420-v1,$(tlmr3420_cmdline),TL-MR3420v1) endef tlwa901nd_cmdline=board=TL-WA901ND console=ttyS0,115200 define Image/Build/Profile/TLWA901NDV1 - $(call Image/Build/Template/$(fs_4k)/$(1),TPLINK,tl-wa901nd-v1,$(tlwa901nd_cmdline),TL-WA901NDv1) + $(call Image/Build/Template/$(fs_64k)/$(1),TPLINK,tl-wa901nd-v1,$(tlwa901nd_cmdline),TL-WA901NDv1) endef tlwa901ndv2_cmdline=board=TL-WA901ND-v2 console=ttyS0,115200 define Image/Build/Profile/TLWA901NDV2 - $(call Image/Build/Template/$(fs_4k)/$(1),TPLINK,tl-wa901nd-v2,$(tlwa901ndv2_cmdline),TL-WA901NDv2) + $(call Image/Build/Template/$(fs_64k)/$(1),TPLINK,tl-wa901nd-v2,$(tlwa901ndv2_cmdline),TL-WA901NDv2) endef tlwe741ndv1_cmdline=board=TL-WR741ND console=ttyS0,115200 define Image/Build/Profile/TLWR741NDV1 - $(call Image/Build/Template/$(fs_4k)/$(1),TPLINK,tl-wr741nd-v1,$(tlwe741ndv1_cmdline),TL-WR741NDv1) + $(call Image/Build/Template/$(fs_64k)/$(1),TPLINK,tl-wr741nd-v1,$(tlwe741ndv1_cmdline),TL-WR741NDv1) endef tlwe740nv1_cmdline=board=TL-WR741ND console=ttyS0,115200 define Image/Build/Profile/TLWR740NV1 - $(call Image/Build/Template/$(fs_4k)/$(1),TPLINK,tl-wr740n-v1,$(tlwe740nv1_cmdline),TL-WR740Nv1) + $(call Image/Build/Template/$(fs_64k)/$(1),TPLINK,tl-wr740n-v1,$(tlwe740nv1_cmdline),TL-WR740Nv1) endef tlwr841nv15_cmdline=board=TL-WR841N-v1.5 console=ttyS0,115200 @@ -683,12 +719,12 @@ endef tlwr841ndv5_cmdline=board=TL-WR741ND console=ttyS0,115200 define Image/Build/Profile/TLWR841NDV5 - $(call Image/Build/Template/$(fs_4k)/$(1),TPLINK,tl-wr841nd-v5,$(tlwr841ndv5_cmdline),TL-WR841NDv5) + $(call Image/Build/Template/$(fs_64k)/$(1),TPLINK,tl-wr841nd-v5,$(tlwr841ndv5_cmdline),TL-WR841NDv5) endef tlwr841ndv7_cmdline=board=TL-WR741ND console=ttyS0,115200 define Image/Build/Profile/TLWR841NDV7 - $(call Image/Build/Template/$(fs_4k)/$(1),TPLINK,tl-wr841nd-v7,$(tlwr841ndv7_cmdline),TL-WR841NDv7) + $(call Image/Build/Template/$(fs_64k)/$(1),TPLINK,tl-wr841nd-v7,$(tlwr841ndv7_cmdline),TL-WR841NDv7) endef tlwr941ndv2_cmdline=board=TL-WR941ND console=ttyS0,115200 @@ -703,7 +739,7 @@ endef tlwr941ndv4_cmdline=board=TL-WR741ND console=ttyS0,115200 define Image/Build/Profile/TLWR941NDV4 - $(call Image/Build/Template/$(fs_4k)/$(1),TPLINK,tl-wr941nd-v4,$(tlwr941ndv4_cmdline),TL-WR941NDv4) + $(call Image/Build/Template/$(fs_64k)/$(1),TPLINK,tl-wr941nd-v4,$(tlwr941ndv4_cmdline),TL-WR941NDv4) endef tlwr1043nd_cmdline=board=TL-WR1043ND console=ttyS0,115200 @@ -716,8 +752,8 @@ wndr3700_mtdlayout=mtdparts=spi0.0:320k(u-boot)ro,128k(u-boot-env)ro,1024k(kerne wndr3700v2_cmdline=board=WNDR3700v2 console=ttyS0,115200 wndr3700v2_mtdlayout=mtdparts=spi0.0:320k(u-boot)ro,128k(u-boot-env)ro,1024k(kernel),14848k(rootfs),64k(art)ro,15872k@0x70000(firmware) define Image/Build/Profile/WNDR3700 - $(call Image/Build/Template/$(fs_64k)/$(1),Netgear,wndr3700,$(wndr3700_cmdline),wndr3700_mtdlayout,3700,WNDR3700) - $(call Image/Build/Template/$(fs_64k)/$(1),Netgear,wndr3700v2,$(wndr3700v2_cmdline),wndr3700v2_mtdlayout,3701,WNDR3700v2) + $(call Image/Build/Template/$(fs_64k)/$(1),Netgear,wndr3700,$(wndr3700_cmdline),wndr3700_mtdlayout,3700,WNDR3700,"" NA,) + $(call Image/Build/Template/$(fs_64k)/$(1),Netgear,wndr3700v2,$(wndr3700v2_cmdline),wndr3700v2_mtdlayout,3701,WNDR3700v2,"",-H 29763654+16+64) endef ap96_cmdline=board=AP96 console=ttyS0,115200 @@ -747,6 +783,11 @@ define Image/Build/Profile/WZRHPG30XNH $(call Image/Build/Template/$(fs_128k)/$(1),WZRHPG30XNH,wzr-hp-g301nh,$(wzrhpg301nh_cmdline),WZR-HP-G301NH) endef +wzrhpag300h_cmdline=board=WZR-HP-AG300H console=ttyS0,115200 +define Image/Build/Profile/WZRHPAG300H + $(call Image/Build/Template/$(fs_128k)/$(1),WZRHPG30XNH,wzr-hp-ag300h,$(wzrhpag300h_cmdline),WZR-HP-AG300H) +endef + zcn1523h28_cmdline=board=ZCN-1523H-2 console=ttyS0,115200 define Image/Build/Profile/ZCN1523H28 $(call Image/Build/Template/$(fs_64k)/$(1),Zcomax,zcn-1523h-2-8,$(zcn1523h28_cmdline)) @@ -758,6 +799,8 @@ define Image/Build/Profile/ZCN1523H516 endef define Image/Build/Profile/Default + $(call Image/Build/Profile/AP121,$(1)) + $(call Image/Build/Profile/AP121MINI,$(1)) $(call Image/Build/Profile/AP81,$(1)) $(call Image/Build/Profile/AP83,$(1)) $(call Image/Build/Profile/A02RBW300N,$(1)) @@ -798,6 +841,7 @@ define Image/Build/Profile/Default $(call Image/Build/Profile/WRT400N,$(1)) $(call Image/Build/Profile/WRT160NL,$(1)) $(call Image/Build/Profile/WZRHPG30XNH,$(1)) + $(call Image/Build/Profile/WZRHPAG300H,$(1)) $(call Image/Build/Profile/ZCN1523H28,$(1)) $(call Image/Build/Profile/ZCN1523H516,$(1)) endef @@ -815,10 +859,12 @@ define Image/Build/Profile/Madwifi endef define Image/Build/squashfs - dd if=$(KDIR)/root.squashfs of=$(KDIR)/root.squashfs-4k.tmp0 bs=4k conv=sync - $(call add_jffs2_mark,$(KDIR)/root.squashfs-4k.tmp0) - dd if=$(KDIR)/root.squashfs-4k.tmp0 of=$(BIN_DIR)/$(IMG_PREFIX)-root.squashfs-4k bs=4k conv=sync - rm -f $(KDIR)/root.squashfs-4k.tmp0 + cp $(KDIR)/root.squashfs $(KDIR)/root.squashfs-4k + $(STAGING_DIR_HOST)/bin/padjffs2 $(KDIR)/root.squashfs-4k 4 + cp $(KDIR)/root.squashfs-4k $(BIN_DIR)/$(IMG_PREFIX)-root.squashfs-4k + cp $(KDIR)/root.squashfs $(KDIR)/root.squashfs-64k + $(STAGING_DIR_HOST)/bin/padjffs2 $(KDIR)/root.squashfs-64k 4 8 64 + cp $(KDIR)/root.squashfs-64k $(BIN_DIR)/$(IMG_PREFIX)-root.squashfs-64k $(call prepare_generic_squashfs,$(KDIR)/root.squashfs) endef