diff options
author | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2009-12-14 09:27:15 +0000 |
---|---|---|
committer | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2009-12-14 09:27:15 +0000 |
commit | 15c6ede14492eae311a00dd0919e828518bedbde (patch) | |
tree | 44e25f0bfbfed115e8616f60b037d21da9234c08 /pkgs/os-specific | |
parent | 71ed6194e1c4fa17d8c6eae83e01ca38e05233d5 (diff) | |
download | nixlib-15c6ede14492eae311a00dd0919e828518bedbde.tar nixlib-15c6ede14492eae311a00dd0919e828518bedbde.tar.gz nixlib-15c6ede14492eae311a00dd0919e828518bedbde.tar.bz2 nixlib-15c6ede14492eae311a00dd0919e828518bedbde.tar.lz nixlib-15c6ede14492eae311a00dd0919e828518bedbde.tar.xz nixlib-15c6ede14492eae311a00dd0919e828518bedbde.tar.zst nixlib-15c6ede14492eae311a00dd0919e828518bedbde.zip |
* Allow options to be ignored if they don't exist by marking them with
a "?". svn path=/nixpkgs/branches/kernel-config/; revision=18931
Diffstat (limited to 'pkgs/os-specific')
-rw-r--r-- | pkgs/os-specific/linux/kernel/builder.sh | 4 | ||||
-rw-r--r-- | pkgs/os-specific/linux/kernel/generate-config.pl | 15 | ||||
-rw-r--r-- | 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 (<ANSWERS>) { 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 (<CONFIG>) { 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 |