Changeset 36169


Ignore:
Timestamp:
2013-04-03T11:59:51+02:00 (5 years ago)
Author:
blogic
Message:

[ramips] add new image/Makefile

Signed-off-by: John Crispin <blogic@…>

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/target/linux/ramips/image/Makefile

    r35972 r36169  
    1818VMLINUX:=$(IMG_PREFIX)-vmlinux 
    1919UIMAGE:=$(IMG_PREFIX)-uImage 
    20 fs_squash:=squashfs-only 
     20 
    2121ifeq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),y) 
    22         fs_squash:=initramfs 
    23         VMLINUX:=$(IMG_PREFIX)-vmlinux-initramfs 
    24         UIMAGE:=$(IMG_PREFIX)-uImage-initramfs 
     22VMLINUX:=$(IMG_PREFIX)-vmlinux-initramfs 
     23UIMAGE:=$(IMG_PREFIX)-uImage-initramfs 
     24define Image/Build/Initramfs 
     25        $(call Image/Build/Profile/$(PROFILE),initramfs) 
     26endef 
    2527endif 
    2628 
    27 ifeq ($(CONFIG_RALINK_RT288X),y) 
     29ifeq ($(CONFIG_SOC_RT288X),y) 
    2830define kernel_entry 
    2931-a 0x88000000 -e 0x88000000 
     
    3436endef 
    3537endif 
    36  
    37 define mkcmdline 
    38 board=$(1) console=$(2),$(3) 
    39 endef 
    40  
    41 define CompressLzma 
    42   $(STAGING_DIR_HOST)/bin/lzma e $(1) -lc1 -lp2 -pb2 $(2) 
    43 endef 
    44  
    45 define PatchKernelLzma 
    46         cp $(KDIR)/vmlinux $(KDIR)/vmlinux-$(1) 
    47         $(STAGING_DIR_HOST)/bin/patch-cmdline $(KDIR)/vmlinux-$(1) '$(strip $(2))' 
    48         $(call CompressLzma,$(KDIR)/vmlinux-$(1),$(KDIR)/vmlinux-$(1).bin.lzma) 
    49 endef 
    50  
    51 define MkImage 
    52         $(eval imagename=$(if $(4),$(4),MIPS OpenWrt Linux-$(LINUX_VERSION))) 
    53         -mkimage -A mips -O linux -T kernel -C $(1) $(call kernel_entry)\ 
    54                 -n "$(imagename)" \ 
    55                 -d $(2) $(3) 
    56 endef 
    57  
    58 define MkImageLzma 
    59         $(call PatchKernelLzma,$(1),$(2)) 
    60         $(call MkImage,lzma,$(KDIR)/vmlinux-$(1).bin.lzma,$(KDIR)/vmlinux-$(1).uImage,$(3)) 
    61 endef 
    6238 
    6339define MkCombineduImage 
     
    7349endef 
    7450 
    75 define CatFiles 
    76         if [ `stat -c%s "$(1)"` -gt $(2) ]; then \ 
    77                 echo "Warning: $(1) is too big" >&2; \ 
    78         else if [ `stat -c%s $(3)` -gt $(4) ]; then \ 
    79                 echo "Warning: $(3) is too big" >&2; \ 
     51 
     52# 
     53# The real magic happens inside these templates 
     54# 
     55 
     56define MkImage 
     57        $(eval imagename=$(if $(4),$(4),MIPS OpenWrt Linux-$(LINUX_VERSION))) 
     58        -mkimage -A mips -O linux -T kernel -C $(1) $(call kernel_entry)\ 
     59                -n "$(imagename)" \ 
     60                -d $(2) $(3) 
     61endef 
     62 
     63define CompressLzma 
     64        $(STAGING_DIR_HOST)/bin/lzma e $(1) -lc1 -lp2 -pb2 $(2) 
     65endef 
     66 
     67define MkImageSysupgrade/squashfs 
     68        $(eval output_name=$(IMG_PREFIX)-$(2)-$(1)-$(if $(4),$(4),sysupgrade).bin) 
     69        cat $(KDIR)/vmlinux-$(2).uImage $(KDIR)/root.$(1) > $(KDIR)/$(output_name) 
     70        $(call prepare_generic_squashfs,$(KDIR)/$(output_name)) 
     71        if [ `stat -c%s "$(KDIR)/$(output_name)"` -gt $(3) ]; then \ 
     72                echo "Warning: $(KDIR)/$(output_name) is too big" >&2; \ 
    8073        else \ 
    81                 ( dd if=$(1) bs=$(2) conv=sync; dd if=$(3) ) > $(5); \ 
    82         fi; fi 
    83 endef 
    84  
    85 define Sysupgrade/KRuImage 
    86         $(eval output_name=$(if $(5),$(call imgname,$(1),$(2))-$(5),$(call sysupname,$(1),$(2)))) 
    87         $(call CatFiles,$(KDIR)/vmlinux-$(2).uImage,$(3),$(KDIR)/root.$(1),$(4),$(output_name)) 
    88 endef 
    89  
    90 define mkmtd 
    91 mtdparts=$(1):$(2) 
    92 endef 
    93  
    94 define mkmtd/phys 
    95 $(call mkmtd,physmap-flash.0,$(1)) 
    96 endef 
    97  
    98 define mkmtd/spi 
    99 $(call mkmtd,spi0.0,$(1)) 
    100 endef 
    101  
    102 define Image/BuildKernel 
    103         cp $(KDIR)/vmlinux.elf $(BIN_DIR)/$(VMLINUX).elf 
    104         cp $(KDIR)/vmlinux $(BIN_DIR)/$(VMLINUX).bin 
    105         $(call CompressLzma,$(KDIR)/vmlinux,$(KDIR)/vmlinux.bin.lzma) 
    106         $(call MkImage,lzma,$(KDIR)/vmlinux.bin.lzma,$(KDIR)/uImage.lzma) 
    107         cp $(KDIR)/uImage.lzma $(BIN_DIR)/$(UIMAGE).bin 
    108         $(call Image/Build/Initramfs) 
    109 endef 
    110  
    111 define BuildFirmware/Generic 
    112         $(call MkImageLzma,$(2),$(3),$(6)) 
    113         $(call Sysupgrade/KRuImage,$(1),$(2),$(4),$(5),$(7)) 
    114 endef 
    115  
    116 define BuildFirmware/Generic/initramfs 
    117         $(call MkImageLzma,$(2),$(3)) 
     74                $(CP) $(KDIR)/$(output_name) $(BIN_DIR)/$(output_name); \ 
     75        fi 
     76endef 
     77 
     78define PatchKernelLzmaDtb 
     79        cp $(KDIR)/vmlinux $(KDIR)/vmlinux-$(1) 
     80        $(LINUX_DIR)/scripts/dtc/dtc -O dtb -o $(KDIR)/$(2).dtb ../dts/$(2).dts 
     81        $(STAGING_DIR_HOST)/bin/patch-dtb $(KDIR)/vmlinux-$(1) $(KDIR)/$(2).dtb 
     82        $(call CompressLzma,$(KDIR)/vmlinux-$(1),$(KDIR)/vmlinux-$(1).bin.lzma) 
     83endef 
     84 
     85define MkImageLzmaDtb 
     86        $(call PatchKernelLzmaDtb,$(1),$(2)) 
     87        $(call MkImage,lzma,$(KDIR)/vmlinux-$(1).bin.lzma,$(KDIR)/vmlinux-$(1).uImage,$(3)) 
     88endef 
     89 
     90define BuildFirmware/OF 
     91        $(call MkImageLzmaDtb,$(2),$(3),$(5)) 
     92        $(call MkImageSysupgrade/$(1),$(1),$(2),$(4),$(6)) 
     93endef 
     94 
     95define BuildFirmware/OF/initramfs 
     96        $(call MkImageLzmaDtb,$(2),$(3)) 
    11897        $(CP) $(KDIR)/vmlinux-$(2).uImage $(call imgname,$(1),$(2))-uImage.bin 
    11998endef 
    12099 
    121 mtdlayout_4M=192k(u-boot)ro,64k(u-boot-env)ro,64k(factory)ro,896k(kernel),2880k(rootfs),3776k@0x50000(firmware) 
    122 define BuildFirmware/GENERIC_4M 
    123         $(call BuildFirmware/Generic,$(1),$(2),$(call mkcmdline,$(3),$(4),$(5)) $(call mkmtd/$(6),$(mtdlayout_4M)),917504,2949120,$(7),$(8)) 
    124 endef 
    125  
    126 define BuildFirmware/GENERIC_4M/initramfs 
    127         $(call BuildFirmware/Generic/initramfs,$(1),$(2),$(call mkcmdline,$(3),$(4),$(5)) $(call mkmtd/$(6),$(mtdlayout_4M))) 
    128 endef 
    129  
    130 mtdlayout_8M=192k(u-boot)ro,64k(u-boot-env)ro,64k(factory)ro,896k(kernel),6976k(rootfs),7872k@0x50000(firmware) 
    131 kernel_size_8M=917504 
    132 rootfs_size_8M=7143424 
    133 define BuildFirmware/GENERIC_8M 
    134         $(call BuildFirmware/Generic,$(1),$(2),$(call mkcmdline,$(3),$(4),$(5)) $(call mkmtd/$(6),$(mtdlayout_8M)),$(kernel_size_8M),$(rootfs_size_8M),$(7),$(8)) 
    135 endef 
    136  
    137 define BuildFirmware/GENERIC_8M/initramfs 
    138         $(call BuildFirmware/Generic/initramfs,$(1),$(2),$(call mkcmdline,$(3),$(4),$(5)) $(call mkmtd/$(6),$(mtdlayout_8M))) 
    139 endef 
    140  
    141 define BuildFirmware/UIMAGE_8M 
    142         $(call MkCombineduImage,$(1),$(2),$(call mkcmdline,$(3),$(4),$(5)) $(call mkmtd/$(6),$(mtdlayout_8M)),$(kernel_size_8M),$(rootfs_size_8M),$(7)) 
    143 endef 
    144  
    145 mtdlayout_edimax_3g6200n=192k(u-boot)ro,64k(u-boot-env)ro,64k(factory)ro,896k(kernel),2752k(rootfs),128k@0x3e0000(cimage)ro,3648k@0x50000(firmware) 
    146 define BuildFirmware/3G6200N 
    147         $(call BuildFirmware/Generic,$(1),$(2),$(call mkcmdline,$(3),$(4),$(5)) $(call mkmtd/$(6),$(mtdlayout_edimax_3g6200n)),917504,2818048) 
    148 endef 
    149  
    150 mtdlayout_allnet_all5002=192k(u-boot)ro,64k(u-boot-env)ro,64k(factory)ro,1024k(kernel),31424k(rootfs),32448k@0x50000(firmware) 
    151 define BuildFirmware/ALL5002 
    152         $(call BuildFirmware/Generic,$(1),$(2),$(call mkcmdline,$(3),$(4),$(5)) $(call mkmtd/$(6),$(mtdlayout_allnet_all5002)),1048576,32178176) 
    153 endef 
    154  
    155 define BuildFirmware/ALL5002/initramfs 
    156         $(call BuildFirmware/Generic/initramfs,$(1),$(2),$(call mkcmdline,$(3),$(4),$(5)) $(call mkmtd/$(6),$(mtdlayout_allnet_all5002))) 
    157 endef 
    158  
    159 mtdlayout_argus_atp52b=192k(bootloader)ro,64k(config),64k(factory),1152k(kernel),6656k(rootfs),7808k@0x50000(firmware) 
    160 mtd_argus_atp52b_kernel_part_size=1179648 
    161 mtd_argus_atp52b_rootfs_part_size=6815744 
    162 define BuildFirmware/ARGUS_ATP52B 
    163         $(call BuildFirmware/Generic,$(1),$(2),board=$(3) $(call mkmtd/phys,$(mtdlayout_argus_atp52b)),$(mtd_argus_atp52b_kernel_part_size),$(mtd_argus_atp52b_rootfs_part_size)) 
    164 endef 
    165  
    166 # djh - Note all of these are marked Read-Only for now 
    167 mtdlayout_broadway=192k(bootloader)ro,64k(config)ro,64k(factory)ro,1024k(kernel)ro,6720k(rootfs),7744k@0x50000(firmware) 
    168 mtd_broadway_kernel_part_size=1048576 
    169 mtd_broadway_rootfs_part_size=6881280 
    170 define BuildFirmware/BROADWAY 
    171         $(call BuildFirmware/Generic,$(1),$(2),$(call mkcmdline,$(3),$(4),$(5)) $(call mkmtd/$(6),$(mtdlayout_broadway)),$(mtd_broadway_kernel_part_size),$(mtd_broadway_rootfs_part_size),Broadway Kernel Image,factory.bin) 
    172         $(call BuildFirmware/Generic,$(1),$(2),$(call mkcmdline,$(3),$(4),$(5)) $(call mkmtd/$(6),$(mtdlayout_broadway)),$(mtd_broadway_kernel_part_size),$(mtd_broadway_rootfs_part_size)) 
    173 endef 
    174  
    175 define BuildFirmware/BROADWAY/initramfs 
    176         $(call BuildFirmware/Generic/initramfs,$(1),$(2),$(call mkcmdline,$(3),$(4),$(5)) $(call mkmtd/$(6),$(mtdlayout_broadway))) 
    177 endef 
    178  
     100 
     101# Build images for default ralink layout for 4MB flash 
     102# kernel + roots = 0x3b0000 
     103# $(1) = squashfs/initramfs 
     104# $(2) = lowercase board name 
     105# $(3) = dts file 
     106ralink_default_fw_size_4M=3866624 
     107BuildFirmware/Default4M/squashfs=$(call BuildFirmware/OF,$(1),$(2),$(3),$(ralink_default_fw_size_4M)) 
     108BuildFirmware/Default4M/initramfs=$(call BuildFirmware/OF/initramfs,$(1),$(2),$(3)) 
     109 
     110# Build images for default ralink layout for 8MB flash 
     111# kernel + roots = 0x7b0000 
     112# $(1) = squashfs/initramfs 
     113# $(2) = lowercase board name 
     114# $(3) = dts file 
     115ralink_default_fw_size_8M=8060928 
     116BuildFirmware/Default8M/squashfs=$(call BuildFirmware/OF,$(1),$(2),$(3),$(ralink_default_fw_size_8M)) 
     117BuildFirmware/Default8M/initramfs=$(call BuildFirmware/OF/initramfs,$(1),$(2),$(3)) 
     118 
     119# Build images for a custom sized flash layout 
     120# $(1) = squashfs/initramfs 
     121# $(2) = lowercase board name 
     122# $(3) = dts file 
     123# $(4) = kernel + rootfs size 
     124BuildFirmware/CustomFlash/squashfs=$(call BuildFirmware/OF,$(1),$(2),$(3),$(4),$(5),$(6)) 
     125BuildFirmware/CustomFlash/initramfs=$(call BuildFirmware/OF/initramfs,$(1),$(2),$(3)) 
     126 
     127# wrappers for boards that have 4MB and 8MB versions 
     128define BuildFirmware/DefaultDualSize/squashfs 
     129        $(call BuildFirmware/Default4M/$(1),$(1),$(2)-4M,$(3)-4M) 
     130        $(call BuildFirmware/Default8M/$(1),$(1),$(2)-8M,$(3)-8M) 
     131endef 
     132define BuildFirmware/DefaultDualSize/initramfs 
     133        $(call BuildFirmware/OF/initramfs,$(1),$(2)-4M,$(3)-4M) 
     134        $(call BuildFirmware/OF/initramfs,$(1),$(2)-8M,$(3)-8M) 
     135endef 
     136 
     137# Some boards need a special header inside the uImage to make them bootable 
     138define BuildFirmware/CustomFlashFactory/squashfs 
     139        $(call BuildFirmware/CustomFlash/$(1),$(1),$(2),$(3),$(4)) 
     140        $(call BuildFirmware/CustomFlash/$(1),$(1),$(2),$(3),$(4),$(5),$(6)) 
     141endef 
     142BuildFirmware/CustomFlashFactory/initramfs=$(call BuildFirmware/OF/initramfs,$(1),$(2),$(3)) 
     143 
     144# sign an image to make it work with edimax tftp recovery 
     145define BuildFirmware/Edimax/squashfs 
     146        $(call BuildFirmware/OF,$(1),$(2),$(3),$(4)) 
     147        if [ -e "$(call sysupname,$(1),$(2))" ]; then \ 
     148                mkedimaximg -i $(call sysupname,$(1),$(2)) \ 
     149                        -o $(call imgname,$(1),$(2))-factory.bin \ 
     150                        -s $(5) -m $(6) -f $(7) -S $(8); \ 
     151        fi 
     152endef 
     153BuildFirmware/Edimax/initramfs=$(call BuildFirmware/OF/initramfs,$(1),$(2),$(3)) 
     154 
     155# build Seama header images 
     156define BuildFirmware/Seama/squashfs 
     157        $(call BuildFirmware/OF,$(1),$(2),$(3),$(ralink_default_fw_size_8M)) 
     158        cat $(KDIR)/vmlinux-$(2).bin.lzma $(KDIR)/root.$(1) > $(KDIR)/img_$(2).$(1).tmp 
     159        if [ `stat -c%s "$(KDIR)/img_$(2).$(1).tmp"` -gt 8060864 ]; then \ 
     160                echo "Warning: $(KDIR)/img_$(2).$(1).tmp is too big" >&2; \ 
     161        else \ 
     162                dd if=$(KDIR)/vmlinux-$(2).bin.lzma of=$(KDIR)/vmlinux-$(2).bin.lzma.padded bs=64k conv=sync; \ 
     163                ( \ 
     164                        dd if=$(KDIR)/vmlinux-$(2).bin.lzma.padded bs=1 count=`expr \`stat -c%s $(KDIR)/vmlinux-$(2).bin.lzma.padded\` - 64`; \ 
     165                        dd if=$(KDIR)/root.$(1) bs=64k conv=sync; \ 
     166                ) > $(KDIR)/vmlinux-$(2).tmp; \ 
     167                $(STAGING_DIR_HOST)/bin/seama \ 
     168                        -i $(KDIR)/vmlinux-$(2).tmp \ 
     169                        -m "dev=/dev/mtdblock/2" -m "type=firmware"; \ 
     170                $(STAGING_DIR_HOST)/bin/seama \ 
     171                        -s $(call imgname,$(1),$(2))-factory.bin \ 
     172                        -m "signature=$(4)" \ 
     173                        -i $(KDIR)/vmlinux-$(2).tmp.seama; \ 
     174        fi 
     175endef 
     176BuildFirmware/Seama/initramfs=$(call BuildFirmware/OF/initramfs,$(1),$(2),$(3)) 
     177 
     178# sign Buffalo images 
    179179define BuildFirmware/Buffalo 
    180         $(call MkImageLzma,$(2),$(3)) 
    181         $(call Sysupgrade/KRuImage,$(1),$(2),$(4),$(5)) 
    182180        if [ -e "$(call sysupname,$(1),$(2))" ]; then \ 
    183181                buffalo-enc -p $(3) -v 1.76 \ 
     
    195193endef 
    196194 
    197  
    198 define BuildFirmware/Buffalo2 
    199         $(call BuildFirmware/Generic,$(1),$(2),board=$(3) $(4),$(5),$(6)) 
    200 endef 
    201  
    202 mtdlayout_dir300b1=192k(u-boot)ro,64k(devdata)ro,64k(devconf)ro,896k(kernel),2880k(rootfs),3776k@0x50000(firmware) 
    203 mtd_dir300b1_kernel_part_size=917504 
    204 mtd_dir300b1_rootfs_part_size=2949120 
    205 define BuildFirmware/DIR300B1 
    206         $(call BuildFirmware/Generic,$(1),$(2),$(call mkcmdline,$(3),ttyS1,57600) $(call mkmtd/phys,$(mtdlayout_dir300b1)),$(mtd_dir300b1_kernel_part_size),$(mtd_dir300b1_rootfs_part_size)) 
    207         -mkwrgimg -s $(4) -d /dev/mtdblock/2 \ 
    208                 -i $(call sysupname,$(1),$(2)) \ 
    209                 -o $(call imgname,$(1),$(2))-factory.bin 
    210 endef 
    211  
    212 define BuildFirmware/DIR300B1/initramfs 
    213         $(call BuildFirmware/Generic/initramfs,$(1),$(2),$(call mkcmdline,$(3),ttyS1,57600) $(call mkmtd/phys,$(mtdlayout_dir300b1)),$(mtd_dir300b1_kernel_part_size),$(mtd_dir300b1_rootfs_part_size)) 
    214 endef 
    215  
    216 mtdlayout_dir615h1=192k(u-boot)ro,64k(u-boot-env)ro,64k(factory)ro,896k(kernel),2880k(rootfs),3776k@0x50000(firmware) 
    217 define BuildFirmware/DIR615H1 
    218         $(call BuildFirmware/Generic,$(1),$(2),$(call mkcmdline,$(3),$(4),$(5)) $(call mkmtd/$(6),$(mtdlayout_dir615h1)),917504,2949120) 
    219         -mkdir615h1 -e $(call sysupname,$(1),$(2)) \ 
    220                 -o $(call imgname,$(1),$(2))-factory.bin 
    221 endef 
    222  
    223 define BuildFirmware/DIR615H1/initramfs 
    224         $(call BuildFirmware/Generic/initramfs,$(1),$(2),$(call mkcmdline,$(3),$(4),$(5)) $(call mkmtd/$(6),$(mtdlayout_dir615h1))) 
    225 endef 
    226  
    227 mtdlayout_dap1350=192k(u-boot)ro,64k(devdata)ro,192k(devconf)ro,256k(devlang)ro,1088k(kernel),6400k(rootfs),7488k@0xb0000(firmware) 
    228 mtd_dap1350_kernel_part_size=1114112 
    229 mtd_dap1350_rootfs_part_size=6553600 
    230 define BuildFirmware/DAP1350 
    231         $(call BuildFirmware/Generic,$(1),$(2),$(call mkcmdline,$(3),ttyS1,115200) $(call mkmtd/phys,$(mtdlayout_dap1350)),$(mtd_dap1350_kernel_part_size),$(mtd_dap1350_rootfs_part_size)) 
    232         -mkdapimg -s $(4) \ 
    233                 -i $(call sysupname,$(1),$(2)) \ 
    234                 -o $(call imgname,$(1),$(2))-factory.bin 
    235 endef 
    236  
    237 define BuildFirmware/DAP1350/initramfs 
    238         $(call BuildFirmware/Generic/initramfs,$(1),$(2),$(call mkcmdline,$(3),ttyS1,115200) $(call mkmtd/phys,$(mtdlayout_dap1350)),$(mtd_dap1350_kernel_part_size),$(mtd_dap1350_rootfs_part_size)) 
    239 endef 
    240  
    241 mtdlayout_dir620a1=192k(u-boot)ro,64k(u-boot-env)ro,64k(factory)ro,896k(kernel),6976k(rootfs),7872k@0x50000(firmware) 
    242 kernel_size_dir620a1=917504 
    243 rootfs_size_dir620a1=7143424 
    244 define BuildFirmware/DIR620A1 
    245         $(call BuildFirmware/Generic,$(1),$(2),$(call mkcmdline,$(3),ttyS1,57600) $(call mkmtd/phys,$(mtdlayout_dir620a1)),$(kernel_size_dir620a1),$(rootfs_size_dir620a1),DIR_620) 
    246 endef 
    247  
    248 define BuildFirmware/DIR620A1/initramfs 
    249         $(call BuildFirmware/Generic/initramfs,$(1),$(2),$(call mkcmdline,$(3),ttyS1,57600) $(call mkmtd/phys,$(mtdlayout_dir620a1)),$(kernel_size_dir620a1),$(rootfs_size_dir620a1)) 
    250 endef 
    251  
    252 define BuildFirmware/Edimax 
    253         if [ -e "$(call sysupname,$(1),$(2))" ]; then \ 
    254                 mkedimaximg -i $(call sysupname,$(1),$(2)) \ 
    255                         -o $(call imgname,$(1),$(2))-factory.bin \ 
    256                         -s $(3) -m $(4) -f $(5) -S $(6); \ 
    257         fi 
    258 endef 
    259  
    260 define BuildFirmware/BR6524N 
    261         $(call BuildFirmware/Generic,$(1),$(2),$(call mkcmdline,$(3),$(4),$(5)) $(call mkmtd/$(6),$(mtdlayout_4M)),917484,2949120) 
    262         $(call BuildFirmware/Edimax,$(1),br6524n,CSYS,WNRA,0x50000,0xc00000) 
    263 endef 
    264  
    265 mtdlayout_f5d8235=320k(u-boot)ro,1536k(kernel),6208k(rootfs),64k(nvram),64k(factory),7744k@0x50000(firmware) 
    266 mtd_f5d8235_kernel_part_size=1572864 
    267 mtd_f5d8235_rootfs_part_size=6356992 
    268 define BuildFirmware/F5D8235 
    269         $(call BuildFirmware/Generic,$(1),$(2),$(call mkcmdline,$(3),ttyS1,57600) $(call  mkmtd/phys,$(mtdlayout_f5d8235)),$(mtd_f5d8235_kernel_part_size),$(mtd_f5d8235_rootfs_part_size)) 
    270 endef 
    271  
    272 define BuildFirmware/FONERA20N 
    273         $(call BuildFirmware/GENERIC_8M,$(1),fonera20n,FONERA20N,ttyS1,57600,phys) 
    274         $(call BuildFirmware/Edimax,$(1),fonera20n,RSDK,NL1T,0x50000,0xc0000) 
    275 endef 
    276  
    277 define BuildFirmware/FONERA20N/initramfs 
    278         $(call BuildFirmware/GENERIC_8M/initramfs,$(1),fonera20n,FONERA20N,ttyS1,57600,phys) 
    279 endef 
    280  
    281 define BuildFirmware/RT-N13U 
    282         $(call BuildFirmware/GENERIC_8M,$(1),rt-n13u,RT-N13U,ttyS1,57600,phys) 
    283 endef 
    284  
    285 mtdlayout_nw718=192k(u-boot)ro,128k(config)ro,64k(factory)ro,896k(kernel),2816k(rootfs),3712k@0x60000(firmware) 
    286 kernel_size_nw718=917504 
    287 rootfs_size_nw718=2883584 
    288 cmdline_nw718=$(call mkcmdline,NW718,ttyS1,57600) $(call mkmtd/spi,$(mtdlayout_nw718)) 
    289 define BuildFirmware/NW718 
    290         $(call BuildFirmware/Generic,$(1),$(2),$(cmdline_nw718),$(kernel_size_nw718),$(rootfs_size_nw718),ARA1B4NCRNW718;1,factory.bin) 
    291         $(call BuildFirmware/Generic,$(1),$(2),$(cmdline_nw718),$(kernel_size_nw718),$(rootfs_size_nw718)) 
    292 endef 
    293  
    294 mtdlayout_omniembhpm=192k(u-boot)ro,64k(config)ro,64k(factory)ro,1024k(kernel),15040k(rootfs),16064k@0x50000(firmware) 
    295 kernel_size_omniembhpm=1048576 
    296 rootfs_size_omniembhpm=15400960 
    297 define BuildFirmware/OMNIEMBHPM 
    298         $(call BuildFirmware/Generic,$(1),$(2),$(call mkcmdline,$(3),ttyS1,115200) $(call mkmtd/spi,$(mtdlayout_omniembhpm)),$(kernel_size_omniembhpm),$(rootfs_size_omniembhpm)) 
    299 endef 
    300  
    301 define BuildFirmware/OMNIEMBHPM/initramfs 
    302         $(call BuildFirmware/Generic/initramfs,$(1),$(2),$(call mkcmdline,$(3),ttyS1,115200) $(call mkmtd/spi,$(mtdlayout_omniembhpm))) 
    303 endef 
    304  
    305 mtdlayout_rtg32b1=192k(u-boot)ro,64k(devdata)ro,64k(devconf)ro,896k(kernel),2880k(rootfs),3776k@0x50000(firmware) 
    306 mtd_rtg32b1_kernel_part_size=917504 
    307 mtd_rtg32b1_rootfs_part_size=2949120 
    308 define BuildFirmware/RTG32B1 
    309         $(call BuildFirmware/Generic,$(1),$(2),board=$(3) $(call mkmtd/spi,$(mtdlayout_rtg32b1)),$(mtd_rtg32b1_kernel_part_size),$(mtd_rtg32b1_rootfs_part_size)) 
    310 endef 
    311  
    312 mtdlayout_rtn10plus=192k(u-boot)ro,64k(devdata)ro,64k(devconf)ro,896k(kernel),2880k(rootfs),3776k@0x50000(firmware) 
    313 mtd_rtn10plus_kernel_part_size=917504 
    314 mtd_rtn10plus_rootfs_part_size=2949120 
    315 define BuildFirmware/RTN10PLUS 
    316         $(call BuildFirmware/Generic,$(1),$(2),board=$(3) $(call mkmtd/phys,$(mtdlayout_rtn10plus)),$(mtd_rtn10plus_kernel_part_size),$(mtd_rtn10plus_rootfs_part_size)) 
    317 endef 
    318  
    319 define BuildFirmware/Seama 
    320         $(call PatchKernelLzma,$(2),$(3)) 
    321         if [ `stat -c%s "$(KDIR)/vmlinux-$(2).bin.lzma"` -gt $(4) ]; then \ 
    322                 echo "Warning: $(KDIR)/vmlinux-$(2).bin.lzma is too big" >&2; \ 
    323         else if [ `stat -c%s $(KDIR)/root.$(1)` -gt $(5) ]; then \ 
    324                 echo "Warning: $(KDIR)/root.$(1) is too big" >&2; \ 
    325         else \ 
    326                 ( \ 
    327                         dd if=$(KDIR)/vmlinux-$(2).bin.lzma bs=$(4) count=1 conv=sync; \ 
    328                 ) > $(KDIR)/vmlinux-$(2).tmp; \ 
    329                 $(STAGING_DIR_HOST)/bin/seama \ 
    330                         -i $(KDIR)/vmlinux-$(2).tmp \ 
    331                         -m "dev=/dev/mtdblock/2" -m "type=firmware"; \ 
    332                 ( \ 
    333                         dd if=$(KDIR)/vmlinux-$(2).tmp.seama; \ 
    334                         dd if=$(KDIR)/root.$(1) bs=64k conv=sync; \ 
    335                 ) > $(call imgname,$(1),$(2))-sysupgrade.bin; \ 
    336                 ( \ 
    337                         dd if=$(KDIR)/vmlinux-$(2).bin.lzma bs=$(4) count=1 conv=sync; \ 
    338                         dd if=$(KDIR)/root.$(1) bs=64k conv=sync; \ 
    339                 ) > $(KDIR)/vmlinux-$(2).tmp; \ 
    340                 $(STAGING_DIR_HOST)/bin/seama \ 
    341                         -i $(KDIR)/vmlinux-$(2).tmp \ 
    342                         -m "dev=/dev/mtdblock/2" -m "type=firmware"; \ 
    343                 $(STAGING_DIR_HOST)/bin/seama \ 
    344                         -s $(call imgname,$(1),$(2))-factory.bin \ 
    345                         -m "signature=$(6)" \ 
    346                         -i $(KDIR)/vmlinux-$(2).tmp.seama; \ 
    347         fi; fi 
    348 endef 
    349  
    350 mtdlayout_dir645a1=192k(u-boot)ro,16k(u-boot-env)ro,16k(factory)ro,32k(nvram)ro,64k(devdata)ro,896k(kernel),6976k(rootfs),7872k@0x50000(firmware) 
    351 define BuildFirmware/DIR645 
    352         $(call BuildFirmware/Seama,$(1),$(2),$(call mkcmdline,$(3),$(4),$(5)) $(call mkmtd/$(6),$(mtdlayout_dir645a1)),917440,7143424,$(7)) 
    353 endef 
    354  
    355 define BuildFirmware/DIR645/initramfs 
    356         $(call BuildFirmware/Generic/initramfs,$(1),$(2),$(call mkcmdline,$(3),$(4),$(5)) $(call mkmtd/$(6),$(mtdlayout_dir645a1))) 
    357 endef 
    358  
    359 define BuildFirmware/UMedia 
    360         $(call BuildFirmware/GENERIC_8M,$(1),$(2),$(3),ttyS1,57600,phys) 
     195# sign trednet / UMedia images 
     196define BuildFirmware/UMedia/squashfs 
     197        $(call BuildFirmware/Default8M/$(1),$(1),$(2),$(3)) 
    361198        if [ -e "$(call sysupname,$(1),$(2))" ]; then \ 
    362199                fix-u-media-header -T 0x46 -B $(4) \ 
     
    365202        fi 
    366203endef 
    367  
    368 define BuildFirmware/UMedia/initramfs 
    369         $(call BuildFirmware/GENERIC_8M/initramfs,$(1),$(2),$(3),ttyS1,57600,phys) 
    370 endef 
    371  
    372 mtdlayout_whrg300n=192k(u-boot)ro,64k(u-boot-env)ro,64k(factory)ro,960k(kernel),2752k(rootfs),64k(user)ro,3712k@0x50000(firmware) 
    373 define BuildFirmware/WHRG300N 
    374         $(call Image/Build/Template/GENERIC_4M,$(1),whr-g300n,WHR-G300N,ttyS1,57600,phys) 
    375         $(call BuildFirmware/Buffalo,$(1),whr-g300n,$(call mkcmdline,WHR-G300N,ttyS1,57600) $(call mkmtd/phys,$(mtdlayout_whrg300n)),983040,3801088) 
     204BuildFirmware/UMedia/initramfs=$(call BuildFirmware/OF/initramfs,$(1),$(2),$(3)) 
     205 
     206 
     207 
     208# 
     209# RT288X Profiles 
     210# 
     211 
     212# 0x790000 
     213belkin_f5d8235v1_mtd_size=7929856 
     214Image/Build/Profile/F5D8235V1=$(call BuildFirmware/CustomFlash/$(1),$(1),f5d8235v1,F5D8235_V1,$(belkin_f5d8235v1_mtd_size)) 
     215 
     216Image/Build/Profile/BR6524N=$(call BuildFirmware/Edimax/$(1),$(1),br6524n,BR6524N,$(ralink_default_fw_size_4M),CSYS,WNRA,0x50000,0xc0000) 
     217 
     218Image/Build/Profile/RTN15=$(call BuildFirmware/Default4M/$(1),$(1),rt-n15,RTN15) 
     219 
     220Image/Build/Profile/V11STFE=$(call BuildFirmware/Default4M/$(1),$(1),v11st-fe,V11STFE) 
     221 
     222Image/Build/Profile/WLITX4AG300N=$(call BuildFirmware/Default4M/$(1),$(1),wli-tx4-ag300n,WLI-TX4-AG300N) 
     223 
     224ifeq ($(SUBTARGET),rt288x) 
     225define Image/Build/Profile/Default 
     226        $(call Image/Build/Profile/F5D8235V1,$(1)) 
     227        $(call Image/Build/Profile/BR6524N,$(1)) 
     228        $(call Image/Build/Profile/RTN15,$(1)) 
     229        $(call Image/Build/Profile/V11STFE,$(1)) 
     230        $(call Image/Build/Profile/WLITX4AG300N,$(1)) 
     231endef 
     232endif 
     233 
     234 
     235 
     236# 
     237# RT305X Profiles 
     238# 
     239 
     240edimax_3g6200n_mtd_size=3735552 
     241Image/Build/Profile/3G6200N=$(call BuildFirmware/CustomFlash/$(1),$(1),3g-6200n,3G-6200N,$(edimax_3g6200n_mtd_size)) 
     242 
     243Image/Build/Profile/3G300M=$(call BuildFirmware/CustomFlashFactory/$(1),$(1),3g300m,3G300M,$(ralink_default_fw_size_4M),3G150M_SPI Kernel Image,factory) 
     244 
     245Image/Build/Profile/AIR3GII=$(call BuildFirmware/Default4M/$(1),$(1),air3gii,AIR3GII) 
     246 
     247define BuildFirmware/UIMAGE_8M 
     248        $(call MkCombineduImage,$(1),$(2),$(call mkcmdline,$(3),$(4),$(5)) $(call mkmtd/$(6),$(mtdlayout_8M)),$(kernel_size_8M),$(rootfs_size_8M),$(7)) 
     249endef 
     250define Image/Build/Profile/ALL02393G 
     251        $(call Image/Build/Template/$(image_type)/$(1),UIMAGE_8M,all0239-3g,ALL0239-3G,ttyS1,57600,phys) 
     252endef 
     253 
     254Image/Build/Profile/ALL0256N=$(call BuildFirmware/DefaultDualSize/$(1),$(1),all0256n,ALL0256N) 
     255 
     256allnet_all5002_mtd_size=33226752 
     257Image/Build/Profile/ALL5002=$(call BuildFirmware/CustomFlash/$(1),$(1),all5002,ALL5002,$(allnet_all5002_mtd_size)) 
     258 
     259argus_atp52b_mtd_size=7995392 
     260Image/Build/Profile/ARGUS_ATP52B=$(call BuildFirmware/CustomFlash/$(1),$(1),argus_atp52b,ARGUS_ATP52B,$(argus_atp52b_mtd_size)) 
     261 
     262Image/Build/Profile/BC2=$(call BuildFirmware/Default8M/$(1),$(1),bc2,BC2) 
     263 
     264broadway_mtd_size=7929856 
     265Image/Build/Profile/BROADWAY=$(call BuildFirmware/CustomFlashFactory/$(1),$(1),broadway,BROADWAY,$(broadway_mtd_size),Broadway Kernel Image,factory) 
     266 
     267Image/Build/Profile/CARAMBOLA=$(call BuildFirmware/Default8M/$(1),$(1),carambola,CARAMBOLA) 
     268 
     269define BuildFirmware/DIR300B1/squashfs 
     270        $(call BuildFirmware/Default4M/$(1),$(1),$(2),$(3)) 
     271        -mkwrgimg -s $(4) -d /dev/mtdblock/2 \ 
     272                -i $(call sysupname,$(1),$(2)) \ 
     273                -o $(call imgname,$(1),$(2))-factory.bin 
     274endef 
     275BuildFirmware/DIR300B1/initramfs=$(call BuildFirmware/OF/initramfs,$(1),$(2),$(3)) 
     276Image/Build/Profile/DIR-300-B1=$(call BuildFirmware/DIR300B1/$(1),$(1),dir-300-b1,DIR-300-B1,wrgn23_dlwbr_dir300b) 
     277Image/Build/Profile/DIR-600-B1=$(call BuildFirmware/DIR300B1/$(1),$(1),dir-600-b1,DIR-600-B1,wrgn23_dlwbr_dir600b) 
     278Image/Build/Profile/DIR-600-B2=$(call BuildFirmware/DIR300B1/$(1),$(1),dir-600-b2,DIR-600-B2,wrgn23_dlwbr_dir600b) 
     279Image/Build/Profile/DIR-615-D=$(call BuildFirmware/DIR300B1/$(1),$(1),dir-615-d,DIR-615-D,wrgn23_dlwbr_dir615d) 
     280 
     281Image/Build/Profile/DIR-620-A1=$(call BuildFirmware/Default8M/$(1),$(1),dir-620-a1,DIR-620-A1) 
     282 
     283define BuildFirmware/DIR615H1/squashfs 
     284        $(call BuildFirmware/Default4M/$(1),$(1),dir-615-h1,DIR-615-H1) 
     285        -mkdir615h1 -e $(call sysupname,$(1),dir-615-h1) \ 
     286                -o $(call imgname,$(1),dir-615-h1)-factory.bin 
     287endef 
     288BuildFirmware/DIR615H1/initramfs=$(call BuildFirmware/OF/initramfs,$(1),dir-615-h1,DIR-615-H1) 
     289Image/Build/Profile/DIR615H1=$(call BuildFirmware/DIR615H1/$(1),$(1)) 
     290 
     291dap1350_mtd_size=7667712 
     292define BuildFirmware/DAP1350/squashfs 
     293        $(call BuildFirmware/CustomFlash/$(1),$(1),dap-1350,DAP-1350,$(dap1350_mtd_size)) 
     294        -mkdapimg -s $(4) \ 
     295                -i $(call sysupname,$(1),dap-1350) \ 
     296                -o $(call imgname,$(1),dap-1350)-factory.bin 
     297endef 
     298BuildFirmware/DAP1350/initramfs=$(call BuildFirmware/OF/initramfs,$(1),dap-1350,DAP-1350) 
     299Image/Build/Profile/DAP1350=$(call BuildFirmware/DAP1350/$(1),$(1),) 
     300 
     301Image/Build/Profile/ESR-9753=$(call BuildFirmware/Default4M/$(1),$(1),esr-9753,ESR-9753) 
     302 
     303Image/Build/Profile/HW550-3G=$(call BuildFirmware/Default8M/$(1),$(1),hw550-3g,HW550-3G) 
     304 
     305belkin_f5d8235v2_mtd_size=7929856 
     306Image/Build/Profile/F5D8235V2=$(call BuildFirmware/CustomFlash/$(1),$(1),f5d8235v2,F5D8235_V2,$(belkin_f5d8235v2_mtd_size)) 
     307 
     308Image/Build/Profile/FONERA20N=$(call BuildFirmware/Edimax/$(1),$(1),fonera20n,FONERA20N,$(ralink_default_fw_size_8M),RSDK,NL1T,0x50000,0xc0000) 
     309 
     310Image/Build/Profile/RT-N13U=$(call BuildFirmware/Default8M/$(1),$(1),rt-n13u,RT-N13U) 
     311 
     312Image/Build/Profile/FREESTATION5=$(call BuildFirmware/Default8M/$(1),$(1),freestation5,FREESTATION5) 
     313 
     314Image/Build/Profile/MOFI3500-3GN=$(call BuildFirmware/Default8M/$(1),$(1),mofi3500-3gn,MOFI3500-3GN) 
     315 
     316Image/Build/Profile/NBG-419N=$(call BuildFirmware/Default4M/$(1),$(1),nbg-419n,NBG-419N) 
     317 
     318Image/Build/Profile/MZKW300NH2=$(call BuildFirmware/Edimax/$(1),$(1),mzk-w300nh2,MZK-W300NH2,$(mzkw300nh2_mtd_size),CSYS,RN52,0x50000,0xc0000) 
     319 
     320nw718_mtd_size=3801088 
     321Image/Build/Profile/NW718=$(call BuildFirmware/CustomFlashFactory/$(1),$(1),nw718m,NW718,$(nw718_mtd_size),ARA1B4NCRNW718;1,factory) 
     322 
     323Image/Build/Profile/OMNI-EMB=$(call BuildFirmware/Default8M/$(1),$(1),omni-emb,OMNI-EMB) 
     324 
     325Image/Build/Profile/PSR-680W=$(call BuildFirmware/Default4M/$(1),$(1),psr-680w,PSR-680W) 
     326 
     327Image/Build/Profile/PWH2004=$(call BuildFirmware/Default8M/$(1),$(1),pwh2004,PWH2004) 
     328 
     329Image/Build/Profile/RTG32B1=$(call BuildFirmware/Default4M/$(1),$(1),rt-g32-b1,RT-G32-B1) 
     330 
     331Image/Build/Profile/RTN10PLUS=$(call BuildFirmware/Default4M/$(1),$(1),rt-n10-plus,RT-N10-PLUS) 
     332 
     333Image/Build/Profile/SL-R7205=$(call BuildFirmware/Default4M/$(1),$(1),sl-r7205,SL-R7205) 
     334 
     335Image/Build/Profile/V22RW-2X2=$(call BuildFirmware/Default4M/$(1),$(1),v22rw-2x2,V22RW-2X2) 
     336 
     337Image/Build/Profile/W306R_V20=$(call BuildFirmware/CustomFlashFactory/$(1),$(1),w306r-v20,W306R_V20,$(ralink_default_fw_size_4M),linkn Kernel Image,factory) 
     338 
     339Image/Build/Profile/W502U=$(call BuildFirmware/Default8M/$(1),$(1),w502u,W502U) 
     340 
     341Image/Build/Profile/WCR150GN=$(call BuildFirmware/Default4M/$(1),$(1),wcr150gn,WCR150GN) 
     342 
     343buffalo_whrg300n_mtd_size=3801088 
     344define BuildFirmware/WHRG300N/squashfs 
     345        $(call BuildFirmware/Default4M/$(1),$(1),whr-g300n,WHR-G300N) 
     346        # the following line has a bad argument 3 ... the old Makefile was already broken        
     347        $(call BuildFirmware/Buffalo,$(1),whr-g300n,whr-g300n) 
    376348        ( \ 
    377349                echo -n -e "# Airstation FirmWare\nrun u_fw\nreset\n\n" | \ 
     
    382354                -o $(call imgname,$(1),whr-g300n)-tftp.bin 
    383355endef 
    384  
    385 mtdlayout_wl341v3=128k(u-boot)ro,64k(board-nvram)ro,64k(u-boot-env)ro,896k(kernel),2880k(rootfs),64k(signature-eRcOmM),3776k@0x40000(firmware),4096k@0x0(fullflash) 
     356BuildFirmware/WHRG300N/initramfs=$(call BuildFirmware/OF/initramfs,$(1),whr-g300n,WHR-G300N) 
     357Image/Build/Profile/WHRG300N=$(call BuildFirmware/WHRG300N/$(1),$(1)) 
     358 
     359Image/Build/Profile/WL_330N=$(call BuildFirmware/Default4M/$(1),$(1),wl-330n,WL_330N) 
     360 
     361Image/Build/Profile/WL_330N3G=$(call BuildFirmware/Default4M/$(1),$(1),wl-330n3g,WL_330N3G) 
     362 
    386363kernel_size_wl341v3=917504 
    387364rootfs_size_wl341v3=2949120 
    388 define BuildFirmware/WL341V3 
    389         $(call BuildFirmware/Generic,$(1),$(2),board=$(3) $(call mkmtd/phys,$(mtdlayout_wl341v3)),$(kernel_size_wl341v3),$(rootfs_size_wl341v3)) 
     365define BuildFirmware/WL341V3/squashfs 
     366        $(call BuildFirmware/Default4M/$(1),$(1),wl341v3,WL341V3) 
     367        # This code looks broken and really needs to be converted to C 
    390368        if [ -e "$(call sysupname,$(1),$(2))" ]; then \ 
    391369                ( \ 
     
    402380        fi 
    403381endef 
    404  
    405 mtdlayout_wlitx4ag300n=192k(u-boot)ro,64k(u-boot-env)ro,64k(factory)ro,896k(kernel),2816k(rootfs),64k(user)ro,3712k@0x50000(firmware) 
    406 define BuildFirmware/WLITX4AG300N 
    407         $(call BuildFirmware/Buffalo2,$(1),wli-tx4-ag300n,WLI-TX4-AG300N,$(call mkmtd/phys,$(mtdlayout_wlitx4ag300n)),917504,2883584) 
    408 endef 
    409  
    410 mtdlayout_mzkw300nh2=192k(u-boot)ro,64k(u-boot-env)ro,64k(factory)ro,832k(kernel),2816k(rootfs),128k@0x3e0000(cimage)ro,3648k@0x50000(firmware) 
    411 kernel_size_mzkw300nh2=851968 
    412 rootfs_size_mzkw300nh2=2883584 
    413 define BuildFirmware/MZKW300NH2 
    414         $(call BuildFirmware/Generic,$(1),$(2),$(call mkcmdline,$(3),$(4),$(5)) $(call mkmtd/$(6),$(mtdlayout_mzkw300nh2)),$(kernel_size_mzkw300nh2),$(rootfs_size_mzkw300nh2)) 
    415         $(call CatFiles,$(KDIR)/vmlinux-$(2).uImage,`expr $(kernel_size_mzkw300nh2) - 20`,$(KDIR)/root.$(1),$(rootfs_size_mzkw300nh2),$(call imgname,$(1),$(2))-factory.bin) 
    416         -mkedimaximg -i $(call imgname,$(1),$(2))-factory.bin \ 
    417                 -o $(call imgname,$(1),$(2))-factory.bin \ 
    418                 -s CSYS -m RN52 -f 0x50000 -S 0xc0000; 
    419 endef 
    420  
    421 define BuildFirmware/MZKW300NH2/initramfs 
    422         $(call BuildFirmware/Generic/initramfs,$(1),$(2),$(call mkcmdline,$(3),$(4),$(5)) $(call mkmtd/$(6),$(mtdlayout_mzkw300nh2))) 
    423 endef 
    424  
    425 # 
    426 # Templates 
    427 # 
    428 define Image/Build/Template/initramfs/initramfs 
    429         $(call BuildFirmware/$(1)/initramfs,initramfs,$(2),$(3),$(4),$(5),$(6),$(7),$(8)) 
    430 endef 
    431  
    432 define Image/Build/Template/squashfs-only/squashfs 
    433         $(call BuildFirmware/$(1),squashfs,$(2),$(3),$(4),$(5),$(6),$(7),$(8)) 
    434 endef 
    435  
    436 # 
    437 # RT288X Profiles 
    438 # 
    439 define Image/Build/Profile/F5D8235V1 
    440         $(call Image/Build/Template/$(fs_squash)/$(1),F5D8235,f5d8235v1,F5D8235_V1) 
    441 endef 
    442  
    443 define Image/Build/Profile/BR6524N 
    444         $(call Image/Build/Template/$(fs_squash)/$(1),BR6524N,br6524n,BR6524N,ttyS1,57600,phys) 
    445 endef 
    446  
    447 define Image/Build/Profile/RTN15 
    448         $(call Image/Build/Template/$(fs_squash)/$(1),GENERIC_4M,rt-n15,RT-N15,ttyS1,57600,phys) 
    449 endef 
    450  
    451 define Image/Build/Profile/V11STFE 
    452         $(call Image/Build/Template/$(fs_squash)/$(1),GENERIC_4M,v11st-fe,V11ST-FE,ttyS1,57600,phys) 
    453 endef 
    454  
    455 define Image/Build/Profile/WLITX4AG300N 
    456         $(call Image/Build/Template/$(fs_squash)/$(1),WLITX4AG300N) 
    457 endef 
    458  
    459 ifeq ($(CONFIG_RALINK_RT288X),y) 
    460 define Image/Build/Profile/Default 
    461         $(call Image/Build/Profile/F5D8235V1,$(1)) 
    462         $(call Image/Build/Profile/BR6524N,$(1)) 
    463         $(call Image/Build/Profile/RTN15,$(1)) 
    464         $(call Image/Build/Profile/V11STFE,$(1)) 
    465         $(call Image/Build/Profile/WLITX4AG300N,$(1)) 
    466 endef 
    467 endif 
    468  
    469 # 
    470 # RT305X Profiles 
    471 # 
    472 define Image/Build/Profile/3G6200N 
    473         $(call Image/Build/Template/$(fs_squash)/$(1),3G6200N,3g-6200n,3G-6200N,ttyS1,57600,phys) 
    474 endef 
    475  
    476 define Image/Build/Profile/3G300M 
    477         $(call Image/Build/Template/$(fs_squash)/$(1),GENERIC_4M,3g300m,3G300M,ttyS1,57600,spi,3G150M_SPI Kernel Image,factory.bin) 
    478         $(call Image/Build/Template/$(fs_squash)/$(1),GENERIC_4M,3g300m,3G300M,ttyS1,57600,spi) 
    479 endef 
    480  
    481 define Image/Build/Profile/AIR3GII 
    482         $(call Image/Build/Template/$(fs_squash)/$(1),GENERIC_4M,air3gii,AIR3GII,ttyS1,57600,spi) 
    483 endef 
    484  
    485 define Image/Build/Profile/ALL02393G 
    486         $(call Image/Build/Template/$(fs_squash)/$(1),UIMAGE_8M,all0239-3g,ALL0239-3G,ttyS1,57600,phys) 
    487 endef 
    488  
    489 define Image/Build/Profile/ALL0256N 
    490         $(call Image/Build/Template/$(fs_squash)/$(1),GENERIC_4M,all0256n,ALL0256N,ttyS1,57600,spi) 
    491         $(call Image/Build/Template/$(fs_squash)/$(1),GENERIC_8M,all0256n-8M,ALL0256N,ttyS1,57600,spi) 
    492 endef 
    493  
    494 define Image/Build/Profile/ALL5002 
    495         $(call Image/Build/Template/$(fs_squash)/$(1),ALL5002,all5002,ALL5002,ttyS1,57600,spi) 
    496 endef 
    497  
    498 define Image/Build/Profile/ARGUS_ATP52B 
    499         $(call Image/Build/Template/$(fs_squash)/$(1),ARGUS_ATP52B,argus_atp52b,ARGUS_ATP52B) 
    500 endef 
    501  
    502 define Image/Build/Profile/BC2 
    503         $(call Image/Build/Template/$(fs_squash)/$(1),GENERIC_8M,bc2,BC2,ttyS1,57600,phys) 
    504 endef 
    505  
    506 define Image/Build/Profile/BROADWAY 
    507         $(call Image/Build/Template/$(fs_squash)/$(1),BROADWAY,broadway,BROADWAY,ttyS1,57600,phys) 
    508 endef 
    509  
    510 define Image/Build/Profile/CARAMBOLA 
    511         $(call Image/Build/Template/$(fs_squash)/$(1),GENERIC_8M,carambola,CARAMBOLA,ttyS1,115200,phys) 
    512 endef 
    513  
    514 define Image/Build/Profile/DIR300B1 
    515         $(call Image/Build/Template/$(fs_squash)/$(1),DIR300B1,dir-300-b1,DIR-300-B1,wrgn23_dlwbr_dir300b) 
    516         $(call Image/Build/Template/$(fs_squash)/$(1),DIR300B1,dir-600-b1,DIR-600-B1,wrgn23_dlwbr_dir600b) 
    517         $(call Image/Build/Template/$(fs_squash)/$(1),DIR300B1,dir-600-b2,DIR-600-B2,wrgn23_dlwbr_dir600b) 
    518         $(call Image/Build/Template/$(fs_squash)/$(1),DIR300B1,dir-615-d,DIR-615-D,wrgn23_dlwbr_dir615d) 
    519         $(call Image/Build/Template/$(fs_squash)/$(1),DIR620A1,dir-620-a1,DIR-620-A1) 
    520 endef 
    521  
    522 define Image/Build/Profile/DIR615H1 
    523         $(call Image/Build/Template/$(fs_squash)/$(1),DIR615H1,dir-615-h1,DIR-615-H1,ttyS1,57600,spi) 
    524 endef 
    525  
    526 define Image/Build/Profile/DAP1350 
    527         $(call Image/Build/Template/$(fs_squash)/$(1),DAP1350,dap-1350,DAP-1350,RT3052-AP-DAP1350-3) 
    528 endef 
    529  
    530 define Image/Build/Profile/ESR9753 
    531         $(call Image/Build/Template/$(fs_squash)/$(1),GENERIC_4M,esr-9753,ESR-9753,ttyS1,57600,phys) 
    532 endef 
    533  
    534 define Image/Build/Profile/HW5503G 
    535         $(call Image/Build/Template/$(fs_squash)/$(1),GENERIC_8M,hw550-3g,HW550-3G,ttyS1,57600,phys) 
    536 endef 
    537  
    538 define Image/Build/Profile/F5D8235V2 
    539         $(call Image/Build/Template/$(fs_squash)/$(1),F5D8235,f5d8235v2,F5D8235_V2) 
    540 endef 
    541  
    542 define Image/Build/Profile/FONERA20N 
    543         $(call Image/Build/Template/$(fs_squash)/$(1),FONERA20N) 
    544 endef 
    545  
    546 define Image/Build/Profile/RT-N13U 
    547         $(call Image/Build/Template/$(fs_squash)/$(1),RT-N13U) 
    548 endef 
    549  
    550 define Image/Build/Profile/FREESTATION5 
    551         $(call Image/Build/Template/$(fs_squash)/$(1),GENERIC_8M,freestation5,FREESTATION5,ttyS1,115200,phys) 
    552 endef 
    553  
    554 define Image/Build/Profile/MOFI35003GN 
    555         $(call Image/Build/Template/$(fs_squash)/$(1),GENERIC_8M,mofi3500-3gn,MOFI3500-3GN,ttyS1,57600,phys) 
    556 endef 
    557  
    558 define Image/Build/Profile/NBG419N 
    559         $(call Image/Build/Template/$(fs_squash)/$(1),GENERIC_4M,nbg-419n,NBG-419N,ttyS1,57600,phys) 
    560 endef 
    561  
    562 define Image/Build/Profile/MZKW3000NH2 
    563         $(call Image/Build/Template/$(fs_squash)/$(1),MZKW300NH2,mzk-w300nh2,MZK-W300NH2,ttyS1,57600,phys) 
    564 endef 
    565  
    566 define Image/Build/Profile/NW718 
    567         $(call Image/Build/Template/$(fs_squash)/$(1),NW718,nw718) 
    568 endef 
    569  
    570 define Image/Build/Profile/OMNIEMB 
    571         $(call Image/Build/Template/$(fs_squash)/$(1),GENERIC_8M,omni-emb,OMNI-EMB,ttyS1,57600,phys) 
    572 endef 
    573  
    574 define Image/Build/Profile/PSR680W 
    575         $(call Image/Build/Template/$(fs_squash)/$(1),GENERIC_4M,psr-680w,PSR-680W,ttyS1,115200,phys) 
    576 endef 
    577  
    578 define Image/Build/Profile/PWH2004 
    579         $(call Image/Build/Template/$(fs_squash)/$(1),GENERIC_8M,pwh2004,PWH2004,ttyS1,57600,phys) 
    580 endef 
    581  
    582 define Image/Build/Profile/RTG32B1 
    583         $(call Image/Build/Template/$(fs_squash)/$(1),RTG32B1,rt-g32-b1,RT-G32-B1) 
    584 endef 
    585  
    586 define Image/Build/Profile/RTN10PLUS 
    587         $(call Image/Build/Template/$(fs_squash)/$(1),RTN10PLUS,rt-n10-plus,RT-N10-PLUS) 
    588 endef 
    589  
    590 define Image/Build/Profile/SLR7205 
    591         $(call Image/Build/Template/$(fs_squash)/$(1),GENERIC_4M,sl-r7205,SL-R7205,ttyS1,57600,phys) 
    592 endef 
    593  
    594 define Image/Build/Profile/V22RW2X2 
    595         $(call Image/Build/Template/$(fs_squash)/$(1),GENERIC_4M,v22rw-2x2,V22RW-2X2,ttyS1,57600,phys) 
    596 endef 
    597  
    598 define Image/Build/Profile/W306R_V20 
    599         $(call Image/Build/Template/$(fs_squash)/$(1),GENERIC_4M,w306r-v20,W306R_V20,ttyS1,57600,phys,linkn Kernel Image,factory.bin) 
    600         $(call Image/Build/Template/$(fs_squash)/$(1),GENERIC_4M,w306r-v20,W306R_V20,ttyS1,57600,phys) 
    601 endef 
    602  
    603 define Image/Build/Profile/W502U 
    604         $(call Image/Build/Template/$(fs_squash)/$(1),GENERIC_8M,w502u,W502U,ttyS1,115200,phys) 
    605 endef 
    606  
    607 define Image/Build/Profile/WCR150GN 
    608         $(call Image/Build/Template/$(fs_squash)/$(1),GENERIC_4M,wcr150gn,WCR150GN,ttyS1,57600,phys) 
    609 endef 
    610  
    611 define Image/Build/Profile/WHRG300N 
    612         $(call Image/Build/Template/$(fs_squashfs)/$(1),WHRG300N) 
    613 endef 
    614  
    615 define Image/Build/Profile/WL_330N 
    616         $(call Image/Build/Template/$(fs_squash)/$(1),GENERIC_4M,wl-330n,WL_330N,ttyS1,57600,spi) 
    617 endef 
    618  
    619 define Image/Build/Profile/WL_330N3G 
    620         $(call Image/Build/Template/$(fs_squash)/$(1),GENERIC_4M,wl-330n3g,WL_330N3G,ttyS1,57600,spi) 
    621 endef 
    622  
    623 define Image/Build/Profile/WL341V3 
    624         $(call Image/Build/Template/$(fs_squash)/$(1),WL341V3,wl341v3,WL341V3) 
    625 endef 
    626  
    627 define Image/Build/Profile/WL351 
    628         $(call Image/Build/Template/$(fs_squash)/$(1),GENERIC_4M,wl-351,WL-351,ttyS1,57600,phys) 
    629 endef 
    630  
    631 define Image/Build/Profile/WR5123GN 
    632         $(call Image/Build/Template/$(fs_squash)/$(1),GENERIC_4M,wr512-3gn-4M,WR512-3GN,ttyS1,57600,phys) 
    633         $(call Image/Build/Template/$(fs_squash)/$(1),GENERIC_8M,wr512-3gn-8M,WR512-3GN,ttyS1,57600,phys) 
    634 endef 
    635  
    636 define Image/Build/Profile/UPVEL_326 
    637         $(call Image/Build/Template/$(fs_squash)/$(1),GENERIC_4M,ur-326n4g,UR-326N4G,ttyS1,57600,phys) 
    638 endef 
    639  
    640 define Image/Build/Profile/UPVEL 
    641         $(call Image/Build/Template/$(fs_squash)/$(1),GENERIC_8M,ur-336un,UR-336UN,ttyS1,57600,phys) 
    642 endef 
    643  
    644 define Image/Build/Profile/WR6202 
    645         $(call Image/Build/Template/$(fs_squash)/$(1),GENERIC_8M,wr6202,WR6202,ttyS1,115200,phys) 
    646 endef 
    647  
    648 define Image/Build/Profile/XDXRN502J 
    649         $(call Image/Build/Template/$(fs_squash)/$(1),GENERIC_4M,xdxrn502j,XDXRN502J,ttyS1,57600,phys) 
    650 endef 
    651  
    652 ifeq ($(CONFIG_RALINK_RT305X),y) 
     382BuildFirmware/WL341V3/initramfs=$(call BuildFirmware/OF/initramfs,$(1),wl341v3,WL341V3) 
     383Image/Build/Profile/WL341V3=$(call BuildFirmware/WL341V3/$(1),$(1)) 
     384 
     385Image/Build/Profile/WL-351=$(call BuildFirmware/Default4M/$(1),$(1),wl-351,WL-351) 
     386 
     387Image/Build/Profile/WR512-3GN=$(call BuildFirmware/DefaultDualSize/$(1),$(1),wr512-3ng,WR512-3GN) 
     388 
     389Image/Build/Profile/UR-326N4G=$(call BuildFirmware/Default4M/$(1),$(1),ur-326n4g,UR-326N4G) 
     390 
     391Image/Build/Profile/UR-336UN=$(call BuildFirmware/Default8M/$(1),$(1),ur-336un,UR-336UN) 
     392 
     393Image/Build/Profile/WR6202=$(call BuildFirmware/Default8M/$(1),$(1),wr6202,WR6202) 
     394 
     395Image/Build/Profile/XDXRN502J=$(call BuildFirmware/Default4M/$(1),$(1),xdxrn502j,XDXRN502J) 
     396 
     397ifeq ($(SUBTARGET),rt305x) 
    653398define Image/Build/Profile/Default 
    654399        $(call Image/Build/Profile/3G6200N,$(1)) 
     
    662407        $(call Image/Build/Profile/BROADWAY,$(1)) 
    663408        $(call Image/Build/Profile/CARAMBOLA,$(1)) 
    664         $(call Image/Build/Profile/DIR300B1,$(1)) 
     409        $(call Image/Build/Profile/DIR-300-B1,$(1)) 
     410        $(call Image/Build/Profile/DIR-600-B1,$(1)) 
     411        $(call Image/Build/Profile/DIR-600-B2,$(1)) 
     412        $(call Image/Build/Profile/DIR-615-D,$(1)) 
     413        $(call Image/Build/Profile/DIR-620-A1,$(1)) 
    665414        $(call Image/Build/Profile/DIR615H1,$(1)) 
    666415        $(call Image/Build/Profile/DAP1350,$(1)) 
    667         $(call Image/Build/Profile/ESR9753,$(1)) 
     416        $(call Image/Build/Profile/ESR-9753,$(1)) 
    668417        $(call Image/Build/Profile/F5D8235V2,$(1)) 
    669         $(call Image/Build/Profile/RTN10PLUS,$(1)) 
    670418        $(call Image/Build/Profile/FONERA20N,$(1)) 
    671         $(call Image/Build/Profile/RT-N13U,$(1)) 
    672419        $(call Image/Build/Profile/FREESTATION5,$(1)) 
    673         $(call Image/Build/Profile/HW5503G,$(1)) 
    674         $(call Image/Build/Profile/MOFI35003GN,$(1)) 
    675         $(call Image/Build/Profile/MZKW3000NH2,$(1)) 
    676         $(call Image/Build/Profile/NBG419N,$(1)) 
     420        $(call Image/Build/Profile/HW550-3G,$(1)) 
     421        $(call Image/Build/Profile/MOFI3500-3GN,$(1)) 
     422        $(call Image/Build/Profile/MZKW300NH2,$(1)) 
     423        $(call Image/Build/Profile/NBG-419N,$(1)) 
    677424        $(call Image/Build/Profile/NW718,$(1)) 
    678         $(call Image/Build/Profile/OMNIEMB,$(1)) 
    679         $(call Image/Build/Profile/UPVEL_326,$(1)) 
    680         $(call Image/Build/Profile/PSR680W,$(1)) 
     425        $(call Image/Build/Profile/OMNI-EMB,$(1)) 
     426        $(call Image/Build/Profile/PSR-680W,$(1)) 
    681427        $(call Image/Build/Profile/PWH2004,$(1)) 
    682428        $(call Image/Build/Profile/RTG32B1,$(1)) 
    683         $(call Image/Build/Profile/SLR7205,$(1)) 
    684         $(call Image/Build/Profile/V22RW2X2,$(1)) 
     429        $(call Image/Build/Profile/RTN10PLUS,$(1)) 
     430        $(call Image/Build/Profile/RT-N13U,$(1)) 
     431        $(call Image/Build/Profile/SL-R7205,$(1)) 
     432        $(call Image/Build/Profile/UR-326N4G,$(1)) 
     433        $(call Image/Build/Profile/V22RW-2X2,$(1)) 
    685434        $(call Image/Build/Profile/W306R_V20,$(1)) 
    686435        $(call Image/Build/Profile/W502U,$(1)) 
     
    690439        $(call Image/Build/Profile/WL_330N3G,$(1)) 
    691440        $(call Image/Build/Profile/WL341V3,$(1)) 
    692         $(call Image/Build/Profile/WL351,$(1)) 
    693         $(call Image/Build/Profile/WR5123GN,$(1)) 
     441        $(call Image/Build/Profile/WL-351,$(1)) 
     442        $(call Image/Build/Profile/WR512-3GN,$(1)) 
    694443        $(call Image/Build/Profile/WR6202,$(1)) 
    695444        $(call Image/Build/Profile/XDXRN502J,$(1)) 
     
    697446endif 
    698447 
     448 
     449 
    699450# 
    700451# RT3662/RT3883 Profiles 
    701452# 
    702 define Image/Build/Profile/DIR645 
    703         $(call Image/Build/Template/$(fs_squash)/$(1),DIR645,dir-645,DIR-645,ttyS1,57600,spi,wrgn39_dlob.hans_dir645) 
    704 endef 
    705  
    706 define Image/Build/Profile/OMNIEMBHPM 
    707         $(call Image/Build/Template/$(fs_squash)/$(1),OMNIEMBHPM,omni-emb-hpm,OMNI-EMB-HPM) 
    708 endef 
    709  
    710 define Image/Build/Profile/RTN56U 
    711         $(call Image/Build/Template/$(fs_squash)/$(1),GENERIC_8M,rt-n56u,RT-N56U,ttyS1,57600,phys) 
    712 endef 
    713  
    714 define Image/Build/Profile/TEW691GR 
    715         $(call Image/Build/Template/$(fs_squash)/$(1),UMedia,tew-691gr,TEW-691GR,0x026910) 
    716 endef 
    717  
    718 define Image/Build/Profile/TEW692GR 
    719         $(call Image/Build/Template/$(fs_squash)/$(1),UMedia,tew-692gr,TEW-692GR,0x026920) 
    720 endef 
    721  
    722 ifeq ($(CONFIG_RALINK_RT3883),y) 
     453Image/Build/Profile/DIR645=$(call BuildFirmware/Seama/$(1),$(1),dir-645,DIR-645,wrgn39_dlob.hans_dir645) 
     454 
     455omniembhpm_mtd_size=16449536 
     456Image/Build/Profile/OMNIEMBHPM=$(call BuildFirmware/CustomFlash/$(1),$(1),omni-emb-hpm,OMNI-EMB-HPM,$(omniembhpm_mtd_size)) 
     457 
     458Image/Build/Profile/RTN56U=$(call BuildFirmware/Default8M/$(1),$(1),rt-n56u,RTN56U) 
     459 
     460Image/Build/Profile/TEW691GR=$(call BuildFirmware/UMedia/$(1),$(1),tew-691gr,TEW-691GR,0x026910) 
     461 
     462#Image/Build/Profile/TEW692GR=$(call BuildFirmware/UMedia/$(1),$(1),tew-692gr,TEW-692GR,0x026920) 
     463 
     464ifeq ($(SUBTARGET),rt3883) 
    723465define Image/Build/Profile/Default 
    724466        $(call Image/Build/Profile/DIR645,$(1)) 
     
    730472endif 
    731473 
    732 define Image/Build/Initramfs 
    733         $(call Image/Build/Profile/$(PROFILE),initramfs) 
    734 endef 
    735  
     474 
     475# 
     476# Generic Targets 
     477# 
    736478define Image/Build/squashfs 
    737479        $(call prepare_generic_squashfs,$(KDIR)/root.squashfs) 
     480endef 
     481 
     482define Image/BuildKernel 
     483        cp $(KDIR)/vmlinux.elf $(BIN_DIR)/$(VMLINUX).elf 
     484        cp $(KDIR)/vmlinux $(BIN_DIR)/$(VMLINUX).bin 
     485        $(call CompressLzma,$(KDIR)/vmlinux,$(KDIR)/vmlinux.bin.lzma) 
     486        $(call MkImage,lzma,$(KDIR)/vmlinux.bin.lzma,$(KDIR)/uImage.lzma) 
     487        cp $(KDIR)/uImage.lzma $(BIN_DIR)/$(UIMAGE).bin 
     488        $(call Image/Build/Initramfs) 
    738489endef 
    739490 
Note: See TracChangeset for help on using the changeset viewer.