Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 22698 - lm-sensors grabs wrong i2c headers
Summary: lm-sensors grabs wrong i2c headers
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: x86-kernel@gentoo.org (DEPRECATED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-06-12 13:50 UTC by Jeremy Huddleston (RETIRED)
Modified: 2003-08-19 05:47 UTC (History)
2 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jeremy Huddleston (RETIRED) gentoo-dev 2003-06-12 13:50:30 UTC
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.
Comment 1 Patrick Kursawe (RETIRED) gentoo-dev 2003-06-16 02:29:33 UTC
Marius Reiner <marius.reiner@hdev.de> suggests
http://www2.lm-sensors.nu/~lm78/readticket.cgi?ticket=1189
as a solution.
Comment 2 Patrick Kursawe (RETIRED) gentoo-dev 2003-06-16 07:30:48 UTC
Should be fixed now.
Comment 3 Patrick Kursawe (RETIRED) gentoo-dev 2003-06-23 04:49:03 UTC
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)...
Comment 4 Patrick Kursawe (RETIRED) gentoo-dev 2003-06-23 05:26:47 UTC
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?
Comment 5 Renat Golubchyk 2003-08-16 12:08:22 UTC
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?)
Comment 6 Tim Yamin (RETIRED) gentoo-dev 2003-08-16 12:21:42 UTC
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.
Comment 7 Patrick Kursawe (RETIRED) gentoo-dev 2003-08-17 23:25:27 UTC
2.4.19 headers are the latest, from the glibc point of view.
Comment 8 Patrick Kursawe (RETIRED) gentoo-dev 2003-08-17 23:41:53 UTC
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.
Comment 9 Tim Yamin (RETIRED) gentoo-dev 2003-08-18 06:16:22 UTC
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...
Comment 10 Renat Golubchyk 2003-08-18 12:34:33 UTC
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.
Comment 11 Tim Yamin (RETIRED) gentoo-dev 2003-08-18 14:09:16 UTC
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].
Comment 12 Patrick Kursawe (RETIRED) gentoo-dev 2003-08-18 22:54:56 UTC
Brandon, I'd like you to comment on the "where should the includes go" issue.
Comment 13 Tim Yamin (RETIRED) gentoo-dev 2003-08-19 05:47:55 UTC
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...