HALFARSED enable toggling promptless kconfig symbols

Some kernel config symbols we need to enable in some configurations
don't have a "prompt" entry in the Kconfig files, meaning that
make oldconfig (or any other make fooconfig) won't change them.
So we add a Kconfig.local where they can be selected

In this patch we hardcode the required symbol. Next step would be
to generalise so that they could be specified in something like a
config.kernel.hiddenConfig attrset
This commit is contained in:
Daniel Barlow 2022-10-09 09:50:17 +01:00
parent 20b9eb16ec
commit e823e7a29c
4 changed files with 26 additions and 1 deletions

View file

@ -25,6 +25,9 @@
"MIPS_ELF_APPENDED_DTB" = "y";
OF = "y";
USE_OF = "y";
ATH79 = "y";
SOC_QCA955X = "y"; # actually QCA9531, is this even right?
LIMINIX = "y";
SERIAL_8250_CONSOLE = "y";
SERIAL_8250 = "y";
SERIAL_CORE_CONSOLE = "y";

View file

@ -25,7 +25,8 @@ let
tree = stdenvNoCC.mkDerivation {
name = "spindled-kernel-tree";
src = source;
phases = [ "unpackPhase" "patchScripts" "installPhase" ];
phases = [ "unpackPhase" "patchPhase" "patchScripts" "installPhase" ];
patches = [ ./random.patch ];
patchScripts = ''
patchShebangs scripts/
'';

9
kernel/random.patch Normal file
View file

@ -0,0 +1,9 @@
diff --git a/Kconfig b/Kconfig
index 745bc773f567..24a6ea92ee19 100644
--- a/Kconfig
+++ b/Kconfig
@@ -30,3 +30,4 @@ source "lib/Kconfig"
source "lib/Kconfig.debug"
source "Documentation/Kconfig"
+source "Kconfig.local"

View file

@ -16,6 +16,17 @@ let writeConfig = name : config: writeText name
config
));
kconfigFile = writeConfig "kconfig" (config // checkedConfig);
# KLUDGE FIXME. some symbols we need to enable in some configurations don't
# have a prompt (!), so we can't turn them on just by adding FOO=y and make oldconfig
#
# (!) yes, that was my reaction too
kconfigLocal = writeText "Kconfig.local" ''
config LIMINIX
prompt "Local symbols"
bool
default y
select SOC_QCA955X
'';
checkedConfigFile = writeConfig "checked_kconfig" checkedConfig ;
inherit lib; in
stdenv.mkDerivation rec {
@ -60,6 +71,7 @@ stdenv.mkDerivation rec {
export KBUILD_OUTPUT=`pwd`
cp ${kconfigFile} .config
cp ${kconfigFile} .config.orig
cp ${kconfigLocal} Kconfig.local
( cd ${tree} && make V=1 olddefconfig )
'';