Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 118256 - linux-info: linux kernel eclass doesn't identify correctly kernels with different LOCALVERSION
Summary: linux-info: linux kernel eclass doesn't identify correctly kernels with diffe...
Status: RESOLVED TEST-REQUEST
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Eclasses (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo Kernel Miscellaneous
URL:
Whiteboard:
Keywords:
: 196675 (view as bug list)
Depends on:
Blocks:
 
Reported: 2006-01-08 00:28 UTC by Carlo Marcelo Arenas Belon
Modified: 2010-08-07 17:47 UTC (History)
2 users (show)

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


Attachments
patch which defines KV_LOCAL correctly so that KV_FULL matches (linux-local.patch,447 bytes, patch)
2006-01-08 00:33 UTC, Carlo Marcelo Arenas Belon
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Carlo Marcelo Arenas Belon 2006-01-08 00:28:17 UTC
problem:

LOCALVERSION is being used to identify different repositories from git, and is usually overloaded when using a locally modified kernel repository.

`modules-update rebuild` will instruct all packages which are dependant of the linux kernel to remerge using the linux-info.eclass to identify which kernel they have to build against with, and where to get the modules installed, but the kernel version detected doesn't include LOCALVERSION and therefore the modules get installed on the wrong directory.

way to replicate :

cg clone http://kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git
#configure, compile and install kernel
reboot
modules-update rebuild

the kernel version detected will be 2.6.15, which corresponds with a vanilla 2.6.15 kernel, even if `uname -r` shows 2.6.15-g???? and the modules are installed in /lib/modules/`uname -r`
Comment 1 Carlo Marcelo Arenas Belon 2006-01-08 00:33:36 UTC
Created attachment 76501 [details, diff]
patch which defines KV_LOCAL correctly so that KV_FULL matches

this patch mostly ignores several further tests and logic for KV_LOCAL which is not working correctly anyway, and as it is made to default to the right values with the setting at this time, and as tested
Comment 2 Daniel Drake (RETIRED) gentoo-dev 2006-01-11 05:52:57 UTC
Thanks for investigating. Your patch will break in the case of a seperate output directory (KV_LOCAL unconditionally overwritten on line 289), and we should fix the localversion detection rather than just declaring it as broken.

I think the current implementation is working in that it reads CONFIG_LOCALVERSION from the users .config and reads the /usr/src/linux/localversion* files. What it doesn't do is read LOCALVERSION from the top-level Makefile, and if this is an accepted way of modifying the version string (if so, it is something new) then you need to figure out at which position in the localversion it gets inserted, and modify the eclass accordingly.
Comment 3 Carlo Marcelo Arenas Belon 2006-01-17 13:02:42 UTC
the use of an automatic local identifier is triggered by the use of CONFIG_LOCALVERSION_AUTO (set by default) as shown by the following comment from the Makefile :

# If CONFIG_LOCALVERSION_AUTO is set scripts/setlocalversion is called
# and if the SCM is know a tag from the SCM is appended.
# The appended tag is determinded by the SCM used.
#
# Currently, only git is supported.
# Other SCMs can edit scripts/setlocalversion and add the appropriate
# checks as needed.

from the comments I found on the old (pre 2.6.16) kernels it seems to be a feature added around 2.6.9 and explains as the primary goal the posibility to autodetect if a tree is used for development and avoid overwriting the production tree with the same number at install time.

my comments about the test being broken (which i meant was going to be broken after my patch was applied as they are not both consistent), were related to my understanding of the heuristics being used to detect the LOCALVERSION which try to mimic what the Makefile does, instead of just "executing" the Makefile and getting the expected result from it (which can be done by using the getfilevar call as suggested on the original patch), as well as the logic and comments starting on line 276 and which rationale/comments are not clear, at least to me.

note also that the current code has a dependency issue as detailed on bug 118630 , as the tests for LOCALVERSION currently rely on the existency of .config, eventhough the test for its existence is done later, aborting the process with the wrong error, and which therefore would need to be swapped as well for a final solution, and could be part of the rationale of why the checks for LOCALVERSION are currenlty being done this way.
Comment 4 John Mylchreest (RETIRED) gentoo-dev 2006-03-03 14:25:55 UTC
This is somethign I need to look into to confirm. Until extremely recently we haven't supported git sources and was never a requirement.
Comment 5 Jakub Moc (RETIRED) gentoo-dev 2007-10-21 23:10:29 UTC
*** Bug 196675 has been marked as a duplicate of this bug. ***
Comment 6 Jakub Moc (RETIRED) gentoo-dev 2007-10-24 08:51:11 UTC
*** Bug 196675 has been marked as a duplicate of this bug. ***
Comment 7 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2010-08-07 17:47:27 UTC
Please sync and retest, the code has changed a lot since this bug was opened.