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

Add script for checking resulting kernel config #3006

Merged
merged 1 commit into from
Dec 20, 2023
Merged

Conversation

sairon
Copy link
Member

@sairon sairon commented Dec 20, 2023

There is bunch of kernel config options that are not propagated correctly to the kernel configuration after fragments are merged and processed by Kconfig. Current Buildroot tools are not good at discovering these - while we cleaned up most inconsistencies by using linux-diff-config and output from the merge_config.sh script, there are still options that were removed or get a different value than intended because of dependencies, etc.

This commit adds a Python script that is using Kconfiglib to parse current kernel's Kconfig files and the generated .config and compare the requested values from individual kernel config fragments. The script can be used manually by running make linux-check-dotconfig from the buildroot directory (with path to BR2_EXTERNAL directory set) and it's called also from the CI, where it generates Github Workflow warning annotations when some of the values are not present or when set incorrectly.

The kconfiglib.py is checked-in to the repo as well, because the library is currently abandoned on PyPI and packaged version has a bug that causes errors parsing Kconfigs in newer Linux versions, fixed in outstanding pull request ulfalizer/Kconfiglib#119 - so version from this PR is used here.

If pypi/support#2526 is ever resolved, we could remove it from our repo and use pip for installing the package as a requirement during build of the build container.

There is bunch of kernel config options that are not propagated
correctly to the kernel configuration after fragments are merged
and processed by Kconfig. Current Buildroot tools are not good at
discovering these - while we cleaned up most inconsistencies by using
linux-diff-config and output from the merge_config.sh script, there
are still options that were removed or get a different value than
intended because of dependencies, etc.

This commit adds a Python script that is using Kconfiglib to parse
current kernel's Kconfig files and the generated .config and compare
the requested values from individual kernel config fragments. The
script can be used manually by running `make linux-check-dotconfig`
from the buildroot directory (with path to BR2_EXTERNAL directory set)
and it's called also from the CI, where it generates Github Workflow
warning annotations when some of the values are not present or when set
incorrectly.

The kconfiglib.py is checked-in to the repo as well, because the library
is currently abandoned on PyPI and packaged version has a bug that causes
errors parsing Kconfigs in newer Linux versions, fixed in outstanding
pull request ulfalizer/Kconfiglib#119 - so version from this PR is used
here.

If pypi/support#2526 is ever resolved, we could remove it from our repo
and use pip for installing the package as a requirement during build
of the build container.
@sairon sairon added the build Build and CI related issues label Dec 20, 2023
@sairon sairon requested a review from agners December 20, 2023 12:30
Copy link
Member

@agners agners left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, very nice 👍

@sairon sairon merged commit 5a9be34 into dev Dec 20, 2023
2 checks passed
@sairon sairon deleted the dotconfig-checker branch December 20, 2023 16:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build Build and CI related issues cla-signed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants