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

Config generation fixes #2037

Merged
merged 4 commits into from
Jun 2, 2020
Merged

Config generation fixes #2037

merged 4 commits into from
Jun 2, 2020

Conversation

neocturne
Copy link
Member

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.

@neocturne neocturne added 0. type: enhancement The changeset is an enhancement 2. status: waiting-on-review Awaiting review from the assignee but also interested parties. 3. topic: build This is about the build system labels May 28, 2020
@neocturne neocturne requested a review from blocktrron May 28, 2020 19:00
@rotanid rotanid mentioned this pull request May 30, 2020
2 tasks
neocturne added 4 commits May 31, 2020 02:20
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).
@neocturne
Copy link
Member Author

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 next.

Copy link
Member

@blocktrron blocktrron left a comment

Choose a reason for hiding this comment

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

LGTM

@neocturne neocturne merged commit d310779 into master Jun 2, 2020
@neocturne neocturne deleted the config-gen branch June 2, 2020 19:24
@rotanid rotanid removed the 2. status: waiting-on-review Awaiting review from the assignee but also interested parties. label Jun 2, 2020
@rotanid rotanid added this to the 2020.2 milestone Jun 2, 2020
@rotanid rotanid added the 5. needs: stable backport The changeset need to be backported to supported stable releases label Jun 11, 2020
@rotanid
Copy link
Member

rotanid commented Jun 11, 2020

this needs to be backported to v2020.2.x in order to be able to backport #2051

@neocturne
Copy link
Member Author

@rotanid This PR was merged before v2020.2.x was branched.

@neocturne neocturne removed the 5. needs: stable backport The changeset need to be backported to supported stable releases label Jun 11, 2020
@rotanid
Copy link
Member

rotanid commented Jun 11, 2020

@NeoRaider d'oh, sorry.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0. type: enhancement The changeset is an enhancement 3. topic: build This is about the build system
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants