]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core.git/commitdiff
kernel.bbclass: introduce KERNEL_LOCALVERSION
authorMing Liu <liu.ming50@gmail.com>
Tue, 30 May 2023 20:15:40 +0000 (22:15 +0200)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 1 Jun 2023 07:04:14 +0000 (08:04 +0100)
Just like UBOOT_LOCALVERSION, an end user can set KERNEL_LOCALVERSION
to append a string to the name of the local version of the kernel
image.

Signed-off-by: Ming Liu <liu.ming50@gmail.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/classes-recipe/kernel.bbclass
meta/conf/documentation.conf

index 4bce64cf6ae50a78e87084be3ed36349082f47bd..271ce6c4737a2c58599ed6901589f074f0850eb1 100644 (file)
@@ -618,6 +618,7 @@ do_shared_workdir () {
 # We don't need to stage anything, not the modules/firmware since those would clash with linux-firmware
 SYSROOT_DIRS = ""
 
+KERNEL_LOCALVERSION ??= ""
 KERNEL_CONFIG_COMMAND ?= "oe_runmake_call -C ${S} O=${B} olddefconfig || oe_runmake -C ${S} O=${B} oldnoconfig"
 
 python check_oldest_kernel() {
@@ -639,7 +640,10 @@ kernel_do_configure() {
        # $ scripts/setlocalversion . => +
        # $ make kernelversion => 2.6.37
        # $ make kernelrelease => 2.6.37+
-       touch ${B}/.scmversion ${S}/.scmversion
+       if [ ! -e ${B}/.scmversion -a ! -e ${S}/.scmversion ]; then
+               echo ${KERNEL_LOCALVERSION} > ${B}/.scmversion
+               echo ${KERNEL_LOCALVERSION} > ${S}/.scmversion
+       fi
 
        if [ "${S}" != "${B}" ] && [ -f "${S}/.config" ] && [ ! -f "${B}/.config" ]; then
                mv "${S}/.config" "${B}/.config"
index a27d7a53c3663a4972f4c7220ab59550b213c2a7..66b8e2f24fdc31846a2255e82239be70b9c4d8f6 100644 (file)
@@ -253,6 +253,7 @@ KERNEL_MODULE_PROBECONF[doc] = "Lists kernel modules for which the build system
 KERNEL_PACKAGE_NAME[doc] = "Name prefix for kernel packages. Defaults to 'kernel'."
 KERNEL_PATH[doc] = "The location of the kernel sources. This variable is set to the value of the STAGING_KERNEL_DIR within the module class (module.bbclass)."
 KERNEL_SRC[doc] = "The location of the kernel sources. This variable is set to the value of the STAGING_KERNEL_DIR within the module class (module.bbclass)."
+KERNEL_LOCALVERSION[doc] = "Appends a string to the name of the local version of the kernel image."
 KFEATURE_DESCRIPTION[doc] = "Provides a short description of a configuration fragment. You use this variable in the .scc file that describes a configuration fragment file."
 KMACHINE[doc] = "The machine as known by the kernel."
 KTYPE[doc] = "Defines the kernel type to be used in assembling the configuration."