aboutsummaryrefslogtreecommitdiffstats
path: root/target/sdk
diff options
context:
space:
mode:
authorDaniel Dickinson <lede@daniel.thecshore.com>2016-05-10 18:26:42 -0400
committerJo-Philipp Wich <jo@mein.io>2016-06-21 13:36:23 +0200
commit9da1bf58b68d841e8f0ebb9350c8202500bb03a7 (patch)
tree423d11655f537bcd4ea77e4e5a9adee4e67ea3f8 /target/sdk
parent5d60bedcb3b485a2b2bd7d8c8da24dfd1b3c4f7f (diff)
downloadupstream-9da1bf58b68d841e8f0ebb9350c8202500bb03a7.tar.gz
upstream-9da1bf58b68d841e8f0ebb9350c8202500bb03a7.tar.bz2
upstream-9da1bf58b68d841e8f0ebb9350c8202500bb03a7.zip
sdk: Fix keeping unset as unset
The configuration preservation mechanism fails to keep items was are unset as unset. For busybox this causes issues when building with custom settings in the SDK. Therefore preserve busybox unset settings. In addition we preserve non-package selection unset settings because they may be important for making sure we compile and identical package for packages that are recompiled in the SDK. Now that SDK not longer ships .config this becomes relevant for any use of the SDK. Signed-off-by: Daniel Dickinson <lede@daniel.thecshore.com>
Diffstat (limited to 'target/sdk')
-rwxr-xr-xtarget/sdk/convert-config.pl55
1 files changed, 40 insertions, 15 deletions
diff --git a/target/sdk/convert-config.pl b/target/sdk/convert-config.pl
index 0e562f9558..f73744af09 100755
--- a/target/sdk/convert-config.pl
+++ b/target/sdk/convert-config.pl
@@ -2,33 +2,58 @@
use strict;
while (<>) {
+ my $match;
+ my $var;
+ my $val;
+ my $type;
chomp;
next if /^CONFIG_SIGNED_PACKAGES/;
- next unless /^CONFIG_([^=]+)=(.*)$/;
- my $var = $1;
- my $val = $2;
- my $type;
+ if (/^CONFIG_([^=]+)=(.*)$/) {
+ $var = $1;
+ $val = $2;
- next if $var eq 'ALL';
+ next if $var eq 'ALL';
- if ($val eq 'y') {
+ if ($val eq 'y') {
+ $type = "bool";
+ } elsif ($val eq 'm') {
+ $type = "tristate";
+ } elsif ($val =~ /^".*"$/) {
+ $type = "string";
+ } elsif ($val =~ /^\d+$/) {
+ $type = "int";
+ } else {
+ warn "WARNING: no type found for symbol CONFIG_$var=$val\n";
+ next;
+ }
+ } elsif (/^# CONFIG_BUSYBOX_(.*) is not set/) {
+ $var = "BUSYBOX_$1";
+ $val = 'n';
$type = "bool";
- } elsif ($val eq 'm') {
- $type = "tristate";
- } elsif ($val =~ /^".*"$/) {
- $type = "string";
- } elsif ($val =~ /^\d+$/) {
- $type = "int";
} else {
- warn "WARNING: no type found for symbol CONFIG_$var=$val\n";
- next;
+ # We don't want to preserve a record of deselecting
+ # packages because we may want build them in the SDK.
+ # non-package configs however may be important to preserve
+ # the same compilation settings for packages that get
+ # recompiled in the SDK.
+ # Also we want avoid preserving image generation settings
+ # because we set those while in ImageBuilder
+ next if /^(# )?CONFIG_PACKAGE/;
+ next if /^(# )?CONFIG_TARGET/;
+ if (/^# CONFIG_(.*) is not set/) {
+ $var = $1;
+ $val = 'n';
+ $type = "bool";
+ }
}
- print <<EOF;
+ if (($var ne '') && ($type ne '') && ($val ne '')) {
+ print <<EOF;
config $var
$type
default $val
EOF
+ }
}