2014-03-11 02:58:49 +08:00
|
|
|
#!/usr/bin/env perl
|
|
|
|
use strict;
|
|
|
|
|
|
|
|
while (<>) {
|
2016-05-11 06:26:42 +08:00
|
|
|
my $match;
|
|
|
|
my $var;
|
|
|
|
my $val;
|
|
|
|
my $type;
|
2014-03-11 02:58:49 +08:00
|
|
|
chomp;
|
2015-04-25 20:39:02 +08:00
|
|
|
next if /^CONFIG_SIGNED_PACKAGES/;
|
2014-03-11 02:58:49 +08:00
|
|
|
|
2016-05-11 06:26:42 +08:00
|
|
|
if (/^CONFIG_([^=]+)=(.*)$/) {
|
|
|
|
$var = $1;
|
|
|
|
$val = $2;
|
2014-03-11 02:58:49 +08:00
|
|
|
|
2016-05-11 06:26:42 +08:00
|
|
|
next if $var eq 'ALL';
|
2014-03-13 20:12:58 +08:00
|
|
|
|
2016-05-11 06:26:42 +08:00
|
|
|
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';
|
2014-03-11 02:58:49 +08:00
|
|
|
$type = "bool";
|
|
|
|
} else {
|
2016-05-11 06:26:42 +08:00
|
|
|
# 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";
|
|
|
|
}
|
2014-03-11 02:58:49 +08:00
|
|
|
}
|
|
|
|
|
2016-05-11 06:26:42 +08:00
|
|
|
if (($var ne '') && ($type ne '') && ($val ne '')) {
|
|
|
|
print <<EOF;
|
2014-03-11 02:58:49 +08:00
|
|
|
config $var
|
|
|
|
$type
|
|
|
|
default $val
|
|
|
|
|
|
|
|
EOF
|
2016-05-11 06:26:42 +08:00
|
|
|
}
|
2014-03-11 02:58:49 +08:00
|
|
|
}
|