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

Resolve warnings caused by incorrect kernel config settings #3104

Merged
merged 6 commits into from
Jan 24, 2024

Conversation

sairon
Copy link
Member

@sairon sairon commented Jan 24, 2024

Resolve all warnings found by linux-check-dotconfig tool. Some dependencies needed to be added, some moved around. As the result, some extra config options have been enabled as a collateral, however no options should be lost, thus the functionality should remain the same (or actually enabled as originally intended).

These are missing various subsystem dependencies and were never in fact
enabled, assuming they're rather exotic and removing them completely.
…ce-support-pcie)

RPi 4+ should use this fragment too, since CM4 has PCIe support.
@sairon sairon added board/raspberrypi Raspberry Pi Boards board/ova Open Virtual Appliance (Virtual Machine) board/odroid Hardkernel's ODROID Boards board/tinker ASUS' Tinker Boards linux Linux kernel related issue board/generic-x86-64 Generic x86-64 Boards (like Intel NUC) board/khadas Khadas VIM Boards board/yellow Home Assistant Yellow board/generic-aarch64 Generic aarch64 machine board/green Home Assistant Green labels Jan 24, 2024
@sairon sairon requested a review from agners January 24, 2024 10:09
@agners agners merged commit 08b3277 into dev Jan 24, 2024
2 checks passed
@agners agners deleted the cleanup-kernel-config branch January 24, 2024 11:03
@jens-maus
Copy link
Contributor

@sairon Sorry for hijacking this PR/thread here. But I am trying to get the same mechanism using your linux-check-dotconfig approach running for my other project (RaspberryMatic). While I could integrate your .py script I am still getting these kind of errors when running the linux-check-dotconfig target:

make[1]: Entering directory '/home/damato/projekte/linux/RaspberryMatic/buildroot-2023.11.1'
CC=/home/damato/projekte/linux/RaspberryMatic/build-raspmatic_generic-aarch64/host/bin/aarch64-buildroot-linux-gnu-gcc LD=/home/damato/projekte/linux/RaspberryMatic/build-raspmatic_generic-aarch64/host/bin/aarch64-buildroot-linux-gnu-ld srctree=/home/damato/projekte/linux/RaspberryMatic/build-raspmatic_generic-aarch64/build/linux-6.1.74/ \
ARCH=arm64 \
SRCARCH=arm64 \
 /home/damato/projekte/linux/RaspberryMatic/buildroot-external/scripts/check-dotconfig.py \
	--github-format --strip-path-prefix=/build-raspmatic_generic-aarch64/ \
	--src-kconfig /home/damato/projekte/linux/RaspberryMatic/build-raspmatic_generic-aarch64/build/linux-6.1.74/Kconfig \
	--actual-config /home/damato/projekte/linux/RaspberryMatic/build-raspmatic_generic-aarch64/build/linux-6.1.74/.config \
	/home/damato/projekte/linux/RaspberryMatic/buildroot-external/kernel/global.config /home/damato/projekte/linux/RaspberryMatic/buildroot-external/kernel/device-support.config /home/damato/projekte/linux/RaspberryMatic/buildroot-external/kernel/security-arm64.config /home/damato/projekte/linux/RaspberryMatic/buildroot-external/kernel/security.config /home/damato/projekte/linux/RaspberryMatic/buildroot-external/board/generic-aarch64/kernel.config
Traceback (most recent call last):
  File "/home/damato/projekte/linux/RaspberryMatic/buildroot-external/scripts/check-dotconfig.py", line 128, in <module>
    main()
  File "/home/damato/projekte/linux/RaspberryMatic/buildroot-external/scripts/check-dotconfig.py", line 121, in main
    kconfig = Kconfig(args.src_kconfig, warn_to_stderr=False)
  File "/home/damato/.local/lib/python3.10/site-packages/kconfiglib.py", line 947, in __init__
    self._init(filename, warn, warn_to_stderr, encoding)
  File "/home/damato/.local/lib/python3.10/site-packages/kconfiglib.py", line 1085, in _init
    self._parse_block(None, self.top_node, self.top_node).next = None
  File "/home/damato/.local/lib/python3.10/site-packages/kconfiglib.py", line 2989, in _parse_block
    prev = self._parse_block(None, parent, prev)
  File "/home/damato/.local/lib/python3.10/site-packages/kconfiglib.py", line 2989, in _parse_block
    prev = self._parse_block(None, parent, prev)
  File "/home/damato/.local/lib/python3.10/site-packages/kconfiglib.py", line 3091, in _parse_block
    self._parse_error(
  File "/home/damato/.local/lib/python3.10/site-packages/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
make[1]: *** [/home/damato/projekte/linux/RaspberryMatic/buildroot-external/external.mk:5: linux-check-dotconfig] Error 1

However, I could manually solve these kind of issues by manually removing the modules line in the linux/kernel/module/Kconfig file in the respective kernel sources. Thus, do you have any advice for me how to tackle that differently? And I actually wonder why this does not seem to happen for you guys? And how should the returned ::warning outputs be interpreted to better cleanup the kconfig fragment files? I wonder how you proceed with that in your project here...

Would appreciate any help!

@sairon
Copy link
Member Author

sairon commented Jan 24, 2024

I see you are probably using kconfiglib installed from PyPI (judging from python3.10/site-packages/kconfiglib.py). That is unfortunately broken for some time with recent kernels, and that's also the reason why we have it included in the HAOS repository. See #3006 for more details and references.

jens-maus added a commit to jens-maus/RaspberryMatic that referenced this pull request Jan 24, 2024
copy being used. Also retired manual install of kconfiglib package in
snapshot workflow.
(cf. home-assistant/operating-system#3104 (comment))
@jens-maus
Copy link
Contributor

Thanks, that provided me the final hint I required. Missing that you have an own version in the repository stored. Now it works as expected...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
board/generic-aarch64 Generic aarch64 machine board/generic-x86-64 Generic x86-64 Boards (like Intel NUC) board/green Home Assistant Green board/khadas Khadas VIM Boards board/odroid Hardkernel's ODROID Boards board/ova Open Virtual Appliance (Virtual Machine) board/raspberrypi Raspberry Pi Boards board/tinker ASUS' Tinker Boards board/yellow Home Assistant Yellow cla-signed linux Linux kernel related issue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants