linux: gate hostPlatform extraConfig by enableCommonConfig

When enableCommonConfig is set to false, we should limit the config
options that are implicitly enabled. extraConfig for
aarch64-multiplatform brings in platform-specific configuration and
limits the ability to create a trimmed down kernel configuration for a
particular board.
This commit is contained in:
Elliot Berman
2025-08-26 11:27:16 -07:00
parent fa1c197390
commit aedb07e294

View File

@@ -38,8 +38,8 @@ let
# Additional make flags passed to kbuild
extraMakeFlags ? [ ],
# enables the options in ./common-config.nix; if `false` then only
# `structuredExtraConfig` is used
# enables the options in ./common-config.nix and lib/systems/platform.nix;
# if `false` then only `structuredExtraConfig` is used
enableCommonConfig ? true
, # kernel intermediate config overrides, as a set
@@ -136,7 +136,8 @@ let
configfile.moduleStructuredConfig.intermediateNixConfig
# extra config in legacy string format
+ extraConfig
+ stdenv.hostPlatform.linux-kernel.extraConfig or "";
# need the 'or ""' at the end in case enableCommonConfig = true and extraConfig is not present
+ lib.optionalString enableCommonConfig stdenv.hostPlatform.linux-kernel.extraConfig or "";
structuredConfigFromPatches = map (
{