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

classes: make localversion classes deterministic #1694

Merged
merged 1 commit into from
Nov 28, 2023
Merged

classes: make localversion classes deterministic #1694

merged 1 commit into from
Nov 28, 2023

Conversation

dwagenk
Copy link

@dwagenk dwagenk commented Nov 28, 2023

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

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

Signed-off-by: Daniel Wagenknecht <dwagenknecht@emlix.com>
@otavio otavio merged commit 0fc1504 into Freescale:master Nov 28, 2023
@jviguera
Copy link
Contributor

Hi @otavio

I think this would be great to have in LTS Kirkstone, but being honest, I'm not sure if it would have any bad side effect.

@otavio
Copy link
Member

otavio commented Nov 28, 2023

Let's way few days and we accept a backport.

Copy link

Successfully created backport PR #1695 for kirkstone.

tq-niebelm pushed a commit to tq-systems/meta-tq that referenced this pull request Dec 21, 2023
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 <dwagenknecht@emlix.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

SCMVERSION ?= "y" Image creation fails when linux-imx is populated from sstate cache.
3 participants