On Tue, May 30, 2023 at 3:58 PM Ming Liu <[email protected]> wrote: > > Hi, Bruce: > > Please see my answers as below: > > > You've confirmed that the result is the same as the touches previously did > > when that variable isn't set ? > > Yes, I have verified that on a qemuarm64 machine. > > > Those comments are still valid > > I think after we introduce KERNEL_LOCALVERSION, then we generate the > .scmversion on purpose, not as a workaround or fix so those comments not > valid any more? >
They are definitely still valid. The files need to exist, or the + gets added. Other layers and kernel recipes have been touching and using those files in their own way, the kernel.bbclass was just a default to ensure if they didn't handle it, that those noise wouldn't be generated. That variable is completely optional, so we are not always generating it on purpose. Also CONFIG_LOCALVERSION is used by linux-yocto and other recipes, so the default of empty to ensure that nothing is added by kbuild is the case, and also makes them valid. Bruce > the best, > thank you > > > Bruce Ashfield <[email protected]> 於 2023年5月30日 週二 下午7:21寫道: >> >> On Tue, May 30, 2023 at 1:10 PM Ming Liu <[email protected]> wrote: >> > >> > From: Ming Liu <[email protected]> >> > >> > 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 <[email protected]> >> > --- >> > meta/classes-recipe/kernel.bbclass | 10 +++++----- >> > meta/conf/documentation.conf | 1 + >> > 2 files changed, 6 insertions(+), 5 deletions(-) >> > >> > diff --git a/meta/classes-recipe/kernel.bbclass >> > b/meta/classes-recipe/kernel.bbclass >> > index e634eabd49..3dd139eda9 100644 >> > --- a/meta/classes-recipe/kernel.bbclass >> > +++ b/meta/classes-recipe/kernel.bbclass >> > @@ -616,6 +616,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() { >> > @@ -633,11 +634,10 @@ check_oldest_kernel[vardepsexclude] += >> > "OLDEST_KERNEL KERNEL_VERSION" >> > do_configure[prefuncs] += "check_oldest_kernel" >> > >> > kernel_do_configure() { >> > - # fixes extra + in /lib/modules/2.6.37+ >> > - # $ scripts/setlocalversion . => + >> > - # $ make kernelversion => 2.6.37 >> > - # $ make kernelrelease => 2.6.37+ >> >> Those comments are still valid. >> >> > - 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 >> >> You've confirmed that the result is the same as the touches previously >> did when that variable isn't set ? >> >> Bruce >> >> > >> > if [ "${S}" != "${B}" ] && [ -f "${S}/.config" ] && [ ! -f >> > "${B}/.config" ]; then >> > mv "${S}/.config" "${B}/.config" >> > diff --git a/meta/conf/documentation.conf b/meta/conf/documentation.conf >> > index a27d7a53c3..66b8e2f24f 100644 >> > --- a/meta/conf/documentation.conf >> > +++ b/meta/conf/documentation.conf >> > @@ -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." >> > -- >> > 2.25.1 >> > >> > >> > >> > >> >> >> -- >> - Thou shalt not follow the NULL pointer, for chaos and madness await >> thee at its end >> - "Use the force Harry" - Gandalf, Star Trek II -- - Thou shalt not follow the NULL pointer, for chaos and madness await thee at its end - "Use the force Harry" - Gandalf, Star Trek II
-=-=-=-=-=-=-=-=-=-=-=- Links: You receive all messages sent to this group. View/Reply Online (#181947): https://lists.openembedded.org/g/openembedded-core/message/181947 Mute This Topic: https://lists.openembedded.org/mt/99224358/21656 Group Owner: [email protected] Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [[email protected]] -=-=-=-=-=-=-=-=-=-=-=-
