On Tue, Mar 31, 2020 at 9:29 PM Bruce Ashfield <[email protected]> wrote:
>
> On Tue, Mar 31, 2020 at 7:56 PM Paul Burton via Lists.Openembedded.Org
> <[email protected]> wrote:
> >
> > The kernel_do_configure() function creates empty .scmversion files
> > within both the source & build directories. The presence of these files
> > causes the scm_version function within the kernel's
> > scripts/setlocalversion to always output the empty string, breaking the
> > kernel's CONFIG_LOCALVERSION_AUTO=y functionality which appends that
> > string to the kernel version. Rather than appending the git commit hash
> > or another SCM revision to the kernel version, the empty string is
> > appended causing CONFIG_LOCALVERSION_AUTO to do nothing.
> >
> > This behavior was introduced for the build directory by commit
> > c73e50a91e02 ("kernel.bbclass: fix extra + in kernelrelease") and
> > extended to the source directory by commit cafb94f57123
> > ("kernel.bbclass: touch .scmversion also in ${S}"). The motive isn't
> > entirely clear since these commits contain no meaningful descriptions
> > and the former links to a mailing list archive that is no longer online,
> > but the '+' character referenced would be appended if the kernel were
> > built from a dirty working tree. This in itself is useful information;
> > hiding that fact can only serve to muddy a user's understanding of what
> > kernel they're actually running. I have verified that building a kernel
> > from a clean working tree does not result in a spurious '+' character.
>
> I have all the original email from 2011 on the topic, Martin probably does
> as well.

Also note that in 2017 Trevor Woerner tried exactly the same fix that
you are doing, but ended up retracting it when he found a test case
that was still adding a + to the version.

see: [OE-core] [PATCH] meta/classes/kernel.bbclass: revert 56fe5300ab5

It might be worth checking with Trevor to see if he recalls what case
it was where the + snuck back in.

Cheers,

Bruce

Bruce

>
> A snippet from the conversation is this, and it is about moving some kernel
> build steps into oe-core from meta-oe:
>
> ------
> "If you're working on shared linux.inc in meta-oe, could you please
> integrate this:
>
> do_configure_prepend() {
> #otherwise it gets extra '+' "2.6.37+"
> #because:
> #$ scripts/setlocalversion . => +
> #$ make kernelversion => 2.6.37
> #$ make kernelrelease => 2.6.37+
>   rm -rf ${S}/.git
> }
>
> I have to do this in every git recipe as I don't like dirs like
> /lib/modules/2.6.37+
>
> Maybe it should be fixed on kernel.bbclass level, because linux-yocto
> suffers the same ie /lib/modules/3.0.12-yocto-standard+
>
> Ccing oe-core for that.."
> ------
>
> I didn't make any of the changes, but looking at the thread, if you aren't
> getting a + added to the localversion or directories, then I can't see how
> it would break anything.
>
> Cheers,
>
> Bruce
>
> >
> > Remove the creation of the empty .scmversion files in order to restore
> > the kernel's CONFIG_LOCALVERSION_AUTO functionality. This allows users
> > of kernels built from non-tagged source & configured with
> > CONFIG_LOCALVERSION_AUTO=y to better determine what kernel they're
> > actually running.
> >
> > Signed-off-by: Paul Burton <[email protected]>
> > ---
> >  meta/classes/kernel.bbclass | 6 ------
> >  1 file changed, 6 deletions(-)
> >
> > diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass
> > index a724645466..46e24a19e2 100644
> > --- a/meta/classes/kernel.bbclass
> > +++ b/meta/classes/kernel.bbclass
> > @@ -521,12 +521,6 @@ 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+
> > -       touch ${B}/.scmversion ${S}/.scmversion
> > -
> >         if [ "${S}" != "${B}" ] && [ -f "${S}/.config" ] && [ ! -f 
> > "${B}/.config" ]; then
> >                 mv "${S}/.config" "${B}/.config"
> >         fi
> > --
> > 2.26.0.rc2.310.g2932bb562d-goog
> >
> > 
>
>
>
> --
> - 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 (#136908): 
https://lists.openembedded.org/g/openembedded-core/message/136908
Mute This Topic: https://lists.openembedded.org/mt/72690129/21656
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub  
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to