diff options
Diffstat (limited to 'examples/print_sym_info.py')
| -rw-r--r-- | examples/print_sym_info.py | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/examples/print_sym_info.py b/examples/print_sym_info.py new file mode 100644 index 0000000..8c69cac --- /dev/null +++ b/examples/print_sym_info.py @@ -0,0 +1,18 @@ +# Loads a Kconfig and a .config and prints information about a symbol. + +import kconfiglib +import sys + +# Create a Config object representing a Kconfig configuration. (Any number of +# these can be created -- the library has no global state.) +conf = kconfiglib.Config(sys.argv[1]) + +# Load values from a .config file. 'srctree' is an environment variable set by +# the Linux makefiles to the top-level directory of the kernel tree. It needs +# to be used here for the script to work with alternative build directories +# (specified e.g. with O=). +conf.load_config("$srctree/arch/x86/configs/i386_defconfig") + +# Print some information about a symbol. (The Config class implements +# __getitem__() to provide a handy syntax for getting symbols.) +print conf["SERIAL_UARTLITE_CONSOLE"] |
