ar71xx: clean up legacy-devices.mk
[openwrt/openwrt.git] / target / linux / ar71xx / image / legacy.mk
index 42f1a9280409dfe4cb05365371f9a36003c1832d..c2daba9f60d90778c71f1c2c143f86076040edd6 100644 (file)
@@ -1,4 +1,3 @@
-include ./legacy-devices.mk
 rootfs_type=$(patsubst jffs2-%,jffs2,$(patsubst squashfs-%,squashfs,$(1)))
 
 # $(1): rootfs type.
@@ -29,8 +28,6 @@ define mtdpartsize
 $(shell sz=`echo '$(2)' | sed -ne 's/.*[:$(COMMA)]\([0-9]*\)k[@]*[0-9a-zx]*($(1)).*/\1/p'`; [ -n "$$sz" ] && echo $$(($$sz * 1024)))
 endef
 
-SINGLE_PROFILES:=
-
 # $(1)      : name of image build method to be used, e.g., AthLzma.
 # $(2)      : name of the build template to be used, e.g. 64k, 64kraw, 128k, etc.
 # $(3)      : name of the profile to be defined.
@@ -43,17 +40,6 @@ define SingleProfile
   define Image/Build/Profile/$(3)
        $$(call Image/Build/Template/$(2)/$$(1),$(1),$(4),$$(call mkcmdline,$(5),$(6),$(7)),$(8),$(9),$(10),$(11),$(12),$(13),$(14))
   endef
-  SINGLE_PROFILES += $(3)
-endef
-
-# $(1), name of the MultiProfile to be added.
-# $(2), name of Profiles to be included in the MultiProfile.
-define MultiProfile
-  define Image/Build/Profile/$(1)
-       $(foreach p,$(2),
-               $$(call Image/Build/Profile/$p,$$(1))
-       )
-  endef
 endef
 
 LOADER_MAKE := $(NO_TRACE_MAKE) -C lzma-loader KDIR=$(KDIR)
@@ -308,10 +294,8 @@ r6100_mtdlayout=mtdparts=ar934x-nfc:128k(u-boot)ro,256k(caldata),256k(caldata-ba
 tew823dru_mtdlayout=mtdparts=spi0.0:192k(u-boot)ro,64k(nvram)ro,15296k(firmware),192k(lang)ro,512k(my-dlink)ro,64k(mac)ro,64k(art)ro
 wndr4300_mtdlayout=mtdparts=ar934x-nfc:256k(u-boot)ro,256k(u-boot-env)ro,256k(caldata),512k(pot),2048k(language),512k(config),3072k(traffic_meter),2048k(kernel),23552k(ubi),25600k@0x6c0000(firmware),256k(caldata_backup),-(reserved)
 zcn1523h_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,6208k(rootfs),1472k(kernel),64k(configure)ro,64k(mfg)ro,64k(art)ro,7680k@0x50000(firmware)
-mynet_n600_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,64k(devdata)ro,64k(devconf)ro,15872k(firmware),64k(radiocfg)ro
 mynet_rext_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,7808k(firmware),64k(nvram)ro,64k(ART)ro
 zyx_nbg6716_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(env)ro,64k(RFdata)ro,-(nbu);ar934x-nfc:2048k(zyxel_rfsd),2048k(romd),1024k(header),2048k(kernel),-(ubi)
-qihoo_c301_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env),64k(devdata),64k(devconf),15744k(firmware),64k(warm_start),64k(action_image_config),64k(radiocfg)ro;spi0.1:15360k(upgrade2),1024k(privatedata)
 yun_mtdlayout_8M=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,6464k(rootfs),1280k(kernel),64k(nvram),64k(art),7744k@0x50000(firmware)
 yun_mtdlayout_16M=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,14656k(rootfs),1280k(kernel),64k(nvram),64k(art),15936k@0x50000(firmware)
 wrtnode2q_mtdlayout=mtdparts=spi0.0:192k(u-boot),64k(u-boot-env),64k(art),1472k(kernel),14592k(rootfs),16064k@0x50000(firmware),16384k@0x0(fullflash)
@@ -325,7 +309,6 @@ define Image/BuildKernel
        $(call MkuImage,lzma,,$(KDIR)/vmlinux.bin.lzma,$(UIMAGE)-lzma.bin)
        cp $(KDIR)/loader-generic.elf $(VMLINUX)-lzma.elf
        -mkdir -p $(KDIR_TMP)
-       $(call Image/Build/Profile/$(IMAGE_PROFILE),buildkernel)
 endef
 
 define Image/BuildKernel/Initramfs
@@ -475,12 +458,12 @@ define Image/Build/CameoHornet
        $(call Sysupgrade/KRuImage,$(1),$(2),0,$$(($(fwsize)-4*64*1024)),64)
        if [ -e "$(call sysupname,$(1),$(2))" ]; then \
                for r in $(7); do \
-                       [ -n "$$$$r" ] && dashr="-$$$$r" || dashr=; \
-                       [ -z "$$$$r" ] && r="DEF"; \
-                       mkcameofw -M HORNET -R "$$$$r" -S $(5) -V $(6) -c \
+                       [ -n "$$r" ] && dashr="-$$r" || dashr=; \
+                       [ -z "$$r" ] && r="DEF"; \
+                       mkcameofw -M HORNET -R "$$r" -S $(5) -V $(6) -c \
                                -K $(8) -I $(fwsize) \
                                -k "$(call sysupname,$(1),$(2))" \
-                               -o $(call imgname,$(1),$(2))-factory$$$$dashr.bin; \
+                               -o $(call imgname,$(1),$(2))-factory$$dashr.bin; \
                        true; \
                done; \
        fi
@@ -655,39 +638,6 @@ define Image/Build/ALFA
 endef
 
 
-Image/Build/Seama/loader=$(call Image/BuildLoader,$(1),bin,$(2) $(3),0x80060000)
-
-define Image/Build/Seama
-       [ -e "$(KDIR)/loader-$(2).bin" ]
-       $(call CompressLzma,$(KDIR)/loader-$(2).bin,$(KDIR_TMP)/loader-$(2).bin.lzma)
-       -rm -f $(KDIR_TMP)/image-$(2).tmp
-       $(call CatFiles,$(KDIR_TMP)/loader-$(2).bin.lzma,$$(($(6) - 64)),$(KDIR)/root.$(1),$(7),$(KDIR_TMP)/image-$(2).tmp)
-       [ -e "$(KDIR_TMP)/image-$(2).tmp" ] && { \
-               head -c -4 "$(KDIR_TMP)/image-$(2).tmp" > "$(KDIR_TMP)/image-$(2).no-jffs2mark.tmp"; \
-               $(STAGING_DIR_HOST)/bin/seama \
-               -i $(KDIR_TMP)/image-$(2).no-jffs2mark.tmp \
-               -m "dev=/dev/mtdblock/1" -m "type=firmware"; \
-               $(STAGING_DIR_HOST)/bin/seama \
-                       -s $(call imgname,$(1),$(2))-factory.bin \
-                       -m "signature=$(5)" \
-                       -i $(KDIR_TMP)/image-$(2).no-jffs2mark.tmp.seama; \
-               tail -c 4 "$(KDIR_TMP)/image-$(2).tmp" >> $(call imgname,$(1),$(2))-factory.bin; \
-       }
-       cat $(KDIR_TMP)/loader-$(2).bin.lzma > $(KDIR_TMP)/image-$(2)-sysupgrade.tmp
-       $(STAGING_DIR_HOST)/bin/seama \
-               -i $(KDIR_TMP)/image-$(2)-sysupgrade.tmp \
-               -m "dev=/dev/mtdblock/1" -m "type=firmware"
-       $(call CatFiles,$(KDIR_TMP)/image-$(2)-sysupgrade.tmp.seama,$(6),$(KDIR)/root.$(1),$(7),$(call sysupname,$(1),$(2)))
-endef
-
-define Image/Build/Seama/initramfs
-       $(call PatchKernelLzma,$(2),$(3) $(4),,-initramfs)
-       $(STAGING_DIR_HOST)/bin/seama \
-               -i $(KDIR_TMP)/vmlinux-initramfs-$(2).bin.lzma \
-               -m "dev=/dev/mtdblock/1" -m "type=firmware"
-       cat $(KDIR_TMP)/vmlinux-initramfs-$(2).bin.lzma.seama > $(call imgname,initramfs,$(2))-seama.bin
-endef
-
 Image/Build/Senao/buildkernel=$(call MkuImageLzma,$(2),$(3) $(4))
 Image/Build/Senao/initramfs=$(call MkuImageLzma/initramfs,$(2),$(3) $(4))
 
@@ -761,11 +711,11 @@ define Image/Build/Netgear
        $(call CatFiles,$(KDIR_TMP)/vmlinux-$(2).uImage.squashfs,0,$(KDIR)/root.$(1),$(fwsize),$(call sysupname,$(1),$(2)),64)
        if [ -e $(call sysupname,$(1),$(2)) ]; then \
                for r in $(7) ; do \
-                       [ -n "$$$$r" ] && dashr="-$$$$r" || dashr= ; \
+                       [ -n "$$r" ] && dashr="-$$r" || dashr= ; \
                        $(STAGING_DIR_HOST)/bin/mkdniimg \
-                               -B $(6) -v OpenWrt.$(REVISION) -r "$$$$r" $(8) \
+                               -B $(6) -v OpenWrt.$(REVISION) -r "$$r" $(8) \
                                -i $(call sysupname,$(1),$(2)) \
-                               -o $(call imgname,$(1),$(2))-factory$$$$dashr.img; \
+                               -o $(call imgname,$(1),$(2))-factory$$dashr.img; \
                done; \
        fi
 endef
@@ -792,7 +742,7 @@ define Image/Build/NetgearNAND/buildkernel
        $(call PatchKernelLzma,$(2),$(3) $(4),-d20)
        dd if=$(KDIR_TMP)/vmlinux-$(2).bin.lzma \
                of=$(KDIR_TMP)/vmlinux-$(2).bin.tmp \
-               bs=$$$$(($(kernelsize)-131072-2*64-1)) \
+               bs=$$(($(kernelsize)-131072-2*64-1)) \
                count=1 conv=sync
        $(call MkuImage,lzma,-M $(5),$(KDIR_TMP)/vmlinux-$(2).bin.tmp,$(KDIR_TMP)/vmlinux-$(2).uImage)
        echo -ne '\xff' >> $(KDIR_TMP)/vmlinux-$(2).uImage
@@ -831,7 +781,7 @@ define Image/Build/NetgearNAND
                dd if=$(KDIR_TMP)/$(2)-root.ubi \
        ) > $(imageraw)
        $(STAGING_DIR_HOST)/bin/mkdniimg \
-               -B $(6) -v OpenWrt.$(REVISION) -r "$$$$r" $(8) \
+               -B $(6) -v OpenWrt.$(REVISION) -r "$$r" $(8) \
                -i $(imageraw) \
                -o $(call imgname,ubi,$(2))-factory.img
 
@@ -866,7 +816,7 @@ define      Image/Build/ZyXELNAND/buildkernel
                --pad=$(kernelsize) --big-endian --squash-uids -v -e 128KiB \
                -o $(KDIR_TMP)/$(2)-kernel.jffs2 \
                -d $(KDIR_TMP)/$(2)/image \
-               2>&1 1>/dev/null | awk '/^.+$$$$/'
+               2>&1 1>/dev/null | awk '/^.+$$/'
        -rm -rf $(KDIR_TMP)/$(2)
 endef
 
@@ -1097,11 +1047,6 @@ $(eval $(call SingleProfile,PB4X,64k,PB44,pb44,PB44,ttyS0,115200))
 $(eval $(call SingleProfile,Planex,64kraw,MZKW04NU,mzk-w04nu,MZK-W04NU,ttyS0,115200))
 $(eval $(call SingleProfile,Planex,64kraw,MZKW300NH,mzk-w300nh,MZK-W300NH,ttyS0,115200))
 
-$(eval $(call SingleProfile,Seama,64k,MYNETN600,mynet-n600,MYNET-N600,ttyS0,115200,$$(mynet_n600_mtdlayout),wrgnd16_wd_db600,65536,16187392))
-$(eval $(call SingleProfile,Seama,64k,MYNETN750,mynet-n750,MYNET-N750,ttyS0,115200,$$(mynet_n600_mtdlayout),wrgnd13_wd_av,65536,16187392))
-
-$(eval $(call SingleProfile,Seama,64k,QIHOO360,qihoo-c301,QIHOO-C301,ttyS0,115200,$$(qihoo_c301_mtdlayout),wrgac26_qihoo360_360rg,65536,16121856))
-
 $(eval $(call SingleProfile,Senao,squashfs-only,EAP300V2,eap300v2,EAP300V2,ttyS0,115200,$$(eap300v2_mtdlayout)))
 
 $(eval $(call SingleProfile,WHRHPG300N,64kraw,WHRG301N,whr-g301n,WHR-G301N,ttyS0,115200,$$(whrhpg300n_mtdlayout),WHR-G301N))
@@ -1123,35 +1068,6 @@ $(eval $(call SingleProfile,Zcomax,64k,ZCN1523H516,zcn-1523h-5-16,ZCN-1523H-5,tt
 
 $(eval $(call SingleProfile,ZyXEL,64k,NBG_460N_550N_550NH,nbg460n_550n_550nh,NBG460N,ttyS0,115200,NBG-460N))
 
-$(eval $(call MultiProfile,AP121,AP121_2M AP121_4M AP121_8M AP121_16M))
-$(eval $(call MultiProfile,AP136,AP136_010 AP136_020))
-$(eval $(call MultiProfile,AP143,AP143_8M AP143_16M))
-$(eval $(call MultiProfile,AP147,AP147_010))
-$(eval $(call MultiProfile,AP152,AP152_16M))
-$(eval $(call MultiProfile,DIR615IX,DIR615I1 DIR615I3))
-$(eval $(call MultiProfile,EWDORIN, EWDORINAP EWDORINRT EWDORIN16M))
-$(eval $(call MultiProfile,OPENMESH,OM2P OM5P OM5PAC MR600 MR900 MR1750))
-$(eval $(call MultiProfile,TEW652BRP,TEW652BRP_FW TEW652BRP_RECOVERY))
-$(eval $(call MultiProfile,TUBE2H,TUBE2H8M TUBE2H16M))
-$(eval $(call MultiProfile,WNR612V2,REALWNR612V2 N150R))
-$(eval $(call MultiProfile,WNR1000V2,REALWNR1000V2 WNR1000V2_VC))
-$(eval $(call MultiProfile,WP543,WP543_2M WP543_4M WP543_8M WP543_16M))
-$(eval $(call MultiProfile,WPE72,WPE72_4M WPE72_8M WPE72_16M))
-$(eval $(call MultiProfile,WPJ342,WPJ342_16M))
-$(eval $(call MultiProfile,WPJ344,WPJ344_16M))
-$(eval $(call MultiProfile,WPJ531,WPJ531_16M))
-$(eval $(call MultiProfile,WPJ558,WPJ558_16M))
-$(eval $(call MultiProfile,Yun,YUN_16M YUN_8M))
-
-$(eval $(call MultiProfile,Minimal,$(SINGLE_PROFILES)))
-$(eval $(call MultiProfile,Madwifi,EAP7660D WP543))
-
-define LegacyDevice/OM2P
-  DEVICE_TITLE := OpenMesh OM2P/OM2Pv2/OM2P-HS/OM2P-HSv2/OM2P-HSv3/OM2P-LC
-  DEVICE_PACKAGES := kmod-ath9k om-watchdog
-endef
-LEGACY_DEVICES += OM2P
-
 endif # ifeq ($(SUBTARGET),generic)
 
 ifeq ($(SUBTARGET),nand)
@@ -1162,12 +1078,8 @@ $(eval $(call SingleProfile,NetgearNAND,64k,R6100,r6100,R6100,ttyS0,115200,$$(r6
 
 $(eval $(call SingleProfile,ZyXELNAND,128k,NBG6716,nbg6716,NBG6716,ttyS0,115200,NBG6716,$$(zyx_nbg6716_mtdlayout),mem=256M))
 
-$(eval $(call MultiProfile,WNDR4300,WNDR3700V4 WNDR4300V1))
-
 endif # ifeq ($(SUBTARGET),nand)
 
-$(eval $(call MultiProfile,Default,$(SINGLE_PROFILES)))
-
 define Image/Build/squashfs
        cp $(KDIR)/root.squashfs $(KDIR)/root.squashfs-raw
        cp $(KDIR)/root.squashfs $(KDIR)/root.squashfs-64k
@@ -1181,10 +1093,6 @@ define Image/Build/jffs2
        dd if=$(KDIR)/root.$(1) of=$(BIN_DIR)/$(IMG_PREFIX)-root.$(1) bs=128k conv=sync
 endef
 
-define Image/Build/Initramfs
-       $(call Image/Build/Profile/$(IMAGE_PROFILE),initramfs)
-endef
-
 define Image/Prepare
        gzip -9n -c $(KDIR)/vmlinux > $(KDIR)/vmlinux.bin.gz
        $(call CompressLzma,$(KDIR)/vmlinux,$(KDIR)/vmlinux.bin.lzma)
@@ -1194,7 +1102,6 @@ ifneq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),)
        $(call Image/BuildLoader,generic,elf,,,-initramfs)
 endif
        $(call Image/BuildLoader,generic,elf)
-       $(call Image/Build/Profile/$(if $(CONFIG_IB),Default,$(IMAGE_PROFILE)),loader)
 endef
 
 define Image/Prepare/Profile
@@ -1203,5 +1110,11 @@ endef
 
 define Image/Build/Profile
        $(call Image/Build/Profile/$(1),buildkernel)
+       $(if $(CONFIG_TARGET_ROOTFS_INITRAMFS),$(call Image/Build/Profile/$(1),initramfs))
        $(call Image/Build/Profile/$(1),$(2))
 endef
+
+# $(1): filesystem type.
+define Image/Build
+       $(call Image/Build/$(call rootfs_type,$(1)),$(1))
+endef