From 6e56f018f6582b315e1af6b5ea2c6bbd5bb99a62 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Wed, 27 Oct 2021 15:03:07 +0200 Subject: kconfig: add DFATOOL_KCONF_IGNORE_NUMERIC / _STRING options --- lib/loader/kconfig.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'lib/loader') diff --git a/lib/loader/kconfig.py b/lib/loader/kconfig.py index 42181c9..ef0bc65 100644 --- a/lib/loader/kconfig.py +++ b/lib/loader/kconfig.py @@ -32,12 +32,21 @@ class KConfigAttributes: if "/" in kconfig_path: self.kconfig_dir = kconfig_path.split("/")[-2] + accepted_symbol_types = "bool tristate int string hex".split() + + if bool(int(os.getenv("DFATOOL_KCONF_IGNORE_NUMERIC", 0))): + accepted_symbol_types.remove("int") + accepted_symbol_types.remove("hex") + + if bool(int(os.getenv("DFATOOL_KCONF_IGNORE_STRING", 0))): + accepted_symbol_types.remove("string") + self.symbol_names = sorted( map( lambda sym: sym.name, filter( lambda sym: kconfiglib.TYPE_TO_STR[sym.type] - in ("bool", "tristate", "int", "string", "hex"), + in accepted_symbol_types, kconf.syms.values(), ), ) -- cgit v1.2.3