Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error parsing Kconfig sources:- couldn't parse 'modules': unrecognized construct #131

Open
pjps opened this issue Jun 16, 2023 · 0 comments

Comments

@pjps
Copy link

pjps commented Jun 16, 2023

  • I'm trying to use the 'kconfiglib' module to read Linux Kconfig source files.

  • I could not get the 'scriptconfig' makefile.patch working with the latest upstream Linux version 6.4-rc4. The documentation does not seem to mention that we need to extract 'kconfiglib' scripts under the kernel source directory for make targets to work.

  • After multiple trial-&-errors, kconfiglib is showing below error while parsing the Kconfig menu about 'Loadable modules support' options.

$ srctree=. ARCH=x86 SRCARCH=x86 KERNELVERSION=`make kernelversion` \
         LD=ld CC=gcc RUSTC=false BINDGEN=false python ../kconf/kconf.py Kconfig 
Traceback (most recent call last):
   File "../kconf/kconf.py", line 55, in <module>
     kconf = Kconfig(sys.argv[1])
             ^^^^^^^^^^^^^^^^^^^^
   File "/usr/lib/python3.11/site-packages/kconfiglib/kconfiglib.py", line 947, in __init__
     self._init(filename, warn, warn_to_stderr, encoding)
   File "/usr/lib/python3.11/site-packages/kconfiglib/kconfiglib.py", line 1085, in _init
     self._parse_block(None, self.top_node, self.top_node).next = None
     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   File "/usr/lib/python3.11/site-packages/kconfiglib/kconfiglib.py", line 2989, in _parse_block
     prev = self._parse_block(None, parent, prev)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   File "/usr/lib/python3.11/site-packages/kconfiglib/kconfiglib.py", line 2989, in _parse_block
     prev = self._parse_block(None, parent, prev)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   File "/usr/lib/python3.11/site-packages/kconfiglib/kconfiglib.py", line 3091, in _parse_block
     self._parse_error(
   File "/usr/lib/python3.11/site-packages/kconfiglib/kconfiglib.py", line 3879, in _parse_error
     raise KconfigError("{}error: couldn't parse '{}': {}".format(
kconfiglib.KconfigError: kernel/module/Kconfig:4: error: couldn't parse 'modules': unrecognized construct 
  • I'd appreciate if you could please have a look, check if I'm missing something or using it wrongly?

Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant