When lm-sensors is compiling, it gets i2c headers from /usr/src/linux/include/linux/ rather than from /usr/include/linux. I have a kernel in /usr/src/linux with i2c 2.6.1, and I've emerged i2c 2.7.0. When I emerge lm-sensors 2.7.0, it complains that I have an old version of i2c because it is grabbing the old headers from the kernel source tree rather than from /usr/include/linux (where i2c 2.7.0 installed its headers to). Reproducible: Always Steps to Reproduce: 1. 2. 3.
Marius Reiner <marius.reiner@hdev.de> suggests http://www2.lm-sensors.nu/~lm78/readticket.cgi?ticket=1189 as a solution.
Should be fixed now.
Ooops, this introduces another problem.... modprobe i2c-isa /lib/modules/2.4.21/misc/i2c-isa.o: kernel-module version mismatch /lib/modules/2.4.21/misc/i2c-isa.o was compiled for kernel version 2.4.19 while this kernel is version 2.4.21. So.... pointing to /usr/include/linux gives me too old includes (general), pointing to the kernel gives me too old includes (i2c-related)...
I did a quick+dirty fix for 2.7.0-r1 which copies the i2c includes to some temporary directory before building (get includes there first, then check in the kernel tree instead of getting the linux-headers files). Seems to work, but I don't like it. Comments?
My situation is exactly the other way round: $ grep I2C_VERSION /usr/include/linux/i2c.h #define I2C_VERSION "2.6.1" $ grep I2C_VERSION /usr/src/linux/include/linux/i2c.h #define I2C_VERSION "2.7.0" So, when compiling lm-sensors-2.7.0-r1 the _old_ includes are copied. Maybe the problem is the old includes? I have gentoo-sources 2.4.20-r6 and linux-headers 2.4.19-r1 which was pulled in as a dependency (why not 2.4.20?)
If you don't use the BTTV or anything kernel-i2c-dependant try the 2.8.0 i2c and the 2.8.0 lm_sensors. I think this is because of a bug in the Makefile of the I2C stuff.
2.4.19 headers are the latest, from the glibc point of view.
Renat, I guess your i2c headers were overwritten by linux-headers. Please try re-emerging the package which provides the right includes, whatever that was (try epm -qf /usr/include/linux/i2c.h to see which packages provided it). I don't see a proper way to deal with this problem. You can't take the includes from /usr/include/linux since linux-headers overwrites them. You can't take them from the real kernel sources because maybe someone uses the i2c package which puts them where linux-headers puts them, too. Any idea? I think we're in need of some magic here.
I2C provides the headers so remerge that... I2C 2.7.0 uses /usr/include/linux [ wrongly ] so you need to install I2C even if you have a patched kernel to get the headers UNLESS you will copy your gentoo-headers in /usr/src/linux-...../include/linux over to /usr/include/linux manually. lm-sensors then takes those I2C headers in /usr/include/linux and strips them and moves them to a temporary directory... The actual kernel to use is automatically chosen by the Makefile and uses the current kernel, not the /usr/src/linux in 2.7.0. Includes go to /usr/include/linux not dependant of the kernel version. Try 2.8.0, problems are fixed in there...
Here is what I get: $ epm -qf /usr/include/linux/i2c.h linux-headers-2.4.19-r1 i2c-2.7.0 Looking at emerge.log shows that linux-headers were emerged almost two months after i2c, so it seems like i2c includes got overwritten by linux-headers. The interesting thing is that i2c-2.7.0.ebuild puts the includes in /usr/include/linux while the Makefile puts it to /usr/src/linux/include/linux. So the right (or are they wrong? I'm confused) default settings get overridden by the ebuild, if I understood that correctly. Remerging i2c did the trick though.
Resolving. The Makefile puts them in $LINUX/include/... $LINUX is autodiscovered by the Makefile, it uses `uname -r` for that. The ebuild does not override that. It does override which headers are *used for the compile* and where headers are installed [/usr/include/linux].
Brandon, I'd like you to comment on the "where should the includes go" issue.
Patrick: Includes should always go in /usr/include/... as you may run different kernels, while needing a shared set of includes. The kernel used should be /usr/src/linux, this isn't the case in 2.7.0, 2.8.0 fixes this...