liminix

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit e823e7a29c3cb1502894efd2991a0d874ec406a2
parent 20b9eb16ec5835672541acdd6978887a8cfa8f47
Author: Daniel Barlow <dan@telent.net>
Date:   Sun,  9 Oct 2022 09:50:17 +0100

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

Diffstat:
Mdevices/gl-ar750.nix | 3+++
Mkernel/default.nix | 3++-
Akernel/random.patch | 9+++++++++
Mkernel/vmlinux.nix | 12++++++++++++
4 files changed, 26 insertions(+), 1 deletion(-)

diff --git a/devices/gl-ar750.nix b/devices/gl-ar750.nix @@ -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"; diff --git a/kernel/default.nix b/kernel/default.nix @@ -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/ ''; diff --git a/kernel/random.patch b/kernel/random.patch @@ -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" diff --git a/kernel/vmlinux.nix b/kernel/vmlinux.nix @@ -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 ) '';