Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 488654 - sys-apps/i2c-tools installs a better linux/i2c-dev.h than linux-headers
Summary: sys-apps/i2c-tools installs a better linux/i2c-dev.h than linux-headers
Status: RESOLVED WONTFIX
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Mikle Kolyada (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-10-20 00:27 UTC by Luke-Jr
Modified: 2018-03-23 15:39 UTC (History)
3 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 Luke-Jr 2013-10-20 00:27:00 UTC
src_install has: rm -rf "${D}"/usr/include # part of linux-headers

But this is an error. i2c-tools exclusively includes /usr/include/linux/i2c-dev.h; it is NOT installed by linux-headers. This confusion is likely because the Linux kernel itself contains a *different* i2c-dev.h file, usable only for kernel internals.

Per /usr/src/linux/Documentation/i2c/dev-interface:
    So let's say you want to access an i2c adapter from a C program. The
    first thing to do is "#include <linux/i2c-dev.h>". Please note that
    there are two files named "i2c-dev.h" out there, one is distributed
    with the Linux kernel and is meant to be included from kernel
    driver code, the other one is distributed with i2c-tools and is
    meant to be included from user-space programs. You obviously want
    the second one here.
Comment 1 Luke-Jr 2013-10-20 00:32:40 UTC
Correction: linux-headers does install the Linux i2c-dev, but as mentioned, it is the wrong one for userspace...
Comment 2 Tom Wijsman (TomWij) (RETIRED) gentoo-dev 2013-10-21 00:35:25 UTC
This package has no maintainer so this bug may go unnoticed for a long time.
Gentoo has a dedicated team[1] for assisting users in maintaining orphaned
packages. If you are interested in maintaining this package, please contact
proxy-maint@gentoo.org. 

[1]: http://www.gentoo.org/proj/en/qa/proxy-maintainers/index.xml
Comment 3 SpanKY gentoo-dev 2014-04-07 23:15:29 UTC
it isn't "the wrong one", it's just not as useful

this conversation should happen on the i2c linux lists imo and see if the i2c-tools version couldn't be merged into the mainline kernel itself
Comment 4 Luke-Jr 2014-11-19 06:41:09 UTC
When Linux upstream is already saying to use the one in i2c-tools for userspace, I'm not sure what there is to discuss upstream. Every other distro seems to get this right, so I don't know what's holding back Gentoo.
Comment 5 David Oostdyk 2017-03-01 06:24:03 UTC
Petalinux (or bitbake?) approaches this issue by installing i2c-tools' i2c-dev.h to /usr/include/linux/i2c-dev-user.h; this seems like a reasonable alternative that at least provides the userland i2c-dev.h *somewhere* that applications can use.

Using m4 magic an application could at least check for the presence of <linux/i2c-dev-user.h> if possible; otherwise check <linux/i2c-dev.h> and test whether the i2c_smbus_xxx functions are present.
Comment 6 Mike Pagano gentoo-dev 2017-03-01 18:27:29 UTC
Hi, Mike,

I don't think there's anything kernel maintainers can do here. As maintainer of i2c-tools I believe it's your choice to implement the below suggestion of a rename or not.  

-Mike
Comment 7 Mikle Kolyada (RETIRED) archtester Gentoo Infrastructure gentoo-dev Security 2018-03-23 15:39:13 UTC
Linux headers currently ships almost the same i2c-dev.h, not worth any installation changes.