From 76243d306cecab4885b8e1c0d938caedf11705e8 Mon Sep 17 00:00:00 2001 From: Daniel Barlow Date: Wed, 19 Oct 2022 22:09:38 +0100 Subject: [PATCH] remove checkedConfig, check all the config --- default.nix | 2 +- devices/gl-ar750/default.nix | 2 +- devices/qemu/default.nix | 2 +- kernel/default.nix | 3 +-- modules/base.nix | 5 ----- modules/phram.nix | 2 +- modules/wlan.nix | 2 +- pkgs/kernel/default.nix | 6 ++---- tests/kernel/run.sh | 2 +- tests/pppoe/configuration.nix | 1 + tests/wlan/configuration.nix | 2 +- 11 files changed, 11 insertions(+), 18 deletions(-) diff --git a/default.nix b/default.nix index 2e5a7fb..dd99827 100644 --- a/default.nix +++ b/default.nix @@ -29,7 +29,7 @@ let outputs = rec { inherit squashfs; kernel = nixpkgs.kernel.override { - inherit (config.kernel) config checkedConfig; + inherit (config.kernel) config; }; dtb = (callPackage ./kernel/dtb.nix {}) { dts = "${openwrt}/target/linux/ath79/dts/qca9531_glinet_gl-ar750.dts"; diff --git a/devices/gl-ar750/default.nix b/devices/gl-ar750/default.nix index ae315d4..b0d391e 100644 --- a/devices/gl-ar750/default.nix +++ b/devices/gl-ar750/default.nix @@ -62,7 +62,7 @@ }; }; kernel = rec { - checkedConfig = { + config = { MIPS_ELF_APPENDED_DTB = "y"; OF = "y"; USE_OF = "y"; diff --git a/devices/qemu/default.nix b/devices/qemu/default.nix index 30394be..7b94ce6 100644 --- a/devices/qemu/default.nix +++ b/devices/qemu/default.nix @@ -29,7 +29,7 @@ }; kernel = { - checkedConfig = { + config = { MIPS_MALTA= "y"; CPU_LITTLE_ENDIAN= "n"; CPU_BIG_ENDIAN= "y"; diff --git a/kernel/default.nix b/kernel/default.nix index 18cc743..70ecaef 100644 --- a/kernel/default.nix +++ b/kernel/default.nix @@ -2,13 +2,12 @@ callPackage , config -, checkedConfig , sources }: { vmlinux = callPackage ./vmlinux.nix { tree = sources.kernel; - inherit config checkedConfig; + inherit config; }; uimage = callPackage ./uimage.nix { }; diff --git a/modules/base.nix b/modules/base.nix index 1ef6714..e45dddf 100644 --- a/modules/base.nix +++ b/modules/base.nix @@ -29,10 +29,6 @@ in { # other strings are also used type = types.attrsOf types.nonEmptyStr; }; - checkedConfig = mkOption { - type = types.attrsOf types.nonEmptyStr; - default = {}; - }; }; boot.commandLine = mkOption { type = types.listOf types.nonEmptyStr; @@ -71,7 +67,6 @@ in { TMPFS_POSIX_ACL = "y"; TMPFS_XATTR = "y"; }; - checkedConfig = config; }; boot.commandLine = [ "earlyprintk=serial,ttyS0 console=ttyS0,115200 panic=10 oops=panic init=/bin/init loglevel=8 rootfstype=squashfs" diff --git a/modules/phram.nix b/modules/phram.nix index 9bb8e18..e98f227 100644 --- a/modules/phram.nix +++ b/modules/phram.nix @@ -5,7 +5,7 @@ { config = { kernel = { - checkedConfig = { + config = { MTD = "y"; MTD_PHRAM = "y"; MTD_CMDLINE_PARTS = "y"; diff --git a/modules/wlan.nix b/modules/wlan.nix index 77fea2b..bfb4569 100644 --- a/modules/wlan.nix +++ b/modules/wlan.nix @@ -7,7 +7,7 @@ let in { config = { kernel = rec { - checkedConfig = { + config = { CFG80211= "y"; MAC80211= "y"; MAC80211_MESH= "y"; diff --git a/pkgs/kernel/default.nix b/pkgs/kernel/default.nix index e2dcb94..2c05b95 100644 --- a/pkgs/kernel/default.nix +++ b/pkgs/kernel/default.nix @@ -5,7 +5,6 @@ , lib , config - , checkedConfig ? {} , src , extraPatchPhase ? "true" } : @@ -16,8 +15,7 @@ let writeConfig = name : config: writeText name (name: value: (if value == "n" then "# CONFIG_${name} is not set" else "CONFIG_${name}=${value}")) config )); - kconfigFile = writeConfig "kconfig" (config // checkedConfig); - checkedConfigFile = writeConfig "checked_kconfig" checkedConfig ; + kconfigFile = writeConfig "kconfig" config; inherit lib; in stdenv.mkDerivation rec { name = "kernel"; @@ -75,7 +73,7 @@ stdenv.mkDerivation rec { checkConfigurationPhase = '' echo Checking required config items: - if comm -2 -3 <(grep 'CONFIG' ${checkedConfigFile} |sort) <(grep 'CONFIG' .config|sort) |grep '.' ; then + if comm -2 -3 <(grep 'CONFIG' ${kconfigFile} |sort) <(grep 'CONFIG' .config|sort) |grep '.' ; then echo -e "^^^ Some configuration lost :-(\nPerhaps you have mutually incompatible settings, or have disabled options on which these depend.\n" exit 0 fi diff --git a/tests/kernel/run.sh b/tests/kernel/run.sh index 0ffe338..55cf362 100755 --- a/tests/kernel/run.sh +++ b/tests/kernel/run.sh @@ -1,5 +1,5 @@ set -e -NIXPKGS_ALLOW_UNSUPPORTED_SYSTEM=1 nix-build '' -I liminix-config=../smoke/configuration.nix --arg device "import " -A outputs.kernel.vmlinux -o vmlinux $* +NIXPKGS_ALLOW_UNSUPPORTED_SYSTEM=1 nix-build '' -I liminix-config=../smoke/configuration.nix --arg device "import " -A outputs.kernel -o vmlinux $* TESTS=$(cat <<"EOF" diff --git a/tests/pppoe/configuration.nix b/tests/pppoe/configuration.nix index b1da896..c6fa632 100644 --- a/tests/pppoe/configuration.nix +++ b/tests/pppoe/configuration.nix @@ -21,6 +21,7 @@ in rec { "PPP" = "y"; "PPPOE" = "y"; "PPPOL2TP" = "y"; + "L2TP" = "y"; "PPP_ASYNC" = "y"; "PPP_BSDCOMP" = "y"; "PPP_DEFLATE" = "y"; diff --git a/tests/wlan/configuration.nix b/tests/wlan/configuration.nix index 5b687eb..66a6ba5 100644 --- a/tests/wlan/configuration.nix +++ b/tests/wlan/configuration.nix @@ -15,7 +15,7 @@ in rec { imports = [ ../../modules/wlan.nix ]; - kernel.checkedConfig = { + kernel.config = { MAC80211_HWSIM = "y"; };