linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [for-next][PATCH 0/6] localmodconfig: Updates for 4.7
@ 2016-04-26 22:44 Steven Rostedt
  2016-04-26 22:44 ` [for-next][PATCH 1/6] localmodconfig: Fix parsing of Kconfig "source" statements Steven Rostedt
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: Steven Rostedt @ 2016-04-26 22:44 UTC (permalink / raw)
  To: linux-kernel; +Cc: Andrew Morton

  git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-kconfig.git
for-next

Head SHA1: 5bcba792bb304e8341217d759ec486969a3b4258


Benjamin Poirier (6):
      localmodconfig: Fix parsing of Kconfig "source" statements
      localmodconfig: Recognize more keywords that end a menu entry
      localmodconfig: Fix parsing of "help" text
      localmodconfig: Add missing $ to reference a variable
      localmodconfig: Reset certificate paths
      localmodconfig: Fix whitespace repeat count after "tristate"

----
 scripts/kconfig/streamline_config.pl | 44 ++++++++++++++++++++++++++++++++----
 1 file changed, 39 insertions(+), 5 deletions(-)

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [for-next][PATCH 1/6] localmodconfig: Fix parsing of Kconfig "source" statements
  2016-04-26 22:44 [for-next][PATCH 0/6] localmodconfig: Updates for 4.7 Steven Rostedt
@ 2016-04-26 22:44 ` Steven Rostedt
  2016-04-26 22:44 ` [for-next][PATCH 2/6] localmodconfig: Recognize more keywords that end a menu entry Steven Rostedt
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Steven Rostedt @ 2016-04-26 22:44 UTC (permalink / raw)
  To: linux-kernel; +Cc: Andrew Morton, Lee, Chun-Yi, Benjamin Poirier

[-- Attachment #1: 0001-localmodconfig-Fix-parsing-of-Kconfig-source-stateme.patch --]
[-- Type: text/plain, Size: 1055 bytes --]

From: Benjamin Poirier <bpoirier@suse.com>

The parameter of Kconfig "source" statements does not need to be quoted.
The current regex causes many kconfig files to be skipped and hence,
dependencies to be missed.

Also fix the whitespace repeat count.

Link: http://lkml.kernel.org/r/1459619722-13695-1-git-send-email-bpoirier@suse.com

Tested-by: Lee, Chun-Yi <jlee@suse.com>
Signed-off-by: Benjamin Poirier <bpoirier@suse.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 scripts/kconfig/streamline_config.pl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/kconfig/streamline_config.pl b/scripts/kconfig/streamline_config.pl
index f3d3fb42b873..7036ae306db6 100755
--- a/scripts/kconfig/streamline_config.pl
+++ b/scripts/kconfig/streamline_config.pl
@@ -188,7 +188,7 @@ sub read_kconfig {
 	$cont = 0;
 
 	# collect any Kconfig sources
-	if (/^source\s*"(.*)"/) {
+	if (/^source\s+"?([^"]+)/) {
 	    my $kconfig = $1;
 	    # prevent reading twice.
 	    if (!defined($read_kconfigs{$kconfig})) {
-- 
2.8.0.rc3

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [for-next][PATCH 2/6] localmodconfig: Recognize more keywords that end a menu entry
  2016-04-26 22:44 [for-next][PATCH 0/6] localmodconfig: Updates for 4.7 Steven Rostedt
  2016-04-26 22:44 ` [for-next][PATCH 1/6] localmodconfig: Fix parsing of Kconfig "source" statements Steven Rostedt
@ 2016-04-26 22:44 ` Steven Rostedt
  2016-04-26 22:44 ` [for-next][PATCH 3/6] localmodconfig: Fix parsing of "help" text Steven Rostedt
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Steven Rostedt @ 2016-04-26 22:44 UTC (permalink / raw)
  To: linux-kernel; +Cc: Andrew Morton, Benjamin Poirier

[-- Attachment #1: 0002-localmodconfig-Recognize-more-keywords-that-end-a-me.patch --]
[-- Type: text/plain, Size: 997 bytes --]

From: Benjamin Poirier <bpoirier@suse.com>

Based on the list in Documentation/kbuild/kconfig-language.txt

This removes junk from %depends because parsing of a menu entry spilled
over to another menu entry.

Link: http://lkml.kernel.org/r/1460333193-16361-1-git-send-email-bpoirier@suse.com

Signed-off-by: Benjamin Poirier <bpoirier@suse.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 scripts/kconfig/streamline_config.pl | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/scripts/kconfig/streamline_config.pl b/scripts/kconfig/streamline_config.pl
index 7036ae306db6..64d750cc5ae4 100755
--- a/scripts/kconfig/streamline_config.pl
+++ b/scripts/kconfig/streamline_config.pl
@@ -256,8 +256,8 @@ sub read_kconfig {
 
 	    $iflevel-- if ($iflevel);
 
-	# stop on "help"
-	} elsif (/^\s*help\s*$/) {
+	# stop on "help" and keywords that end a menu entry
+	} elsif (/^\s*help\s*$/ || /^(comment|choice|menu)\b/) {
 	    $state = "NONE";
 	}
     }
-- 
2.8.0.rc3

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [for-next][PATCH 3/6] localmodconfig: Fix parsing of "help" text
  2016-04-26 22:44 [for-next][PATCH 0/6] localmodconfig: Updates for 4.7 Steven Rostedt
  2016-04-26 22:44 ` [for-next][PATCH 1/6] localmodconfig: Fix parsing of Kconfig "source" statements Steven Rostedt
  2016-04-26 22:44 ` [for-next][PATCH 2/6] localmodconfig: Recognize more keywords that end a menu entry Steven Rostedt
@ 2016-04-26 22:44 ` Steven Rostedt
  2016-04-26 22:44 ` [for-next][PATCH 4/6] localmodconfig: Add missing $ to reference a variable Steven Rostedt
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Steven Rostedt @ 2016-04-26 22:44 UTC (permalink / raw)
  To: linux-kernel; +Cc: Andrew Morton, Benjamin Poirier

[-- Attachment #1: 0003-localmodconfig-Fix-parsing-of-help-text.patch --]
[-- Type: text/plain, Size: 1098 bytes --]

From: Benjamin Poirier <bpoirier@suse.com>

Help text may start with "help" or "---help---". This patch fixes
read_kconfig() to recognize the second variant.

This removes useless junk from %depends and %selects. That junk is due to
help text that contains the words "selects" and "depends".

Link: http://lkml.kernel.org/r/1460333193-16361-2-git-send-email-bpoirier@suse.com

Signed-off-by: Benjamin Poirier <bpoirier@suse.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 scripts/kconfig/streamline_config.pl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/kconfig/streamline_config.pl b/scripts/kconfig/streamline_config.pl
index 64d750cc5ae4..b2f904a24c5c 100755
--- a/scripts/kconfig/streamline_config.pl
+++ b/scripts/kconfig/streamline_config.pl
@@ -257,7 +257,7 @@ sub read_kconfig {
 	    $iflevel-- if ($iflevel);
 
 	# stop on "help" and keywords that end a menu entry
-	} elsif (/^\s*help\s*$/ || /^(comment|choice|menu)\b/) {
+	} elsif (/^\s*(---)?help(---)?\s*$/ || /^(comment|choice|menu)\b/) {
 	    $state = "NONE";
 	}
     }
-- 
2.8.0.rc3

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [for-next][PATCH 4/6] localmodconfig: Add missing $ to reference a variable
  2016-04-26 22:44 [for-next][PATCH 0/6] localmodconfig: Updates for 4.7 Steven Rostedt
                   ` (2 preceding siblings ...)
  2016-04-26 22:44 ` [for-next][PATCH 3/6] localmodconfig: Fix parsing of "help" text Steven Rostedt
@ 2016-04-26 22:44 ` Steven Rostedt
  2016-04-26 22:44 ` [for-next][PATCH 5/6] localmodconfig: Reset certificate paths Steven Rostedt
  2016-04-26 22:44 ` [for-next][PATCH 6/6] localmodconfig: Fix whitespace repeat count after "tristate" Steven Rostedt
  5 siblings, 0 replies; 7+ messages in thread
From: Steven Rostedt @ 2016-04-26 22:44 UTC (permalink / raw)
  To: linux-kernel; +Cc: Andrew Morton, Benjamin Poirier

[-- Attachment #1: 0004-localmodconfig-Add-missing-to-reference-a-variable.patch --]
[-- Type: text/plain, Size: 1122 bytes --]

From: Benjamin Poirier <bpoirier@suse.com>

That is clearly what the original intention was. This does not change the
output .config but it prevents some useless processing.

! eq "m" is changed to the simpler eq "y"; symbols with values other than
m|y are not included in %orig_configs.

Link: http://lkml.kernel.org/r/1460333193-16361-3-git-send-email-bpoirier@suse.com

Signed-off-by: Benjamin Poirier <bpoirier@suse.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 scripts/kconfig/streamline_config.pl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/kconfig/streamline_config.pl b/scripts/kconfig/streamline_config.pl
index b2f904a24c5c..01b53eccfe2f 100755
--- a/scripts/kconfig/streamline_config.pl
+++ b/scripts/kconfig/streamline_config.pl
@@ -454,7 +454,7 @@ sub parse_config_depends
 	    $p =~ s/^[^$valid]*[$valid]+//;
 
 	    # We only need to process if the depend config is a module
-	    if (!defined($orig_configs{$conf}) || !$orig_configs{conf} eq "m") {
+	    if (!defined($orig_configs{$conf}) || $orig_configs{$conf} eq "y") {
 		next;
 	    }
 
-- 
2.8.0.rc3

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [for-next][PATCH 5/6] localmodconfig: Reset certificate paths
  2016-04-26 22:44 [for-next][PATCH 0/6] localmodconfig: Updates for 4.7 Steven Rostedt
                   ` (3 preceding siblings ...)
  2016-04-26 22:44 ` [for-next][PATCH 4/6] localmodconfig: Add missing $ to reference a variable Steven Rostedt
@ 2016-04-26 22:44 ` Steven Rostedt
  2016-04-26 22:44 ` [for-next][PATCH 6/6] localmodconfig: Fix whitespace repeat count after "tristate" Steven Rostedt
  5 siblings, 0 replies; 7+ messages in thread
From: Steven Rostedt @ 2016-04-26 22:44 UTC (permalink / raw)
  To: linux-kernel; +Cc: Andrew Morton, Benjamin Poirier

[-- Attachment #1: 0005-localmodconfig-Reset-certificate-paths.patch --]
[-- Type: text/plain, Size: 2605 bytes --]

From: Benjamin Poirier <bpoirier@suse.com>

When using `make localmodconfig` and friends, if the input config comes
from a kernel that was built in a different environment (for example, the
canonical case of using localmodconfig to trim a distribution kernel
config) the key files for module signature checking will not be available
and should be regenerated or omitted. Otherwise, the user will be faced
with annoying errors when trying to build with the generated .config:

make[1]: *** No rule to make target 'keyring.crt', needed by 'certs/x509_certificate_list'.  Stop.
Makefile:1576: recipe for target 'certs/' failed

Link: http://lkml.kernel.org/r/1461696721-3001-1-git-send-email-bpoirier@suse.com

Signed-off-by: Benjamin Poirier <bpoirier@suse.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 scripts/kconfig/streamline_config.pl | 34 ++++++++++++++++++++++++++++++++++
 1 file changed, 34 insertions(+)

diff --git a/scripts/kconfig/streamline_config.pl b/scripts/kconfig/streamline_config.pl
index 01b53eccfe2f..95a6f2b888d4 100755
--- a/scripts/kconfig/streamline_config.pl
+++ b/scripts/kconfig/streamline_config.pl
@@ -610,6 +610,40 @@ foreach my $line (@config_file) {
 	next;
     }
 
+    if (/CONFIG_MODULE_SIG_KEY="(.+)"/) {
+        my $orig_cert = $1;
+        my $default_cert = "certs/signing_key.pem";
+
+        # Check that the logic in this script still matches the one in Kconfig
+        if (!defined($depends{"MODULE_SIG_KEY"}) ||
+            $depends{"MODULE_SIG_KEY"} !~ /"\Q$default_cert\E"/) {
+            print STDERR "WARNING: MODULE_SIG_KEY assertion failure, ",
+                "update needed to ", __FILE__, " line ", __LINE__, "\n";
+            print;
+        } elsif ($orig_cert ne $default_cert && ! -f $orig_cert) {
+            print STDERR "Module signature verification enabled but ",
+                "module signing key \"$orig_cert\" not found. Resetting ",
+                "signing key to default value.\n";
+            print "CONFIG_MODULE_SIG_KEY=\"$default_cert\"\n";
+        } else {
+            print;
+        }
+        next;
+    }
+
+    if (/CONFIG_SYSTEM_TRUSTED_KEYS="(.+)"/) {
+        my $orig_keys = $1;
+
+        if (! -f $orig_keys) {
+            print STDERR "System keyring enabled but keys \"$orig_keys\" ",
+                "not found. Resetting keys to default value.\n";
+            print "CONFIG_SYSTEM_TRUSTED_KEYS=\"\"\n";
+        } else {
+            print;
+        }
+        next;
+    }
+
     if (/^(CONFIG.*)=(m|y)/) {
 	if (defined($configs{$1})) {
 	    if ($localyesconfig) {
-- 
2.8.0.rc3

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [for-next][PATCH 6/6] localmodconfig: Fix whitespace repeat count after "tristate"
  2016-04-26 22:44 [for-next][PATCH 0/6] localmodconfig: Updates for 4.7 Steven Rostedt
                   ` (4 preceding siblings ...)
  2016-04-26 22:44 ` [for-next][PATCH 5/6] localmodconfig: Reset certificate paths Steven Rostedt
@ 2016-04-26 22:44 ` Steven Rostedt
  5 siblings, 0 replies; 7+ messages in thread
From: Steven Rostedt @ 2016-04-26 22:44 UTC (permalink / raw)
  To: linux-kernel; +Cc: Andrew Morton, Benjamin Poirier

[-- Attachment #1: 0006-localmodconfig-Fix-whitespace-repeat-count-after-tri.patch --]
[-- Type: text/plain, Size: 1281 bytes --]

From: Benjamin Poirier <bpoirier@suse.com>

Also recognize standalone "prompt".

Before this patch we incorrectly identified some symbols as not having a
prompt and potentially needing to be selected by something else.

Note that this patch could theoretically change the resulting .config,
causing it to have fewer symbols turned on. However, given the current set
of Kconfig files, this situation does not occur because the symbols newly
added to %prompts are absent from %selects.

Link: http://lkml.kernel.org/r/1461696998-3953-1-git-send-email-bpoirier@suse.com

Signed-off-by: Benjamin Poirier <bpoirier@suse.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 scripts/kconfig/streamline_config.pl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/kconfig/streamline_config.pl b/scripts/kconfig/streamline_config.pl
index 95a6f2b888d4..b8c7b29affc5 100755
--- a/scripts/kconfig/streamline_config.pl
+++ b/scripts/kconfig/streamline_config.pl
@@ -237,7 +237,7 @@ sub read_kconfig {
 	    }
 
 	# configs without prompts must be selected
-	} elsif ($state ne "NONE" && /^\s*tristate\s\S/) {
+	} elsif ($state ne "NONE" && /^\s*(tristate\s+\S|prompt\b)/) {
 	    # note if the config has a prompt
 	    $prompts{$config} = 1;
 
-- 
2.8.0.rc3

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2016-04-26 22:48 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-04-26 22:44 [for-next][PATCH 0/6] localmodconfig: Updates for 4.7 Steven Rostedt
2016-04-26 22:44 ` [for-next][PATCH 1/6] localmodconfig: Fix parsing of Kconfig "source" statements Steven Rostedt
2016-04-26 22:44 ` [for-next][PATCH 2/6] localmodconfig: Recognize more keywords that end a menu entry Steven Rostedt
2016-04-26 22:44 ` [for-next][PATCH 3/6] localmodconfig: Fix parsing of "help" text Steven Rostedt
2016-04-26 22:44 ` [for-next][PATCH 4/6] localmodconfig: Add missing $ to reference a variable Steven Rostedt
2016-04-26 22:44 ` [for-next][PATCH 5/6] localmodconfig: Reset certificate paths Steven Rostedt
2016-04-26 22:44 ` [for-next][PATCH 6/6] localmodconfig: Fix whitespace repeat count after "tristate" Steven Rostedt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).