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.
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.
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?
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).
Sorry for the double comment - it's Bugzilla "middle air collision detected" bogus message (it's often shown for collision with myself).
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.
fix comitted to cvs. please re-open if it continues.