From 15c6ede14492eae311a00dd0919e828518bedbde Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Mon, 14 Dec 2009 09:27:15 +0000 Subject: [PATCH] * Allow options to be ignored if they don't exist by marking them with a "?". svn path=/nixpkgs/branches/kernel-config/; revision=18931 --- pkgs/os-specific/linux/kernel/builder.sh | 4 ++-- pkgs/os-specific/linux/kernel/generate-config.pl | 15 ++++++++++----- pkgs/os-specific/linux/kernel/linux-2.6.29.nix | 8 +++----- 3 files changed, 15 insertions(+), 12 deletions(-) diff --git a/pkgs/os-specific/linux/kernel/builder.sh b/pkgs/os-specific/linux/kernel/builder.sh index 59def5799b4b..58d257438100 100644 --- a/pkgs/os-specific/linux/kernel/builder.sh +++ b/pkgs/os-specific/linux/kernel/builder.sh @@ -21,8 +21,8 @@ configurePhase() { fi - # Patch kconfig to print "###" after every question - - # generate-config.pl expects this. + # Patch kconfig to print "###" after every question so that + # generate-config.pl can answer them. sed -e '/fflush(stdout);/i\printf("###");' -i scripts/kconfig/conf.c # Create the config file. diff --git a/pkgs/os-specific/linux/kernel/generate-config.pl b/pkgs/os-specific/linux/kernel/generate-config.pl index 2acba32e8d77..56320ce882fa 100644 --- a/pkgs/os-specific/linux/kernel/generate-config.pl +++ b/pkgs/os-specific/linux/kernel/generate-config.pl @@ -18,12 +18,17 @@ $SIG{PIPE} = 'IGNORE'; # Read the answers. my %answers; +my %requiredAnswers; open ANSWERS, "<$ENV{KERNEL_CONFIG}" or die; while () { chomp; s/#.*//; - my ($name, $value) = split / /; - $answers{$name} = $value if $name; + if (/^\s*([A-Za-z0-9_]+)(\?)?\s+(\S+)\s*$/) { + $answers{$1} = $3; + $requiredAnswers{$1} = 1 unless defined $2; + } elsif (!/^\s*$/) { + die "invalid config line: $_"; + } } close ANSWERS; @@ -123,8 +128,8 @@ while () { close CONFIG; foreach my $name (sort (keys %answers)) { - die "unused option: $name\n" - unless defined $config{$name}; - die "option not set correctly: $name\n" + my $f = $requiredAnswers{$name} ? sub { die @_; } : sub { warn @_; }; + &$f("unused option: $name\n") unless defined $config{$name}; + &$f("option not set correctly: $name\n") if $config{$name} && $config{$name} ne $answers{$name}; } diff --git a/pkgs/os-specific/linux/kernel/linux-2.6.29.nix b/pkgs/os-specific/linux/kernel/linux-2.6.29.nix index 120fd182f202..9a7fb3a34711 100644 --- a/pkgs/os-specific/linux/kernel/linux-2.6.29.nix +++ b/pkgs/os-specific/linux/kernel/linux-2.6.29.nix @@ -47,7 +47,7 @@ import ./generic.nix ( # Disable some expensive (?) features. MARKERS n KPROBES n - NUMA n + NUMA? n PM_TRACE_RTC n # Enable various subsystems. @@ -78,9 +78,7 @@ import ./generic.nix ( # Wireless networking. IPW2100_MONITOR y # support promiscuous mode IPW2200_MONITOR y # support promiscuous mode - ${stdenv.lib.optionalString (!userModeLinux) '' - IWLWIFI_LEDS y - ''} + IWLWIFI_LEDS? y IWLWIFI_RFKILL y IWLAGN_SPECTRUM_MEASUREMENT y IWLAGN_LEDS y @@ -192,7 +190,7 @@ import ./generic.nix ( BT_RFCOMM_TTY y # RFCOMM TTY support CPU_FREQ_DEBUG n CRASH_DUMP n - DMAR n # experimental + DMAR? n # experimental DVB_DYNAMIC_MINORS y # we use udev FUSION y # Fusion MPT device support IDE_GD_ATAPI y # ATAPI floppy support