From aedb07e29449c4346c7249c95d38a4c56542a4cf Mon Sep 17 00:00:00 2001 From: Elliot Berman Date: Tue, 26 Aug 2025 11:27:16 -0700 Subject: [PATCH] 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. --- pkgs/os-specific/linux/kernel/generic.nix | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pkgs/os-specific/linux/kernel/generic.nix b/pkgs/os-specific/linux/kernel/generic.nix index 8899e7bad9d9..5f6111e5f7fa 100644 --- a/pkgs/os-specific/linux/kernel/generic.nix +++ b/pkgs/os-specific/linux/kernel/generic.nix @@ -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 ( {