summary refs log tree commit diff
path: root/pkgs/os-specific/linux/kernel/generate-config.pl
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/os-specific/linux/kernel/generate-config.pl')
-rw-r--r--pkgs/os-specific/linux/kernel/generate-config.pl13
1 files changed, 8 insertions, 5 deletions
diff --git a/pkgs/os-specific/linux/kernel/generate-config.pl b/pkgs/os-specific/linux/kernel/generate-config.pl
index e5fa780c6e7..5574cc937af 100644
--- a/pkgs/os-specific/linux/kernel/generate-config.pl
+++ b/pkgs/os-specific/linux/kernel/generate-config.pl
@@ -91,17 +91,17 @@ sub runConfig {
                 print STDERR "CHOICE: $1, ANSWER: $answer\n" if $debug;
                 print OUT "$answer\n" if $1 =~ /-/;
             }
-        
+
             # Some questions lack the option name ("bla bla [Y/n/m/...] ").
             elsif ($line =~ /(.*) \[(.*)\] ###$/) {
                 print OUT "\n";
             }
-            
+
             else {
                 warn "don't know how to answer this question: $line\n";
                 print OUT "\n";
             }
-        
+
             $line = "";
             %choices = ();
         }
@@ -124,7 +124,10 @@ my %config;
 open CONFIG, "<.config" or die;
 while (<CONFIG>) {
     chomp;
-    if (/^CONFIG_([A-Za-z0-9_]+)=(.*)$/) {
+    if (/^CONFIG_([A-Za-z0-9_]+)="(.*)"$/) {
+        # String options have double quotes, e.g. 'CONFIG_NLS_DEFAULT="utf8"' and allow escaping.
+        ($config{$1} = $2) =~ s/\\([\\"])/$1/g;
+    } elsif (/^CONFIG_([A-Za-z0-9_]+)=(.*)$/) {
         $config{$1} = $2;
     } elsif (/^# CONFIG_([A-Za-z0-9_]+) is not set$/) {
         $config{$1} = "n";
@@ -136,6 +139,6 @@ foreach my $name (sort (keys %answers)) {
     my $f = $requiredAnswers{$name} && $ENV{'ignoreConfigErrors'} ne "1"
         ? sub { die "error: " . $_[0]; } : sub { warn "warning: " . $_[0]; };
     &$f("unused option: $name\n") unless defined $config{$name};
-    &$f("option not set correctly: $name\n")
+    &$f("option not set correctly: $name (wanted '$answers{$name}', got '$config{$name}')\n")
         if $config{$name} && $config{$name} ne $answers{$name};
 }