Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 521778 - genkernel startup prints wrong version (shows version based on last build)
Summary: genkernel startup prints wrong version (shows version based on last build)
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Hosted Projects
Classification: Unclassified
Component: genkernel (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Genkernel Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-08-30 20:57 UTC by Paige Thompson
Modified: 2019-03-28 23:43 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Paige Thompson 2014-08-30 20:57:49 UTC
genkernel --config=/etc/genkernel.vanilla.conf --kernel-config=/etc/kernels/kernel-config-x86_64-3.16.1-gentoo-vanilla --menuconfig all

 

* Gentoo Linux Genkernel; Version 3.4.49.2

* Running with options: --config=/etc/genkernel.vanilla.conf --kernel-config=/etc/kernels/kernel-config-x86_64-3.16.1-gentoo-vanilla --menuconfig all

* Using genkernel.conf from /etc/genkernel.vanilla.conf

* Sourcing arch-specific config.sh from /usr/share/genkernel/arch/x86_64/config.sh ..

* Sourcing arch-specific modules_load from /usr/share/genkernel/arch/x86_64/modules_load ..

* Linux Kernel 3.16.1-gentoo for x86_64...

* .. with config file /etc/kernels/kernel-config-x86_64-3.16.1-gentoo-vanilla

* kernel: Using config from /etc/kernels/kernel-config-x86_64-3.16.1-gentoo-vanilla

*         Previous config backed up to .config--2014-08-30--13-53-08.bak

* kernel: >> Running mrproper...


then you build it finishes ... then you run..... 


windowlicker etc # genkernel --config=/etc/genkernel.debug.conf --kernel-config=/etc/kernels/kernel-config-x86_64-3.16.1-gentoo-debug --menuconfig all

* Gentoo Linux Genkernel; Version 3.4.49.2

* Running with options: --config=/etc/genkernel.debug.conf --kernel-config=/etc/kernels/kernel-config-x86_64-3.16.1-gentoo-debug --menuconfig all

* Using genkernel.conf from /etc/genkernel.debug.conf

* Sourcing arch-specific config.sh from /usr/share/genkernel/arch/x86_64/config.sh ..

* Sourcing arch-specific modules_load from /usr/share/genkernel/arch/x86_64/modules_load ..

* Linux Kernel 3.16.1-gentoo-vanilla for x86_64... <----- wrong

* .. with config file /etc/kernels/kernel-config-x86_64-3.16.1-gentoo-debug

* kernel: Using config from /etc/kernels/kernel-config-x86_64-3.16.1-gentoo-debug

*         Previous config backed up to .config--2014-08-30--14-15-39.bak

* kernel: >> Running mrproper...

*         >> Running oldconfig...

* kernel: >> Cleaning...

Its not really a big deal rather the consequence of genkernel telling you what version of the linux kernel its building before running make mrproper, after it starts menuconfig and you go into (General setup -> () Local version - append to kernel release): the value is empty as it should be.

Reproducible: Always
Comment 1 Ben Kohler gentoo-dev 2017-09-07 19:21:50 UTC
I believe this happens because KV (kernel version) is set based on kerncache.config rather than the live Makefile, when KERNCACHE is found from a previous run.

This code is in /usr/share/genkernel/gen_determineargs.sh

I'm not sure that we gain anything, performance-wise, by pulling these values from kerncache.config rather than the live Makefile.

Thoughts on this, genkernel team and original reporter?
Comment 2 Ben Kohler gentoo-dev 2017-09-07 20:28:06 UTC
Is this a dupe of bug 263927?
Comment 3 Larry the Git Cow gentoo-dev 2019-03-28 23:43:05 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/proj/genkernel.git/commit/?id=3abb33bf0e12e38f453e262392572b0c6d47ea7c

commit 3abb33bf0e12e38f453e262392572b0c6d47ea7c
Author:     Thomas Deutschmann <whissi@gentoo.org>
AuthorDate: 2019-03-28 20:37:17 +0000
Commit:     Thomas Deutschmann <whissi@gentoo.org>
CommitDate: 2019-03-28 20:37:17 +0000

    genkernel: tell user that shown kernel version is subject to change
    
    When you start with fresh (unused) kernel sources, we will get Kernel
    Version from KERNEL_DIR. If you already have compiled that KV, genkernel
    maybe use your existing configuration from /etc/kernels (depends on other
    settings like --mrproper).
    
    Once your new kernel was built and you are saving configs (--save-config),
    we will save the used configuration in /etc/kernels/kernel-config-${ARCH}-${KV}.
    
    If you used --menuconfig during genkernel run to change kernel options like
    CONFIG_LOCALVERSION or CONFIG_LOCALVERSION_AUTO or have modified kernel's
    Makefile manually to change version, KV is subject to change once
    genkernel has called 'make prepare'.
    
    With this change we will tell user when KV has changed to end confusion like
    shown in bug 521778.
    
    Closes: https://bugs.gentoo.org/521778
    Closes: https://bugs.gentoo.org/352787
    Closes: https://bugs.gentoo.org/263927
    Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>

 genkernel | 28 ++++++++++++++++++++++------
 1 file changed, 22 insertions(+), 6 deletions(-)

Additionally, it has been referenced in the following commit(s):

https://gitweb.gentoo.org/proj/genkernel.git/commit/?id=58a57b303efb9fb5ce60c0dc40c806e7d7b46db0

commit 58a57b303efb9fb5ce60c0dc40c806e7d7b46db0
Author:     Thomas Deutschmann <whissi@gentoo.org>
AuthorDate: 2019-03-28 20:04:21 +0000
Commit:     Thomas Deutschmann <whissi@gentoo.org>
CommitDate: 2019-03-28 20:04:21 +0000

    get_KV(): refactoring how we determine KV
    
    - Fix handling O= builds (--kernel-outputdir):
      Patch (commit 8de731164496d09384d8be81a3f22316230deb65) from bug 238707
      has probably never worked:
    
      There's no MAKEARGS in $KERNEL_DIR/Makefile...
    
      It is enough to read include/linux/version.h or include/linux/utsrelease.h
      from $KERNEL_OUTPUTDIR which is either set to $KERNEL_DIR or is a separate
      directory in which case there will be no files created in $KERNEL_DIR.
    
    - Set marker if KV will change to allow for user notification to avoid confusion.
    
    Bug: https://bugs.gentoo.org/521778
    Bug: https://bugs.gentoo.org/352787
    Bug: https://bugs.gentoo.org/263927
    Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>

 gen_determineargs.sh | 50 +++++++++++++++++++++++++++++---------------------
 1 file changed, 29 insertions(+), 21 deletions(-)