classes: make localversion classes deterministic #1694
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The localversion string built into the kernel and u-boot should be deterministic. With OpenEmbedded it is common practice to apply patches to the sources. The commit id of HEAD will differ each time the patching step is rerun. With the previous implementation of the fsl-{kernel,u- boot}-localversion classes this produced non-deterministic commit ids to be used. This is undesireable, because the commit-id read from the version string during runtime is not present in the sources. It also caused problems when building out-of-tree kernel-modules if the kernel itself was taken from sstate cache but the kernel-module needed to be rebuild and retriggered the kernels do_patch task (see #961).
Rework to produce a deterministic string that will use the commit id given as SRCREV and count the number of patches applied on top.
With e.g. commit id 11aabbcc and 5 patches this will result in a version string
+g11aabbcc+p5
Fixes: #961