[PATCH 1/2] UBUNTU: merge kernel configs more agressivly

Andy Whitcroft apw at canonical.com
Tue Jun 16 15:31:01 UTC 2009


When we build configs from the split configs for update, edit, or for a
build we merge the various component parts and then run 'make oldconfig'
over that merged configuration.  The config system understands which
options are valid and ignores any attempt to set the value of any option
which is invalid in this configuration.  This means that actually we can
safely merge options up where the other merge candidates have no value
at all.  This allows values to propogate further up the tree while
maintaining the same resulting configurations.

Modify splitconfig.pl to consider matching a value with no value as valid.
Where the value is unmergable we must temporarily mark the intermediate
levels so to prevent further merging.  Modify kernelconfig to drop these
hints in the final results.

Signed-off-by: Andy Whitcroft <apw at canonical.com>
---
 debian/scripts/misc/kernelconfig   |   14 ++++++++------
 debian/scripts/misc/splitconfig.pl |   21 +++++++++++----------
 2 files changed, 19 insertions(+), 16 deletions(-)

diff --git a/debian/scripts/misc/kernelconfig b/debian/scripts/misc/kernelconfig
index cf1cede..fe51bde 100755
--- a/debian/scripts/misc/kernelconfig
+++ b/debian/scripts/misc/kernelconfig
@@ -102,10 +102,12 @@ rm -f $common_conf
 # Now run splitconfig.pl on all the config.common.<arch> copied to
 # $tmpdir
 (cd $tmpdir; $bindir/splitconfig.pl)
-(cd $kerneldir/$confdir; mv $tmpdir/config.common \
-	$kerneldir/$confdir/config.common.ubuntu; \
-for arch in $archs; do \
-	mv $tmpdir/config.common.$arch $arch/config.common.$arch; \
-done; \
+(
+	cd $kerneldir/$confdir;
+	grep -v 'is UNMERGABLE' <$tmpdir/config.common \
+		>$kerneldir/$confdir/config.common.ubuntu
+	for arch in $archs; do
+		grep -v 'is UNMERGABLE' <$tmpdir/config.common.$arch \
+			>$arch/config.common.$arch
+	done
 )
-
diff --git a/debian/scripts/misc/splitconfig.pl b/debian/scripts/misc/splitconfig.pl
index 8c189dc..3dca468 100755
--- a/debian/scripts/misc/splitconfig.pl
+++ b/debian/scripts/misc/splitconfig.pl
@@ -50,11 +50,12 @@ for $config (keys(%allconfigs)) {
 
 		# If we don't have the common option, then it isn't
 		# common. If we do have that option, it must have the same
-		# value (this is where the old split.py was broken). It
-		# also did the common check while it was parsing files, so
-		# that there were cases where a non-common option was in
-		# common anyway (ordering).
-		if (not defined($options{$key})) {
+		# value.  EXCEPT where this file does not have a value at all
+		# which may safely be merged with any other value; the value
+		# will be elided during recombination of the parts.
+		if (!defined($options{$key})) {
+			# Its ok really ... let it merge
+		} elsif (not defined($options{$key})) {
 			undef $common{$key};
 		} elsif ($common{$key} ne $options{$key}) {
 			undef $common{$key};
@@ -72,9 +73,9 @@ open(COMMON, "> config.common");
 print COMMON "#\n# Common config options automatically generated by splitconfig.pl\n#\n";
 
 for $key (sort(keys(%common))) {
-	next if not defined $common{$key};
-
-	if ($common{$key} eq "is not set") {
+	if (not defined $common{$key}) {
+		print COMMON "# CONFIG_$key is UNMERGABLE\n";
+	} elsif ($common{$key} eq "is not set") {
 		print COMMON "# CONFIG_$key is not set\n";
 	} else {
 		print COMMON "CONFIG_$key=$common{$key}\n";
@@ -97,8 +98,8 @@ for $config (keys(%allconfigs)) {
 	for $key (sort(keys(%options))) {
 		next if defined $common{$key};
 
-		if ($options{$key} eq "is not set") {
-			print STUB "# CONFIG_$key is not set\n";
+		if ($options{$key} =~ /^is /) {
+			print STUB "# CONFIG_$key $options{$key}\n";
 		} else {
 			print STUB "CONFIG_$key=$options{$key}\n";
 		}
-- 
1.6.3.rc3.199.g24398





More information about the kernel-team mailing list