UIMAGE:=$(IMG_PREFIX)-uImage
ifeq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),y)
-VMLINUX:=$(IMG_PREFIX)-vmlinux-initramfs
-UIMAGE:=$(IMG_PREFIX)-uImage-initramfs
define Image/Build/Initramfs
$(call Image/Build/Profile/$(PROFILE),initramfs)
endef
endef
define PatchKernelLzmaDtb
- cp $(KDIR)/vmlinux $(KDIR)/vmlinux-$(1)
+ cp $(KDIR)/vmlinux$(3) $(KDIR)/vmlinux-$(1)$(3)
$(LINUX_DIR)/scripts/dtc/dtc -O dtb -o $(KDIR)/$(2).dtb ../dts/$(2).dts
- $(STAGING_DIR_HOST)/bin/patch-dtb $(KDIR)/vmlinux-$(1) $(KDIR)/$(2).dtb
- $(call CompressLzma,$(KDIR)/vmlinux-$(1),$(KDIR)/vmlinux-$(1).bin.lzma)
+ $(STAGING_DIR_HOST)/bin/patch-dtb $(KDIR)/vmlinux-$(1)$(3) $(KDIR)/$(2).dtb
+ $(call CompressLzma,$(KDIR)/vmlinux-$(1)$(3),$(KDIR)/vmlinux-$(1)$(3).bin.lzma)
endef
define MkImageLzmaDtb
- $(call PatchKernelLzmaDtb,$(1),$(2))
- $(call MkImage,lzma,$(KDIR)/vmlinux-$(1).bin.lzma,$(KDIR)/vmlinux-$(1).uImage,$(3))
+ $(call PatchKernelLzmaDtb,$(1),$(2),$(4))
+ $(call MkImage,lzma,$(KDIR)/vmlinux-$(1)$(4).bin.lzma,$(KDIR)/vmlinux-$(1)$(4).uImage,$(3))
endef
define BuildFirmware/OF
endef
define BuildFirmware/OF/initramfs
- $(call MkImageLzmaDtb,$(2),$(3))
- $(CP) $(KDIR)/vmlinux-$(2).uImage $(call imgname,$(1),$(2))-uImage.bin
+ $(call MkImageLzmaDtb,$(2),$(3),$(4),-initramfs)
+ $(CP) $(KDIR)/vmlinux-$(2)-initramfs.uImage $(call imgname,$(1),$(2))-uImage.bin
endef
# $(2) = lowercase board name
# $(3) = dts file
ralink_default_fw_size_8M=8060928
-BuildFirmware/Default8M/squashfs=$(call BuildFirmware/OF,$(1),$(2),$(3),$(ralink_default_fw_size_8M))
-BuildFirmware/Default8M/initramfs=$(call BuildFirmware/OF/initramfs,$(1),$(2),$(3))
+BuildFirmware/Default8M/squashfs=$(call BuildFirmware/OF,$(1),$(2),$(3),$(ralink_default_fw_size_8M),$(4))
+BuildFirmware/Default8M/initramfs=$(call BuildFirmware/OF/initramfs,$(1),$(2),$(3),$(4))
+
+ralink_default_fw_size_16M=16121856
+BuildFirmware/Default16M/squashfs=$(call BuildFirmware/OF,$(1),$(2),$(3),$(ralink_default_fw_size_16M),$(4))
+BuildFirmware/Default16M/initramfs=$(call BuildFirmware/OF/initramfs,$(1),$(2),$(3),$(4))
# Build images for a custom sized flash layout
# $(1) = squashfs/initramfs
endef
BuildFirmware/UMedia/initramfs=$(call BuildFirmware/OF/initramfs,$(1),$(2),$(3))
+# sign dap 1350 based images
+dap1350_mtd_size=7667712
+define BuildFirmware/dap1350/squashfs
+ $(call BuildFirmware/CustomFlash/$(1),$(1),$(2),$(3),$(dap1350_mtd_size))
+ -mkdapimg -s $(4) \
+ -i $(call sysupname,$(1),$(2)) \
+ -o $(call imgname,$(1),$(2))-factory.bin
+endef
+BuildFirmware/dap1350/initramfs=$(call BuildFirmware/OF/initramfs,$(1),$(2),$(3))
+# Sign Poray images
+define BuildFirmware/Poray4M/squashfs
+ $(call BuildFirmware/Default4M/$(1),$(1),$(2),$(3))
+ if [ -e "$(call sysupname,$(1),$(2))" ]; then \
+ mkporayfw -B $(3) -F 4M \
+ -f $(call sysupname,$(1),$(2)) \
+ -o $(call imgname,$(1),$(2))-factory.bin; \
+ fi
+endef
+BuildFirmware/Poray4M/initramfs=$(call BuildFirmware/OF/initramfs,$(1),$(2),$(3))
+
+define BuildFirmware/Poray8M/squashfs
+ $(call BuildFirmware/Default8M/$(1),$(1),$(2),$(3))
+ if [ -e "$(call sysupname,$(1),$(2))" ]; then \
+ mkporayfw -B $(3) -F 8M \
+ -f $(call sysupname,$(1),$(2)) \
+ -o $(call imgname,$(1),$(2))-factory.bin; \
+ fi
+endef
+BuildFirmware/Poray8M/initramfs=$(call BuildFirmware/OF/initramfs,$(1),$(2),$(3))
+
+define BuildFirmware/PorayDualSize/squashfs
+ $(call BuildFirmware/DefaultDualSize/$(1),$(1),$(2),$(3))
+ if [ -e "$(call sysupname,$(1),$(2)-4M)" ]; then \
+ mkporayfw -B $(3) -F 4M \
+ -f $(call sysupname,$(1),$(2)-4M) \
+ -o $(call imgname,$(1),$(2))-4M-factory.bin; \
+ fi
+ if [ -e "$(call sysupname,$(1),$(2)-8M)" ]; then \
+ mkporayfw -B $(3) -F 8M \
+ -f $(call sysupname,$(1),$(2)-8M) \
+ -o $(call imgname,$(1),$(2))-8M-factory.bin; \
+ fi
+endef
+BuildFirmware/PorayDualSize/initramfs=$(call BuildFirmware/DefaultDualSize/initramfs,$(1),$(2),$(3))
#
# RT288X Profiles
belkin_f5d8235v1_mtd_size=7929856
Image/Build/Profile/F5D8235V1=$(call BuildFirmware/CustomFlash/$(1),$(1),f5d8235v1,F5D8235_V1,$(belkin_f5d8235v1_mtd_size))
-Image/Build/Profile/BR6524N=$(call BuildFirmware/Edimax/$(1),$(1),br6524n,BR6524N,$(ralink_default_fw_size_4M),CSYS,WNRA,0x50000,0xc0000)
-
-Image/Build/Profile/RTN15=$(call BuildFirmware/Default4M/$(1),$(1),rt-n15,RTN15)
+Image/Build/Profile/RTN15=$(call BuildFirmware/Default4M/$(1),$(1),rt-n15,RT-N15)
Image/Build/Profile/V11STFE=$(call BuildFirmware/Default4M/$(1),$(1),v11st-fe,V11STFE)
ifeq ($(SUBTARGET),rt288x)
define Image/Build/Profile/Default
$(call Image/Build/Profile/F5D8235V1,$(1))
- $(call Image/Build/Profile/BR6524N,$(1))
$(call Image/Build/Profile/RTN15,$(1))
$(call Image/Build/Profile/V11STFE,$(1))
$(call Image/Build/Profile/WLITX4AG300N,$(1))
#
edimax_3g6200n_mtd_size=3735552
-Image/Build/Profile/3G6200N=$(call BuildFirmware/CustomFlash/$(1),$(1),3g-6200n,3G-6200N,$(edimax_3g6200n_mtd_size))
+Image/Build/Profile/3G6200N=$(call BuildFirmware/Edimax/$(1),$(1),3g-6200n,3G-6200N,$(edimax_3g6200n_mtd_size),CSYS,3G62,0x50000,0xc0000)
+
+Image/Build/Profile/3G6200NL=$(call BuildFirmware/Edimax/$(1),$(1),3g-6200nl,3G-6200NL,$(edimax_3g6200n_mtd_size),CSYS,3G62,0x50000,0xc0000)
Image/Build/Profile/3G300M=$(call BuildFirmware/CustomFlashFactory/$(1),$(1),3g300m,3G300M,$(ralink_default_fw_size_4M),3G150M_SPI Kernel Image,factory)
allnet_all5002_mtd_size=33226752
Image/Build/Profile/ALL5002=$(call BuildFirmware/CustomFlash/$(1),$(1),all5002,ALL5002,$(allnet_all5002_mtd_size))
+Image/Build/Profile/ALL5003=$(call BuildFirmware/CustomFlash/$(1),$(1),all5003,ALL5003,$(allnet_all5002_mtd_size))
argus_atp52b_mtd_size=7995392
Image/Build/Profile/ARGUS_ATP52B=$(call BuildFirmware/CustomFlash/$(1),$(1),argus_atp52b,ARGUS_ATP52B,$(argus_atp52b_mtd_size))
+asl26555_8mb_mtd_size=7929856
+asl26555_16mb_mtd_size=16252928
+define BuildFirmware/ASL26555/squashfs
+ $(call BuildFirmware/CustomFlash/$(1),$(1),$(2)-8M,$(3)-8M,$(asl26555_8mb_mtd_size))
+ $(call BuildFirmware/CustomFlash/$(1),$(1),$(2)-16M,$(3)-16M,$(asl26555_16mb_mtd_size))
+endef
+define BuildFirmware/ASL26555/initramfs
+ $(call BuildFirmware/OF/initramfs,$(1),$(2)-8M,$(3)-8M)
+ $(call BuildFirmware/OF/initramfs,$(1),$(2)-16M,$(3)-16M)
+endef
+Image/Build/Profile/ASL26555=$(call BuildFirmware/ASL26555/$(1),$(1),asl26555,ASL26555)
+
+Image/Build/Profile/AWM002-EVB=$(call BuildFirmware/DefaultDualSize/$(1),$(1),awm002-evb,AWM002-EVB)
+
Image/Build/Profile/BC2=$(call BuildFirmware/Default8M/$(1),$(1),bc2,BC2)
broadway_mtd_size=7929856
Image/Build/Profile/CARAMBOLA=$(call BuildFirmware/Default8M/$(1),$(1),carambola,CARAMBOLA)
+Image/Build/Profile/D105=$(call BuildFirmware/Default4M/$(1),$(1),d105,D105)
+
define BuildFirmware/DIR300B1/squashfs
$(call BuildFirmware/Default4M/$(1),$(1),$(2),$(3))
-mkwrgimg -s $(4) -d /dev/mtdblock/2 \
Image/Build/Profile/DIR-615-D=$(call BuildFirmware/DIR300B1/$(1),$(1),dir-615-d,DIR-615-D,wrgn23_dlwbr_dir615d)
Image/Build/Profile/DIR-620-A1=$(call BuildFirmware/Default8M/$(1),$(1),dir-620-a1,DIR-620-A1)
+Image/Build/Profile/DIR-620-D1=$(call BuildFirmware/Default8M/$(1),$(1),dir-620-d1,DIR-620-D1)
define BuildFirmware/DIR615H1/squashfs
$(call BuildFirmware/Default4M/$(1),$(1),dir-615-h1,DIR-615-H1)
BuildFirmware/DIR615H1/initramfs=$(call BuildFirmware/OF/initramfs,$(1),dir-615-h1,DIR-615-H1)
Image/Build/Profile/DIR615H1=$(call BuildFirmware/DIR615H1/$(1),$(1))
-dap1350_mtd_size=7667712
-define BuildFirmware/DAP1350/squashfs
- $(call BuildFirmware/CustomFlash/$(1),$(1),dap-1350,DAP-1350,$(dap1350_mtd_size))
- -mkdapimg -s $(4) \
- -i $(call sysupname,$(1),dap-1350) \
- -o $(call imgname,$(1),dap-1350)-factory.bin
-endef
-BuildFirmware/DAP1350/initramfs=$(call BuildFirmware/OF/initramfs,$(1),dap-1350,DAP-1350)
-Image/Build/Profile/DAP1350=$(call BuildFirmware/DAP1350/$(1),$(1),)
+Image/Build/Profile/DAP1350=$(call BuildFirmware/dap1350/$(1),$(1),dap-1350,DAP-1350,RT3052-AP-DAP1350-3)
+
+Image/Build/Profile/DAP1350WW=$(call BuildFirmware/dap1350/$(1),$(1),dap-1350WW,DAP-1350,RT3052-AP-DAP1350WW-3)
Image/Build/Profile/ESR-9753=$(call BuildFirmware/Default4M/$(1),$(1),esr-9753,ESR-9753)
belkin_f5d8235v2_mtd_size=7929856
Image/Build/Profile/F5D8235V2=$(call BuildFirmware/CustomFlash/$(1),$(1),f5d8235v2,F5D8235_V2,$(belkin_f5d8235v2_mtd_size))
+# 0x770000
+belkin_f7c027_mtd_size=7798784
+Image/Build/Profile/F7C027=$(call BuildFirmware/CustomFlash/$(1),$(1),belkinf7c027,F7C027,$(belkin_f7c027_mtd_size))
+
Image/Build/Profile/FONERA20N=$(call BuildFirmware/Edimax/$(1),$(1),fonera20n,FONERA20N,$(ralink_default_fw_size_8M),RSDK,NL1T,0x50000,0xc0000)
Image/Build/Profile/RT-N13U=$(call BuildFirmware/Default8M/$(1),$(1),rt-n13u,RT-N13U)
+#Image/Build/Profile/HG255D=$(call BuildFirmware/Default16M/$(1),$(1),hg255d,HG255D)
+
Image/Build/Profile/FREESTATION5=$(call BuildFirmware/Default8M/$(1),$(1),freestation5,FREESTATION5)
+Image/Build/Profile/M3=$(call BuildFirmware/Poray4M/$(1),$(1),m3,M3)
+
Image/Build/Profile/MOFI3500-3GN=$(call BuildFirmware/Default8M/$(1),$(1),mofi3500-3gn,MOFI3500-3GN)
+# Kernel name should be "Linux Kernel Image" to make the OpenWrt image installable from factory Web UI
+Image/Build/Profile/MPRA1=$(call BuildFirmware/Default4M/$(1),$(1),mpr-a1,MPRA1,Linux Kernel Image)
+Image/Build/Profile/MPRA2=$(call BuildFirmware/Default8M/$(1),$(1),mpr-a2,MPRA2,Linux Kernel Image)
+
Image/Build/Profile/NBG-419N=$(call BuildFirmware/Default4M/$(1),$(1),nbg-419n,NBG-419N)
Image/Build/Profile/MZKW300NH2=$(call BuildFirmware/Edimax/$(1),$(1),mzk-w300nh2,MZK-W300NH2,$(mzkw300nh2_mtd_size),CSYS,RN52,0x50000,0xc0000)
Image/Build/Profile/V22RW-2X2=$(call BuildFirmware/Default4M/$(1),$(1),v22rw-2x2,V22RW-2X2)
+Image/Build/Profile/W150M=$(call BuildFirmware/CustomFlashFactory/$(1),$(1),w150m,W150M,$(ralink_default_fw_size_4M),W150M Kernel Image,factory)
+
Image/Build/Profile/W306R_V20=$(call BuildFirmware/CustomFlashFactory/$(1),$(1),w306r-v20,W306R_V20,$(ralink_default_fw_size_4M),linkn Kernel Image,factory)
Image/Build/Profile/W502U=$(call BuildFirmware/Default8M/$(1),$(1),w502u,W502U)
Image/Build/Profile/WL-351=$(call BuildFirmware/Default4M/$(1),$(1),wl-351,WL-351)
+define BuildFirmware/WNCE2001/squashfs
+ $(call BuildFirmware/Default4M/$(1),$(1),$(2),$(3))
+ -mkdapimg -s RT3052-AP-WNCE2001-3 -r WW -v 1.0.0.99 \
+ -i $(call sysupname,$(1),$(2)) \
+ -o $(call imgname,$(1),$(2))-factory-worldwide.bin
+ -mkdapimg -s RT3052-AP-WNCE2001-3 -r NA -v 1.0.0.99 \
+ -i $(call sysupname,$(1),$(2)) \
+ -o $(call imgname,$(1),$(2))-factory-northamerica.bin
+endef
+BuildFirmware/WNCE2001/initramfs=$(call BuildFirmware/OF/initramfs,$(1),$(2),$(3))
+Image/Build/Profile/WNCE2001=$(call BuildFirmware/WNCE2001/$(1),$(1),wnce2001,WNCE2001)
+
Image/Build/Profile/WR512-3GN=$(call BuildFirmware/DefaultDualSize/$(1),$(1),wr512-3ng,WR512-3GN)
Image/Build/Profile/UR-326N4G=$(call BuildFirmware/Default4M/$(1),$(1),ur-326n4g,UR-326N4G)
ifeq ($(SUBTARGET),rt305x)
define Image/Build/Profile/Default
$(call Image/Build/Profile/3G6200N,$(1))
+ $(call Image/Build/Profile/3G6200NL,$(1))
$(call Image/Build/Profile/3G300M,$(1))
$(call Image/Build/Profile/AIR3GII,$(1))
$(call Image/Build/Profile/ALL02393G,$(1))
$(call Image/Build/Profile/ALL0256N,$(1))
$(call Image/Build/Profile/ALL5002,$(1))
+ $(call Image/Build/Profile/ALL5003,$(1))
$(call Image/Build/Profile/ARGUS_ATP52B,$(1))
+ $(call Image/Build/Profile/ASL26555,$(1))
+ $(call Image/Build/Profile/AWM002-EVB,$(1))
$(call Image/Build/Profile/BC2,$(1))
$(call Image/Build/Profile/BROADWAY,$(1))
$(call Image/Build/Profile/CARAMBOLA,$(1))
+ $(call Image/Build/Profile/D105,$(1))
$(call Image/Build/Profile/DIR-300-B1,$(1))
$(call Image/Build/Profile/DIR-600-B1,$(1))
$(call Image/Build/Profile/DIR-600-B2,$(1))
$(call Image/Build/Profile/DIR-615-D,$(1))
$(call Image/Build/Profile/DIR-620-A1,$(1))
+ $(call Image/Build/Profile/DIR-620-D1,$(1))
$(call Image/Build/Profile/DIR615H1,$(1))
$(call Image/Build/Profile/DAP1350,$(1))
+ $(call Image/Build/Profile/DAP1350WW,$(1))
$(call Image/Build/Profile/ESR-9753,$(1))
+ $(call Image/Build/Profile/F7C027,$(1))
$(call Image/Build/Profile/F5D8235V2,$(1))
$(call Image/Build/Profile/FONERA20N,$(1))
$(call Image/Build/Profile/FREESTATION5,$(1))
+# $(call Image/Build/Profile/HG255D,$(1))
$(call Image/Build/Profile/HW550-3G,$(1))
+ $(call Image/Build/Profile/M3,$(1))
$(call Image/Build/Profile/MOFI3500-3GN,$(1))
+ $(call Image/Build/Profile/MPRA2,$(1))
$(call Image/Build/Profile/MZKW300NH2,$(1))
$(call Image/Build/Profile/NBG-419N,$(1))
$(call Image/Build/Profile/NW718,$(1))
$(call Image/Build/Profile/SL-R7205,$(1))
$(call Image/Build/Profile/UR-326N4G,$(1))
$(call Image/Build/Profile/V22RW-2X2,$(1))
+ $(call Image/Build/Profile/W150M,$(1))
$(call Image/Build/Profile/W306R_V20,$(1))
$(call Image/Build/Profile/W502U,$(1))
$(call Image/Build/Profile/WCR150GN,$(1))
$(call Image/Build/Profile/WL_330N3G,$(1))
$(call Image/Build/Profile/WL341V3,$(1))
$(call Image/Build/Profile/WL-351,$(1))
+ $(call Image/Build/Profile/WNCE2001,$(1))
$(call Image/Build/Profile/WR512-3GN,$(1))
$(call Image/Build/Profile/WR6202,$(1))
$(call Image/Build/Profile/XDXRN502J,$(1))
endef
endif
-
#
-# Generic Targets
+# MT7620A Profiles
#
-define Image/Build/squashfs
- $(call prepare_generic_squashfs,$(KDIR)/root.squashfs)
+
+Image/Build/Profile/MT7620a=$(call BuildFirmware/Default8M/$(1),$(1),mt7620a,MT7620a)
+Image/Build/Profile/MT7620a_MT7610e=$(call BuildFirmware/Default8M/$(1),$(1),mt7620a_mt7610e,MT7620a_MT7610e)
+
+ifeq ($(SUBTARGET),mt7620a)
+define Image/Build/Profile/Default
+ $(call Image/Build/Profile/MT7620a,$(1))
+ $(call Image/Build/Profile/MT7620a_MT7610e,$(1))
endef
+endif
+
+#
+# Generic Targets
+#
define Image/BuildKernel
cp $(KDIR)/vmlinux.elf $(BIN_DIR)/$(VMLINUX).elf
cp $(KDIR)/vmlinux $(BIN_DIR)/$(VMLINUX).bin
$(call CompressLzma,$(KDIR)/vmlinux,$(KDIR)/vmlinux.bin.lzma)
$(call MkImage,lzma,$(KDIR)/vmlinux.bin.lzma,$(KDIR)/uImage.lzma)
cp $(KDIR)/uImage.lzma $(BIN_DIR)/$(UIMAGE).bin
+ifneq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),)
+ cp $(KDIR)/vmlinux-initramfs.elf $(BIN_DIR)/$(VMLINUX)-initramfs.elf
+ cp $(KDIR)/vmlinux-initramfs $(BIN_DIR)/$(VMLINUX)-initramfs.bin
+ $(call CompressLzma,$(KDIR)/vmlinux-initramfs,$(KDIR)/vmlinux-initramfs.bin.lzma)
+ $(call MkImage,lzma,$(KDIR)/vmlinux-initramfs.bin.lzma,$(KDIR)/uImage-initramfs.lzma)
+ cp $(KDIR)/uImage-initramfs.lzma $(BIN_DIR)/$(UIMAGE)-initramfs.bin
+endif
$(call Image/Build/Initramfs)
endef