-
Notifications
You must be signed in to change notification settings - Fork 5
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
linux-tq: make localversion deterministic #6
Conversation
I'd suggest not merging this for now, there is some discussion in Freescale/meta-freescale#961 about it breaking |
Thanks for the Pull Request. But the author is the commit is messed up: Now that the meta-freescale Backport has been merged Freescale/meta-freescale#1695. I will pick this one and add a similar change for |
@dwagenk An additional note: Could you also integrate the change from Freescale/meta-freescale@84c08eb on top? |
The localversion string built into the kernel 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 do_set_localversion_tq task 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 this issue in meta-freescale, that was due to a similar localversion modification Freescale/meta-freescale#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 Related: Freescale/meta-freescale#1694 Signed-off-by: Daniel Wagenknecht <[email protected]>
Depending on how one uses the Yocto kernel classes the kernels hash is defined in either "SRCREV_machine" or "SRCREV". If "SRCREV_machine" is in use, "SRCREV" stays at its bitbake default "INVALID". If the "SRCREV_machine" or "SRCREV" is set to "AUTOREV" that value is replaced by "AUTOINC". If using "SRCREV_machine" and/or "AUTOREV" do_set_localversion_tq fails. Cope with both use cases. Adapted from meta-freescale commit 16a356ef0d5d62090e84530e125ea6952994aaeb by Max Krummenacher <[email protected]> Signed-off-by: Daniel Wagenknecht <[email protected]>
@tq-steina addressed the commit author and imported the additional commit for AUTOINC from meta-freescale. Also fixed the task order, so the localversion task runs after the patch task. Tested with linux-imx-tq_6.1 and with the same recipe but SRCREV set to |
Thanks a lot for the contribution. Your patches have passed our internal review and integration and are integrated in kirkstone branch. Once they are publishedon github. I'll close this pull request. Thanks again |
The localversion string built into the kernel 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 do_set_localversion_tq task 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 this issue in meta-freescale, that was due to a similar localversion modification
Freescale/meta-freescale#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
Related: Freescale/meta-freescale#1694