-
Notifications
You must be signed in to change notification settings - Fork 324
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
Config generation fixes #2037
Config generation fixes #2037
Conversation
So far, we were using a sort operation on the generated .config to implement precedence of =y packages over =m, and =m over unset. Unfortunately, this sort not only used for packages, but for all config lines. This made it impossible to override settings from targets/generic in a target config when the new setting was sorted before the generic setting. To fix this, track configurations by their keys, so we can properly override config keys that were set before. Value-based precedence is only preserved for package configuration. The config() and try_config() calls always take key and value as separate arguments now. Strings are quoted automatically; the values true, nil and false map to y, m and unset for tristate options. config() can take an optional third argument to override the error message to display when the setting fails to apply. All existing target configs generate the same .config with the old and the new code. The new code is also a bit faster on targets with many devices.
target_config.lua and target_config_check.lua don't pass a table of callbacks anymore, so target_config_lib.lua can by simplified by moving all the code that was in the returned function to the toplevel.
… and extra images manifest_aliases only make sense for sysupgrade images.
By passing a table instead of a single string, multiple different extensions can be specified, each refering to a separate image file generated by OpenWrt. This is not supported for sysupgrade (as there can only be a single image in the format expected by OpenWrt).
I have pushed 2 more commits to this branch: one minor cleanup, and one that will be used to provide VMDK and VDI images for x86 in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
this needs to be backported to v2020.2.x in order to be able to backport #2051 |
@rotanid This PR was merged before v2020.2.x was branched. |
@NeoRaider d'oh, sorry. |
As noted in #2036, precedence of different
.config
settings in generic and target-specific config is resolved in a quite surprising way: Rather than using the value that is set last, the "greatest" value when sorted as strings is used. This PR fixes the behaviour.See also the commit message of the first patch for further details.
With all current target configurations, the generated .config is unchanged with this PR.