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

kernel: config: clean up '=n' settings #2290

Merged
merged 1 commit into from
Jul 25, 2022

Conversation

foersleo
Copy link
Contributor

Disabling a kernel config setting is usually done in a config file in
the form of

\# CONFIG_<CONFIG_NAME> is not set

instead of

CONFIG_<CONFIG_NAME>=n

While both today should be equivalent historically there was problems
with specifying '=n' still making that setting defined and having the
opposite effect of what is intended by setting '=n'. Nowadays either way
will result in a final config that will only have the `is not set`
variant for all deactivated options, so the diff of the resulting
artifact before and after this patch will be empty.

As the `is not used` form is the commonly used form, lets adhere to it.
As a bonus it reduces the noise when comparing configs that are manually
merged using the merge-config script.

Replaced all the '=n' settings by the common form through command:

for file in packages/kernel*/config*;
do
    sed -E -i "s/^(CONFIG_[A-Z0-9_]*)=n/# \1 is not set/g" $file;
done

Signed-off-by: Leonard Foerster <[email protected]>

Issue number: #2289

Description of changes:

Clean up an un-common way of disabling kernel config options. See commit message above for more detail.

Testing done:

Checked resulting config that will be installed as part of the kernel rpm before and after this patch. The diff is empty.

Terms of contribution:

By submitting this pull request, I agree that this contribution is dual-licensed under the terms of both the Apache License, version 2.0, and the MIT license.

Disabling a kernel config setting is usually done in a config file in
the form of

\# CONFIG_<CONFIG_NAME> is not set

instead of

CONFIG_<CONFIG_NAME>=n

While both today should be equivalent historically there was problems
with specifying '=n' still making that setting defined and having the
opposite effect of what is intended by setting '=n'. Nowadays either way
will result in a final config that will only have the `is not set`
variant for all deactivated options, so the diff of the resulting
artifact before and after this patch will be empty.

As the `is not used` form is the commonly used form, lets adhere to it.
As a bonus it reduces the noise when comparing configs that are manually
merged using the merge-config script.

Replaced all the '=n' settings by the common form through command:

for file in packages/kernel*/config*;
do
    sed -E -i "s/^(CONFIG_[A-Z0-9_]*)=n/# \1 is not set/g" $file;
done

Signed-off-by: Leonard Foerster <[email protected]>
Copy link
Contributor

@zmrow zmrow left a comment

Choose a reason for hiding this comment

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

🎃

@foersleo foersleo merged commit aea42b3 into bottlerocket-os:develop Jul 25, 2022
@foersleo foersleo deleted the cfg_cleanup branch July 25, 2022 08:02
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

Successfully merging this pull request may close these issues.

5 participants