mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-07-06 17:13:24 -05:00
linux/generate-config: disallow conflicting answers to choice questions (#531605)
This commit is contained in:
commit
5972e93d5b
2 changed files with 10 additions and 7 deletions
|
|
@ -1420,13 +1420,10 @@ let
|
|||
DRM_AMDGPU_USERPTR = yes;
|
||||
|
||||
# We want to prefer PREEMPT_LAZY when available, and fall back on PREEMPT_VOLUNTARY.
|
||||
# It just so happens that kconfig asks for PREEMPT_LAZY first, so doing it like this
|
||||
# does what we want.
|
||||
# FIXME: This is stupid and bad.
|
||||
# See: https://github.com/torvalds/linux/commit/7dadeaa6e851e7d67733f3e24fc53ee107781d0f
|
||||
# The version cutoff is arbitrary, the real cutoff is somewhere around 6.13 depending on target.
|
||||
PREEMPT = no;
|
||||
PREEMPT_LAZY = option yes;
|
||||
PREEMPT_VOLUNTARY = option yes;
|
||||
PREEMPT_LAZY = whenAtLeast "6.18" yes;
|
||||
PREEMPT_VOLUNTARY = whenOlder "6.18" yes;
|
||||
|
||||
X86_AMD_PLATFORM_DEVICE = lib.mkIf stdenv.hostPlatform.isx86 yes;
|
||||
X86_PLATFORM_DRIVERS_DELL = lib.mkIf stdenv.hostPlatform.isx86 (whenAtLeast "5.12" yes);
|
||||
|
|
|
|||
|
|
@ -100,7 +100,13 @@ sub runConfig {
|
|||
elsif ($line =~ /choice\[(.*)\]: ###$/) {
|
||||
my $answer = "";
|
||||
foreach my $name (keys %choices) {
|
||||
$answer = $choices{$name} if ($answers{$name} || "") eq "y";
|
||||
if (($answers{$name} || "") eq "y") {
|
||||
if ($answer eq "") {
|
||||
$answer = $choices{$name};
|
||||
} else {
|
||||
die "conflicting answers!"
|
||||
}
|
||||
}
|
||||
}
|
||||
print STDERR "CHOICE: $1, ANSWER: $answer\n" if $debug;
|
||||
print OUT "$answer\n" if $1 =~ /-/;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue