X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=target%2Fsdk%2Fconvert-config.pl;h=f73744af099d2966b1ecacca35483c72b90ec7c6;hb=5cda133d99f25ac85fcc4ef9ae092f9c4fb90739;hp=e701b42eb93af249a3c59c0d12235806b1e82e51;hpb=d2e02d6377657855056c8d71dfb3cfe62371774c;p=oweals%2Fopenwrt.git diff --git a/target/sdk/convert-config.pl b/target/sdk/convert-config.pl index e701b42eb9..f73744af09 100755 --- a/target/sdk/convert-config.pl +++ b/target/sdk/convert-config.pl @@ -1,41 +1,59 @@ #!/usr/bin/env perl use strict; -print <) { + 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; - - next if $var eq 'ALL'; - - if ($val eq 'y') { + if (/^CONFIG_([^=]+)=(.*)$/) { + $var = $1; + $val = $2; + + next if $var eq 'ALL'; + + 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 <