Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 109233 - Bad localversion handling when using KBUILD_OUTPUT in linux-info.eclass
Summary: Bad localversion handling when using KBUILD_OUTPUT in linux-info.eclass
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Eclasses (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: John Mylchreest (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-10-13 17:34 UTC by BlaisorBlade
Modified: 2005-12-30 10:20 UTC (History)
0 users

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


Attachments
Fix for the problem (fix-portage-kernel-kbuild_output,557 bytes, patch)
2005-10-13 17:45 UTC, BlaisorBlade
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description BlaisorBlade 2005-10-13 17:34:34 UTC
get_version incorrectly handles localversion-* - it looks for them in the build
output directory, while those files are normally created by patches, and
therefore in the source tree.

This prevents correct version detection, and disallows correct installation of
modules.

Btw, why do we install the module? Shouldn't this be left to make
modules_install INSTALL_MOD_PATH=/var/tmp/image...., which already contains the
code to correctly determine the kernel version and install kernel modules?

Reproducible: Always
Steps to Reproduce:
1.
2.
3.
Comment 1 BlaisorBlade 2005-10-13 17:45:10 UTC
Created attachment 70620 [details, diff]
Fix for the problem

This is the fix I'm talking about. Please merge. I've been using it for the
past two weeks.
Comment 2 John Mylchreest (RETIRED) gentoo-dev 2005-10-14 10:11:43 UTC
This is also wrong.
LOCALVERSION is actually made up of

localver := $(objtree)/localversion* $(srctree)/localversion
localver := $(sort $(wildcard $(localver))

so what really needs to change is from:
KV_LOCAL="${KV_LOCAL}$(get_localversion ${KV_OUT_DIR})"

to:
KV_LOCAL="${KV_LOCAL}$(get_localversion ${KV_OUT_DIR})"
[[ ${KV_OUT_DIR} != ${KV_DIR}} ]] && KV_LOCAL="${KV_LOCAL}$(get_localversion
${KV_DIR})"

however since my testing with KBUILD_OUTPUT was obviously slightly flawed,
thanks for pointing this out :)
I will get this put in shortly, but first would you like to test this out and
let me know how you get on?
Comment 3 BlaisorBlade 2005-12-20 11:23:01 UTC
I'm sorry - I didn't notice the request to test the change first...

You're right on the correction. I didn't check the code fully and/or I deemed checking $OUT/localversion-* unnecessary. However it may have uses.

However, I afterwards noticed another thing too - we're not using /lib/modules/`uname -r`/{build,source}. They (in particular source) exist since some versions (I'd say 2.6.5? if needed can be found on lwn.net Kernel page, probably), and should be used instead of needing KBUILD_OUTPUT env. var passed.

The user can freely override that, and should be forced to use KBUILD_OUTPUT for older kernels (if they're still supported, but there's no big complexity in keeping them safe).
Comment 4 BlaisorBlade 2005-12-20 11:23:38 UTC
I'm sorry - I didn't notice the request to test the change first...

You're right on the correction. I didn't check the code fully and/or I deemed checking $OUT/localversion-* unnecessary. However it may have uses.

However, I afterwards noticed another thing too - we're not using /lib/modules/`uname -r`/{build,source}. They (in particular source) exist since some versions (I'd say 2.6.5? if needed can be found on lwn.net Kernel page, probably), and should be used instead of needing KBUILD_OUTPUT env. var passed.

The user can freely override that, and should be forced to use KBUILD_OUTPUT for older kernels (if they're still supported, but there's no big complexity in keeping them safe).
Comment 5 BlaisorBlade 2005-12-20 11:24:37 UTC
Sorry for the double comment - it's Bugzilla "middle air collision detected" bogus message (it's often shown for collision with myself).
Comment 6 John Mylchreest (RETIRED) gentoo-dev 2005-12-26 07:23:43 UTC
the big reason for doing it how we currently do it, is to totally avoid the use of uname specifics. Using KBUILD_OUTPUT specifically allows you to redirect the output to anywhere you would like, and this could comfortably be somewhere other than the build symlink. Assuming I understand your query correctly.

Were you able to confirm the above change working?\
Happy xmas, and a good new year.
Comment 7 John Mylchreest (RETIRED) gentoo-dev 2005-12-30 10:20:57 UTC
fix comitted to cvs. please re-open if it continues.