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>
This commit is contained in:
		 Daniel Dickinson
					Daniel Dickinson
				
			
				
					committed by
					
						 Jo-Philipp Wich
						Jo-Philipp Wich
					
				
			
			
				
	
			
			
			 Jo-Philipp Wich
						Jo-Philipp Wich
					
				
			
						parent
						
							5d60bedcb3
						
					
				
				
					commit
					9da1bf58b6
				
			| @@ -2,13 +2,16 @@ | |||||||
| use strict; | use strict; | ||||||
|  |  | ||||||
| while (<>) { | while (<>) { | ||||||
|  | 	my $match; | ||||||
|  | 	my $var; | ||||||
|  | 	my $val; | ||||||
|  | 	my $type; | ||||||
| 	chomp; | 	chomp; | ||||||
| 	next if /^CONFIG_SIGNED_PACKAGES/; | 	next if /^CONFIG_SIGNED_PACKAGES/; | ||||||
| 	next unless /^CONFIG_([^=]+)=(.*)$/; |  | ||||||
|  |  | ||||||
| 	my $var = $1; | 	if (/^CONFIG_([^=]+)=(.*)$/) { | ||||||
| 	my $val = $2; | 		$var = $1; | ||||||
| 	my $type; | 		$val = $2; | ||||||
|  |  | ||||||
| 		next if $var eq 'ALL'; | 		next if $var eq 'ALL'; | ||||||
|  |  | ||||||
| @@ -24,11 +27,33 @@ while (<>) { | |||||||
| 			warn "WARNING: no type found for symbol CONFIG_$var=$val\n"; | 			warn "WARNING: no type found for symbol CONFIG_$var=$val\n"; | ||||||
| 			next; | 			next; | ||||||
| 		} | 		} | ||||||
|  | 	} elsif (/^# CONFIG_BUSYBOX_(.*) is not set/) { | ||||||
|  | 		$var = "BUSYBOX_$1"; | ||||||
|  | 		$val = 'n'; | ||||||
|  | 		$type = "bool"; | ||||||
|  | 	} else { | ||||||
|  | 		# 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"; | ||||||
|  |                 } | ||||||
|  | 	} | ||||||
|  |  | ||||||
|  | 	if (($var ne '') && ($type ne '') && ($val ne '')) { | ||||||
| 		print <<EOF; | 		print <<EOF; | ||||||
| config $var | config $var | ||||||
| 	$type | 	$type | ||||||
| 	default $val | 	default $val | ||||||
|  |  | ||||||
| EOF | EOF | ||||||
|  | 	} | ||||||
| } | } | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user