Commit Graph

12 Commits

Author SHA1 Message Date
Max Krummenacher
16a356ef0d fsl-kernel-localversion: fix SRCREV_machine and AUTOREV use cases
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_kernel_localversion fails

| run.do_kernel_localversion:158 exit 128 from 'head=`git --git-dir=.../.git rev-parse --verify --short INVALID 2> /dev/null`'

Cope with both use cases.

Fixes: 41537394 ("classes: make localversion classes deterministic")
Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
2023-12-04 15:16:51 +01:00
Daniel Wagenknecht
415373942a classes: make localversion classes deterministic
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: https://github.com/Freescale/meta-freescale/issues/961

Signed-off-by: Daniel Wagenknecht <dwagenknecht@emlix.com>
2023-11-28 12:05:41 +01:00
Javier Viguera
e5401e6aeb fsl-kernel-localversion: fix regression setting LOCALVERSION
CONFIG_LOCALVERSION is a string setting. It needs to go between quotes in
the .config file.

$ grep CONFIG_LOCALVERSION= .config
CONFIG_LOCALVERSION="-dey"

Signed-off-by: Javier Viguera <javier.viguera@digi.com>
Signed-off-by: Oleksandr Suvorov <oleksandr.suvorov@foundries.io>
2023-06-19 15:06:24 +03:00
Francesco Valla
5d96d63456 classes: fsl-kernel-localversion: fix usage with devtool
Make fsl-kernel-localversion devtool-compatible, avoiding to depend on
${WORKDIR}/defconfig to be present. Two approaches are taken:

- for recipes inheriting kernel-yocto, LINUX_VERSION_EXTENSION is set to
  LOCALVERSION; in this way, the do_kernel_configme task will use it to
  set CONFIG_LOCALVERSION once the .config file is generated;

- for recipes not inheriting kernel-yocto, CONFIG_LOCALVERSION is simply
  appended to the .config file contained inside the build directory.

The do_kernel_localversion is being made executed after do_kernel_configme
rather than do_kernel_metadata; in this way, modifications are applied
after the config-by-fragments step has already been performed.

Signed-off-by: Francesco Valla <valla.francesco@gmail.com>
2022-07-31 16:48:22 +02:00
Otavio Salvador
5943060c8e classes: fsl-kernel-localversion: Fix config fragments apply
We have to ensure the task run do_kernel_metadata so the config
fragments can be applied properly.

Refs: #707.
Fixes: #733.
Fixes: 49299998 ("classes: fsl-kernel-localversion: Fix task dependency")
Fixes: c7e23876 ("linux-imx.inc: inherit kernel-yocto class")
Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
2021-04-17 22:12:52 -03:00
Otavio Salvador
4929999861 classes: fsl-kernel-localversion: Fix task dependency
We need to do any change to the generated `.config` file after it is
finished to be modified. In the case of `kernel-yocto` class being in use,
we need to do it after `kernel_configme` task.

Fixes: c7e23876 ("linux-imx.inc: inherit kernel-yocto class")
Fixes: #707.
Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
Change-Id: I7d32b47595dff269defdc5b3f98aa0b9d89b603a
2021-04-10 10:07:02 -03:00
Ming Liu
c25cd3a636 fsl-kernel-localversion.bbclass: add preconfigure after do_kernel_metadata
do_preconfigure task should run after do_kernel_metadata, or else there
might be no ${WORKDIR}/defconfig present when KBUILD_DEFCONFIG is being
set rather than defconfig added in SRC_URI.

Signed-off-by: Ming Liu <liu.ming50@gmail.com>
2020-11-10 16:23:16 -03:00
Jan Vermaete
351b810569 fsl-kernel-localversion.bbclass: Allow disabling SCMVERSION
Do not add the short git hash to the kernel name when SCMVERSION is
not set.

Change-Id: I15bf597eab3a811846f3bb28a95b0f8f8a393483
Signed-off-by: Jan Vermaete <jver@oip.be>
Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
2018-04-26 14:41:19 -03:00
Mats Karrman
3b7f5a0069 fsl-kernel-localversion: Add preconfigure dependency on do_unpack
Even if 'externalsrc' is used, SRC_URI may specify a 'defconfig'.
However as the use of 'externalsrc' will do away with the do_patch
task, do_preconfigure is in risk of being run before the defconfig
is copied to the build directory. This patch adds a second dependency
on 'do_unpack' that makes sure this does not happen.

Signed-off-by: Mats Karrman <mats.dev.list@gmail.com>
Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
2017-04-30 16:50:39 -03:00
Fabio Berton
bca37f5e25 fsl-kernel-localversion: Make sure build dir exist before create .config
Create directory ${B} before do_preconfigure task creates file ${B}/.config

Fix error:

../fsl-community-bsp/build/tmp/work/imx6slevk-poky-linux-gnueabi/linux-fslc-imx/
4.1-1.0.x+gitAUTOINC+0c0844f9fa-r0/temp/run.do_preconfigure.16220:
line 109: ../fsl-community-bsp/build/tmp/work/imx6slevk-poky-linux-gnueabi/
linux-fslc-imx/4.1-1.0.x+gitAUTOINC+0c0844f9fa-r0/build/.config:
No such file or directory

Signed-off-by: Fabio Berton <fabio.berton@ossystems.com.br>
Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
2016-08-12 11:38:59 -03:00
Adrian Dudau
6b1e444220 fsl-kernel-localversion: Configure kernel in a separate task
As it is implemented right now this class overwrites the .config file
making it impossible for any other layer to configure the kernel in a
.bbappend to the kernel recipe. By doing it in a separate task before
do_configure we ensure that recipe .bbappends can make further kernel
configurations in do_configure_prepend.

Signed-off-by: Adrian Dudau <adrian.dudau@enea.com>
Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
2016-06-27 07:53:36 -03:00
Otavio Salvador
f8517afc7a Move meta-fsl-arm content to layer root
The meta-fsl-arm is going to be used as the base for this layer. It
contains a clean history and allowing a more granullar set of changes.

This commit is just a rename of all contents of meta-fsl-arm
subdirectory to this layer's root, subsequent changes are based on top
of that.

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
2015-07-16 15:01:29 -03:00