[OpenWrt-Devel] [PATCH 2/8] ar71xx: Enable mult-profile select

openwrt at daniel.thecshore.com openwrt at daniel.thecshore.com
Wed Jan 20 13:20:03 EST 2016


From: Daniel Dickinson <openwrt at daniel.thecshore.com>

ar71xx has a large number of images, which makes it especially helpful
to get building a selection of a subset of images working for this target,
therefore this patches enables the multi-profile select capability from
the previous patch for ar71xx.

Signed-off-by: Daniel Dickinson <openwrt at daniel.thecshore.com>
---
 target/linux/ar71xx/generic/profiles/00-default.mk |  5 ++++-
 target/linux/ar71xx/generic/profiles/01-minimal.mk |  4 +++-
 target/linux/ar71xx/generic/profiles/03-unified.mk | 16 ++++++++++++++++
 target/linux/ar71xx/generic/target.mk              |  2 ++
 target/linux/ar71xx/image/Makefile                 | 16 ++++++++--------
 target/linux/ar71xx/mikrotik/target.mk             |  2 ++
 target/linux/ar71xx/nand/target.mk                 |  2 ++
 7 files changed, 37 insertions(+), 10 deletions(-)
 create mode 100644 target/linux/ar71xx/generic/profiles/03-unified.mk

diff --git a/target/linux/ar71xx/generic/profiles/00-default.mk b/target/linux/ar71xx/generic/profiles/00-default.mk
index 5af2e0f..a02ba55 100644
--- a/target/linux/ar71xx/generic/profiles/00-default.mk
+++ b/target/linux/ar71xx/generic/profiles/00-default.mk
@@ -7,9 +7,12 @@
 
 define Profile/Default
 	NAME:=Default Profile (all drivers)
+	PROFILE_TYPE:=meta
+	PROFILE_DEFAULT:=1
+	PROFILE_IMAGES_TYPE:=all
 endef
 
 define Profile/Default/Description
-	Default package set compatible with most boards.
+	Builds all images for target with the default package set (compatible with most boards)
 endef
 $(eval $(call Profile,Default))
diff --git a/target/linux/ar71xx/generic/profiles/01-minimal.mk b/target/linux/ar71xx/generic/profiles/01-minimal.mk
index dfaa3b0..c2d4db4 100644
--- a/target/linux/ar71xx/generic/profiles/01-minimal.mk
+++ b/target/linux/ar71xx/generic/profiles/01-minimal.mk
@@ -8,9 +8,11 @@
 define Profile/Minimal
 	NAME:=Minimal Profile (no drivers)
 	PACKAGES:=-kmod-ath9k -wpad-mini
+	PROFILE_TYPE:=minimal
+	PROFILE_IMAGES_TYPE:=all
 endef
 
 define Profile/Minimal/Description
-	Minimal package set compatible with most boards.
+	Build all images for target with minimal package set compatible with most boards.
 endef
 $(eval $(call Profile,Minimal))
diff --git a/target/linux/ar71xx/generic/profiles/03-unified.mk b/target/linux/ar71xx/generic/profiles/03-unified.mk
new file mode 100644
index 0000000..ba7fc4b
--- /dev/null
+++ b/target/linux/ar71xx/generic/profiles/03-unified.mk
@@ -0,0 +1,16 @@
+#
+# Copyright (C) 2009 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+define Profile/Unified
+	NAME:=Unified Profile (merge of all selected profiles)
+	PROFILE_TYPE:=unified
+endef
+
+define Profile/Unified/Description
+	Builds all selected images for target with the the merged result of all selected profiles
+endef
+$(eval $(call Profile,Unified))
diff --git a/target/linux/ar71xx/generic/target.mk b/target/linux/ar71xx/generic/target.mk
index 64eb205..e280e59 100644
--- a/target/linux/ar71xx/generic/target.mk
+++ b/target/linux/ar71xx/generic/target.mk
@@ -1,6 +1,8 @@
 BOARDNAME:=Generic
 FEATURES += squashfs
 
+TARGET_MULTI_SELECT:=1
+
 define Target/Description
 	Build firmware images for generic Atheros AR71xx/AR913x/AR934x based boards.
 endef
diff --git a/target/linux/ar71xx/image/Makefile b/target/linux/ar71xx/image/Makefile
index 6483284..446f2f2 100644
--- a/target/linux/ar71xx/image/Makefile
+++ b/target/linux/ar71xx/image/Makefile
@@ -10,8 +10,6 @@ JFFS2_BLOCKSIZE = 64k 128k 256k
 include $(TOPDIR)/rules.mk
 include $(INCLUDE_DIR)/image.mk
 
-IMAGE_PROFILE:=$(if $(PROFILE),$(PROFILE),Default)
-
 KERNEL_LOADADDR = 0x80060000
 
 DEVICE_VARS += NETGEAR_KERNEL_MAGIC NETGEAR_BOARD_ID NETGEAR_HW_ID CMDLINE CONSOLE IMAGE_SIZE BOARDNAME LOADER_FLASH_OFFS
@@ -1299,6 +1297,10 @@ define SingleProfile
   SINGLE_PROFILES += $(3)
 endef
 
+define Image/Build/Profile/Unified
+	true
+endef
+
 # $(1), name of the MultiProfile to be added.
 # $(2), name of Profiles to be included in the MultiProfile.
 define MultiProfile
@@ -1590,7 +1592,6 @@ qihoo_c301_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env),64k(devdata)
 yun_mtdlayout_8M=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,6464k(rootfs),1280k(kernel),64k(nvram),64k(art),7744k at 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 at 0x50000(firmware)
 
-
 define Image/BuildKernel
 	cp $(KDIR)/vmlinux.elf $(VMLINUX).elf
 	cp $(KDIR)/vmlinux $(VMLINUX).bin
@@ -1600,7 +1601,7 @@ 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)
+	$(foreach profile,$(PROFILES_BUILD),$(call Image/Build/Profile/$(profile),buildkernel))
 endef
 
 define Image/BuildKernel/Initramfs
@@ -2529,7 +2530,6 @@ $(eval $(call SingleProfile,ZyXELNAND,128k,NBG6716,nbg6716,NBG6716,ttyS0,115200,
 $(eval $(call MultiProfile,WNDR4300,WNDR3700V4 WNDR4300V1))
 endif # ifeq ($(SUBTARGET),nand)
 
-
 $(eval $(call MultiProfile,Default,$(SINGLE_PROFILES)))
 
 define Image/Build/squashfs
@@ -2546,7 +2546,7 @@ define Image/Build/jffs2
 endef
 
 define Image/Build/Initramfs
-	$(call Image/Build/Profile/$(IMAGE_PROFILE),initramfs)
+	$(foreach profile,$(PROFILES_BUILD),$(call Image/Build/Profile/$(profile)),initramfs)
 endef
 
 define Image/Prepare
@@ -2558,13 +2558,13 @@ 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)
+	$(if $(CONFIG_IB),$(call Image/Build/Profile/Default,loader),$(foreach profile,$(PROFILES_BUILD),$(call Image/Build/Profile/$(profile),loader)))
 endef
 
 # $(1): filesystem type.
 define Image/Build
 	$(call Image/Build/$(call rootfs_type,$(1)),$(1))
-	$(call Image/Build/Profile/$(IMAGE_PROFILE),$(1))
+	$(foreach profile,$(PROFILES_BUILD),$(call Image/Build/Profile/$(profile),$(1)))
 endef
 
 $(eval $(call BuildImage))
diff --git a/target/linux/ar71xx/mikrotik/target.mk b/target/linux/ar71xx/mikrotik/target.mk
index b2fb0df..50cbb3b 100644
--- a/target/linux/ar71xx/mikrotik/target.mk
+++ b/target/linux/ar71xx/mikrotik/target.mk
@@ -1,6 +1,8 @@
 BOARDNAME:=Mikrotik devices with NAND flash
 FEATURES += targz ramdisk
 
+TARGET_MULTI_SELECT:=0
+
 define Target/Description
 	Build firmware images for Atheros AR71xx/AR913x based Mikrotik boards.
 	e.g. MikroTik RB-4xx or RB-750
diff --git a/target/linux/ar71xx/nand/target.mk b/target/linux/ar71xx/nand/target.mk
index 7532ec6..da775df 100644
--- a/target/linux/ar71xx/nand/target.mk
+++ b/target/linux/ar71xx/nand/target.mk
@@ -1,6 +1,8 @@
 BOARDNAME := Generic devices with NAND flash
 FEATURES += squashfs nand rtc
 
+TARGET_MULTI_SELECT:=0
+
 define Target/Description
 	Build firmware images for Atheros AR71xx/AR913x based boards with
 	NAND flash, e.g. Netgear WNDR4300.
-- 
2.4.3
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel



More information about the openwrt-devel mailing list