From 57b8a1adb54a3adab22f4e04ced66a92ffc78a96 Mon Sep 17 00:00:00 2001 From: Ming Liu Date: Thu, 22 Feb 2024 11:35:43 +0100 Subject: kernel.bbclass: introduce KERNEL_LOCALVERSION 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. (From OE-Core rev: 29a0d2a49df8e24f3948a2ddf03743f0cb5d09dd) Signed-off-by: Ming Liu Signed-off-by: Alexandre Belloni Signed-off-by: Richard Purdie cherry-picked from master 229435a52f36ddec5f85fb6d5ccd42044b688397 Signed-off-by: Andreas Helbech Kleist Signed-off-by: Steve Sakoman --- meta/classes/kernel.bbclass | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'meta/classes/kernel.bbclass') diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass index 5951347361..80fb1879b0 100644 --- a/meta/classes/kernel.bbclass +++ b/meta/classes/kernel.bbclass @@ -614,6 +614,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() { @@ -635,7 +636,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" -- cgit v1.2.3-54-g00ecf