emerge fails finding kernel includes with any non /usr/src/linux kernel. Reproducible: Always Steps to Reproduce: 1.run non default kernel. 2.emerge svgalib Actual Results: !!! ERROR: media-libs/svgalib-1.9.17-r1 failed. !!! Function check_kernel, Line 18, Exitcode 1 !!! Cannot find kernel includes! I'm running some dev kernels for testing scheduling, this is done in /local/sources/kernel so it's not in the default /usr/src/linux/include I knwo thi is really my problem, but I'm hoping to see if there is a more elegant way to handle it rather then just dying.
exactly what sort of elegance did you have in mind?
I had a look around in the ebuild. when setting the INCLUDEDIR to check the kernel includes for it uses a simple line "export INCLUDEDIR="/usr/src/linux/include" I was thinking of something more along the lines of: local KV_FULL="`uname -r`" export INCLUDEDIR="/lib/modules/${KV_FULL}/build/include" this will use the current running kernel includes for compiling. See this problem appears because the ebuild see's my running kernel as 2.5.x and tries to find the kernel source in /usr/src/linux instead of wherever it really is. Use ${KV_FULL} in the modules build dir is a much easer way to find where the kernel source used for the currenr kernel is Henti Smith I'll attach a diff for the ebuild. Henti Smith
Created attachment 9631 [details] Fixes 2.5.x kernel breaking when not in /usr/src/linux adds ${KV_FULL} and uses /lib/modules to find kernel includes. better handling of 2.5.x kernels includes esp for people running leading edge dev kernels.
Since this is a pretty rare case, why not simply add a few commands in /etc/conf.d/local.start to set a symlink to the right place. eg: rm -fr /usr/src/linux ln -sf /local/sources/kernel/linux-`uname -r` /usr/src/linux (Of course you should check that /usr/src/linux is a symlink etc..., but I'll leave the details to you)
Spoke to Seemant and since this is related to 2.5.x kernel and is still deemed unstable it's pretty pointless fixing things while it's changing .. so if it's there in 2.6 can look at it again .. in the mean time I'll make it work other ways :) henti