[OpenWrt-Devel] [PATCH] scripts/metadata: Allow to select which profiles to build

openwrt at daniel.thecshore.com openwrt at daniel.thecshore.com
Mon Jan 11 00:16:00 EST 2016


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

Certain platforms have large numbers of possible images, and it can be
desirable to build neither all images nor only a single image,
therefore this patch makes selecting target profiles a menu instead of a
single choice, which allows the user to build a specific subset of all
possible images for a target.

Signed-off-by: Daniel Dickinson <openwrt at daniel.thecshore.com>
---
 scripts/metadata.pl | 32 +++++++++++++++++++++++++++++---
 1 file changed, 29 insertions(+), 3 deletions(-)

diff --git a/scripts/metadata.pl b/scripts/metadata.pl
index 48b1b7a..4487d26 100755
--- a/scripts/metadata.pl
+++ b/scripts/metadata.pl
@@ -275,8 +275,7 @@ EOF
 print <<EOF;
 endchoice
 
-choice
-	prompt "Target Profile"
+menu "Target Profile"
 
 EOF
 
@@ -288,8 +287,35 @@ EOF
 config TARGET_$target->{conf}_$profile->{id}
 	bool "$profile->{name}"
 	depends on TARGET_$target->{conf}
+EOF
+
+			if (not (($profile->{id} eq 'Default') || ($profile->{id} eq 'Minimal'))) {
+				print <<EOF;
+	default y if TARGET_$target->{conf}_Default
+	default n if TARGET_$target->{conf}_Minimal
+EOF
+
+
+			}
+			if ($profile->{id} eq 'Default') {
+				print <<EOF;
+	depends on !TARGET_$target->{conf}_Minimal
+	default y
+EOF
+
+			}
+
+			if ($profile->{id} eq 'Minimal') {
+				print <<EOF;
+	default n
+EOF
+
+			}
+
+			print <<EOF;
 $profile->{config}
 EOF
+
 			$profile->{kconfig} and print "\tselect PROFILE_KCONFIG\n";
 			my @pkglist = merge_package_lists($target->{packages}, $profile->{packages});
 			foreach my $pkg (@pkglist) {
@@ -308,7 +334,7 @@ EOF
 	}
 
 	print <<EOF;
-endchoice
+endmenu
 
 config HAS_SUBTARGETS
 	bool
-- 
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