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

Fix manage-config option comparison issue #179

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

kuanyu99
Copy link

  • What I did

To make manage-config able to compare string type kernel options.

  • How I did it

Use sed to remove the double quote at prefix and suffix of the option value if it exists.

  • How to verify it

Take CONFIG_MODULE_SIG_KEY="debian/certs/test.pem" in kconfig-inclusions for example.
Originally, if I give a kernel options with a double quoted string type value, it will return comparison failure.

Checking added kernel options...
Option CONFIG_MODULE_SIG_KEY should be set to ["debian/certs/test.pem"] instead of [debian/certs/test.pem]

After modification, it can pass the verification.

* If the option value of the kconfig-inclusions is a string with double quotes, remove it before value comparison to prevent failure.
@lguohan
Copy link
Contributor

lguohan commented Dec 17, 2020

are we expecting to have quote in the kconfig? why do you need to pass the quote?

@kuanyu99
Copy link
Author

are we expecting to have quote in the kconfig? why do you need to pass the quote?

If there is no quote between the string, it will be come like this.

Checking added kernel options...
Option CONFIG_MODULE_SIG_KEY should be set to [debian/certs/test.pem] instead of []

The debian/build/build_amd64_none_amd64/.config can't correctly generated. It will become like CONFIG_MODULE_SIG_KEY="".
Seems the slash inside the string mess up the script if no double quote it.

manage-config Outdated Show resolved Hide resolved
@paulmenzel
Copy link
Contributor

If you added the example from the merge/pull request description to the commit message, that would be awesome.

* Use parameter expression to remove the double quotes between the string value instead of using sed
* This commit can fix following parsing error

Originally, take CONFIG_MODULE_SIG_KEY="debian/certs/test.pem" in kconfig-inclusions for example, it will return error like this.
```
Checking added kernel options...
Option CONFIG_MODULE_SIG_KEY should be set to ["debian/certs/test.pem"] instead of [debian/certs/test.pem]
```

If set string type value without quotes, CONFIG_MODULE_SIG_KEY=debian/certs/test.pem, it will also return error like this.
```
Checking added kernel options...
Option CONFIG_MODULE_SIG_KEY should be set to [debian/certs/test.pem] instead of []
```
@jarias-lfx
Copy link

/easycla

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.

4 participants