On 11/01/16 08:35 AM, Felix Fietkau wrote:
Signed-off-by: Daniel Dickinson <open...@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
I like the idea of allowing the user to select multiple profiles.
However, there also needs to be a clean and simple way to select a
single profile without going through the list and deselecting everything.
Actually, while it would need to be extended to other platforms, on
ar71xx that is exactly what Minimal does. In fact, assuming your on the
first run of menuconfig (i.e. the only time defaults work, due to the
way KConfig works; this is also a problem for ALL_KMODS and ALL (that
de-selecting all kmods and for de-selecting all packages), if you
deselect Default, all the items selected will become unselected.
It is not possible with KConfig to have an *existing* .config and have
an option that causes deselection of selected items, that does not also
force deselection without the option to override (e.g. depends on
!MINIMAL won't work because it would force the item to off without
option to override).
If you have some clever way to avoid this problem, I'd love to hear it,
because I don't know how to do it in KConfig. I don't see how to allow
an *overridable* deselection of *all* items, unless perhaps one could
introduce a new submenu that is a choice section (I'd have to test to
see if that would actually work, or if duplicate symbols would be a
problem).
Regards,
Daniel
Also, I don't like hardcoded profile names in metadata.pl, a better
approach would be to have a flag as part of a profile that indicates
that it's not a device profile.
- Felix
_______________________________________________
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel