Comments (3)
Closing for now. Open another issue (or reopen this one, if that's possible) if you have other questions.
from kconfiglib.
Hello,
If you want to check that each value set in a defconfig
file matches the final value the symbol gets, then you could do the following, adapted from merge_config.py:
...
kconf.load_config(defconfig_file_to_check)
# Print warnings for symbols whose actual value doesn't match the assigned
# value
for sym in kconf.defined_syms:
# Was the symbol assigned to?
if sym.user_value is not None:
# Tristate values are represented as 0, 1, 2. Having them as
# "n", "m", "y" is more convenient here, so convert.
if sym.type in (BOOL, TRISTATE):
user_value = TRI_TO_STR[sym.user_value]
else:
user_value = sym.user_value
if user_value != sym.str_value:
print('warning: {} was assigned the value "{}" but got the '
'value "{}" -- check dependencies'
.format(sym.name, user_value, sym.str_value))
This works fine for defconfig
files, because you always expect the final value to match the assigned value in those (look up make savedefconfig
-- they're a kind of "minimal" .config
from which the full .config
is derived). It might get a bit more iffy for old "full" .config
files.
If you want to do a batch job over multiple defconfig
files in the kernel, take a look at how the test_defconfig() test is implemented in the test suite. The list_undefined.py script might give you some ideas too.
from kconfiglib.
Thanks for the pointers :) I'll try
from kconfiglib.
Related Issues (20)
- kconfiglib handles string literals inconsistently across operating systems
- option modules on non MODULES HOT 1
- Backspace bug in Msys2 version
- Prompt shown even when expected to be disable.
- Struggling with comprehending the documentation HOT 1
- Parsing error in kconfiglib when upgrading to yocto 3.3 (hardknott)
- kconfiglib needs a new maintainer? HOT 16
- error: couldn't parse 'modules': unrecognized construct HOT 1
- Boolean default not taken if written after help
- fails if the parent directory contains spaces HOT 1
- Inaccessible to screen readers
- `make menuconfig` fails when the parent directory contains spaces.
- New release request
- Extension Suggestion: Strings without quotation marks (Macro-like)
- Error parsing Kconfig sources:- couldn't parse 'modules': unrecognized construct
- I made a standalone menuconfig HOT 1
- The default `conf` mode seems missing HOT 1
- doc: Documentation issue in 'Readme.rst' - broken hyperlink from kconfiglib to zephyrproject
- When searching symbol with guiconfig, there is an exception
- Support a getconfig module HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from kconfiglib.