diff --git a/pkgs/os-specific/linux/kernel/generate-config.pl b/pkgs/os-specific/linux/kernel/generate-config.pl index 5574cc937af7..5bce3af94293 100644 --- a/pkgs/os-specific/linux/kernel/generate-config.pl +++ b/pkgs/os-specific/linux/kernel/generate-config.pl @@ -17,6 +17,7 @@ my $wd = getcwd; my $debug = $ENV{'DEBUG'}; my $autoModules = $ENV{'AUTO_MODULES'}; +my $preferBuiltin = $ENV{'PREFER_BUILTIN'}; $SIG{PIPE} = 'IGNORE'; @@ -73,7 +74,7 @@ sub runConfig { my $question = $1; my $name = $2; my $alts = $3; my $answer = ""; # Build everything as a module if possible. - $answer = "m" if $autoModules && $alts =~ /\/m/; + $answer = "m" if $autoModules && $alts =~ /\/m/ && !($preferBuiltin && $alts =~ /Y/); $answer = $answers{$name} if defined $answers{$name}; print STDERR "QUESTION: $question, NAME: $name, ALTS: $alts, ANSWER: $answer\n" if $debug; print OUT "$answer\n"; diff --git a/pkgs/os-specific/linux/kernel/generic.nix b/pkgs/os-specific/linux/kernel/generic.nix index af14434b08f2..16b35e9aa3e2 100644 --- a/pkgs/os-specific/linux/kernel/generic.nix +++ b/pkgs/os-specific/linux/kernel/generic.nix @@ -55,6 +55,7 @@ let kernelBaseConfig = stdenv.platform.kernelBaseConfig; kernelTarget = stdenv.platform.kernelTarget; autoModules = stdenv.platform.kernelAutoModules; + preferBuiltin = stdenv.platform.kernelPreferBuiltin or false; arch = stdenv.platform.kernelArch; crossAttrs = let @@ -92,7 +93,7 @@ let echo "generating kernel configuration..." echo "$kernelConfig" > kernel-config DEBUG=1 ARCH=$arch KERNEL_CONFIG=kernel-config AUTO_MODULES=$autoModules \ - SRC=../$sourceRoot perl -w $generateConfig + PREFER_BUILTIN=$preferBuiltin SRC=../$sourceRoot perl -w $generateConfig ''; installPhase = "mv .config $out";