Skip to contentSkip to conversation

i2c-tools: install devt headers to staging dir

PATCH New julien.boibessot at free.fr 5 participants 10 messages Sep 23, 2016 – Sep 28, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 i2c-tools: install devt headers to staging dir

From: Julien BOIBESSOT <[email protected]>

On debian (and maybe other distribs), there is a package named libi2c-dev that install a useful header from i2c-tools (for the one wanting to write I2C applications). See https://packages.debian.org/fr/wheezy/libi2c-dev.
Do the same in Buildroot. Note that "install" target in i2c-tools Makefile would do the job, but BR installs i2c-tools's stuff manualy.

---
 package/i2c-tools/i2c-tools.mk | 5 +++++
 1 file changed, 5 insertions(+)
package/i2c-tools/i2c-tools.mk +5 -0
index e16b940..5e095f3 100644
@@ -8,6 +8,7 @@ I2C_TOOLS_VERSION = v3.1.2
 I2C_TOOLS_SITE = git://git.kernel.org/pub/scm/utils/i2c-tools/i2c-tools.git
 I2C_TOOLS_LICENSE = GPLv2+, GPLv2 (py-smbus)
 I2C_TOOLS_LICENSE_FILES = COPYING
+I2C_TOOLS_INSTALL_STAGING = YES
 
 ifeq ($(BR2_PACKAGE_PYTHON),y)
 I2C_TOOLS_DEPENDENCIES += python
@@ -50,6 +51,10 @@ define I2C_TOOLS_BUILD_CMDS
 	$(I2C_TOOLS_BUILD_PYSMBUS)
 endef
 
+define I2C_TOOLS_INSTALL_STAGING_CMDS
+	$(INSTALL) -m 644 -D $(@D)/include/linux/i2c-dev.h $(STAGING_DIR)/usr/include/linux
+endef
+
 define I2C_TOOLS_INSTALL_TARGET_CMDS
 	for i in i2cdump i2cget i2cset i2cdetect; \
 	do \
Signature · 1 line
2.1.4
#1 lore raw

PATCH 1/1 i2c-tools: install devt headers to staging dir

Quoted 7 lines · julien.boibessot at free.fr

From: Julien BOIBESSOT <[email protected]>

On debian (and maybe other distribs), there is a package named libi2c-dev that install a useful header from i2c-tools (for the one wanting to write I2C applications). See https://packages.debian.org/fr/wheezy/libi2c-dev.
Do the same in Buildroot. Note that "install" target in i2c-tools Makefile would do the job, but BR installs i2c-tools's stuff manualy.

Have you considered commit 41711cfdeda6f5fd9b2531f538f3643854d7d3ea?

Revert "i2c-tools: Add i2c-dev.h to staging directory for userspace i2c
drivers."

This reverts commit ff673f9a22b1467878f1a117f2c6198e9683d5c7, as the modified i2c-dev.h from i2c-tools has some definitions that conflict with the i2c.h from the kernel headers. This means that a userspace program or library that includes both will fail to build, as is the case with libsoc.

If the issue has been fixed now, please mention it in the commit log.

Also, I would prefer to use the install target. The manual install was there
from the very first commit in 2008, I don't think it's still relevant. Peter? Anyway, for staging the install target can definitely be used.

Regards,
Arnout

Quoted 30 lines
---
 package/i2c-tools/i2c-tools.mk | 5 +++++
 1 file changed, 5 insertions(+)
package/i2c-tools/i2c-tools.mk +5 -0
index e16b940..5e095f3 100644
@@ -8,6 +8,7 @@ I2C_TOOLS_VERSION = v3.1.2
 I2C_TOOLS_SITE = git://git.kernel.org/pub/scm/utils/i2c-tools/i2c-tools.git
 I2C_TOOLS_LICENSE = GPLv2+, GPLv2 (py-smbus)
 I2C_TOOLS_LICENSE_FILES = COPYING
+I2C_TOOLS_INSTALL_STAGING = YES
 
 ifeq ($(BR2_PACKAGE_PYTHON),y)
 I2C_TOOLS_DEPENDENCIES += python
@@ -50,6 +51,10 @@ define I2C_TOOLS_BUILD_CMDS
 	$(I2C_TOOLS_BUILD_PYSMBUS)
 endef
 
+define I2C_TOOLS_INSTALL_STAGING_CMDS
+	$(INSTALL) -m 644 -D $(@D)/include/linux/i2c-dev.h $(STAGING_DIR)/usr/include/linux
+endef
+
 define I2C_TOOLS_INSTALL_TARGET_CMDS
 	for i in i2cdump i2cget i2cset i2cdetect; \
 	do \
Signature · 6 lines
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF
#2 lore raw

PATCH 1/1 i2c-tools: install devt headers to staging dir

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Arnout" == Arnout Vandecappelle <[email protected]> writes:

Hi,

Quoted 3 lines

Also, I would prefer to use the install target. The manual install was there
from the very first commit in 2008, I don't think it's still relevant. Peter? Anyway, for staging the install target can definitely be used.

Sorry, I don't remember. I *THINK* it installed a number of unneeded stuff.

Changing to make install is fine by me if it nowadays does something sensible.

Signature · 1 line
Bye, Peter Korsgaard
#3 lore raw

PATCH 1/1 i2c-tools: install devt headers to staging dir

In reply to julien.boibessot at free.fr

Hello,

Quoted 9 lines · julien.boibessot at free.fr

From: Julien BOIBESSOT <[email protected]>

On debian (and maybe other distribs), there is a package named libi2c-dev that install a useful header from i2c-tools (for the one wanting to write I2C applications). See https://packages.debian.org/fr/wheezy/libi2c-dev.
Do the same in Buildroot. Note that "install" target in i2c-tools Makefile would do the job, but BR installs i2c-tools's stuff manualy.

We already merged exactly the same patch in commit ff673f9a22b1467878f1a117f2c6198e9683d5c7, and finally reverted it in 41711cfdeda6f5fd9b2531f538f3643854d7d3ea, with the following commit log:

commit 41711cfdeda6f5fd9b2531f538f3643854d7d3ea

Author: Thomas Petazzoni <[email protected]>
Date:   Tue Mar 4 19:14:26 2014 +0100

Revert "i2c-tools: Add i2c-dev.h to staging directory for userspace i2c drivers."

This reverts commit ff673f9a22b1467878f1a117f2c6198e9683d5c7, as the modified i2c-dev.h from i2c-tools has some definitions that conflict with the i2c.h from the kernel headers. This means that a userspace program or library that includes both will fail to build, as is the case with libsoc.

Fixes:

http://autobuild.buildroot.org/results/1f4/1f451a338487a2a3c8a8f9b18540d41b90ee5aac/

So, if we are going to merge the same patch again, I'd like to be sure that we won't fall into the exact same problems we had the previous time. Could you check this?

Thanks,

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
#4 lore raw

PATCH 1/1 i2c-tools: install devt headers to staging dir

Hello,

Arnout, Thomas,
thanks for reviewing.

Quoted 30 lines · Thomas Petazzoni

Hello,

Quoted 9 lines · julien.boibessot at free.fr

From: Julien BOIBESSOT <[email protected]>

On debian (and maybe other distribs), there is a package named libi2c-dev that install a useful header from i2c-tools (for the one wanting to write I2C applications). See https://packages.debian.org/fr/wheezy/libi2c-dev.
Do the same in Buildroot. Note that "install" target in i2c-tools Makefile would do the job, but BR installs i2c-tools's stuff manualy.

We already merged exactly the same patch in commit ff673f9a22b1467878f1a117f2c6198e9683d5c7, and finally reverted it in 41711cfdeda6f5fd9b2531f538f3643854d7d3ea, with the following commit log:

commit 41711cfdeda6f5fd9b2531f538f3643854d7d3ea

Author: Thomas Petazzoni <[email protected]>
Date:   Tue Mar 4 19:14:26 2014 +0100

Revert "i2c-tools: Add i2c-dev.h to staging directory for userspace i2c drivers."

This reverts commit ff673f9a22b1467878f1a117f2c6198e9683d5c7, as the modified i2c-dev.h from i2c-tools has some definitions that conflict with the i2c.h from the kernel headers. This means that a userspace program or library that includes both will fail to build, as is the case with libsoc.

Fixes:

Quoted 7 lines

http://autobuild.buildroot.org/results/1f4/1f451a338487a2a3c8a8f9b18540d41b90ee5aac/

So, if we are going to merge the same patch again, I'd like to be sure that we won't fall into the exact same problems we had the previous time. Could you check this?

Sorry for having missed that one ! Sadly, the same problem will occur with my patch.
I have currently no idea how to solve that and still trying to figure out how it can works on debian systems with libi2c-dev package installed. So meanwhile you can forget about my patch.

Best regards,
Julien

#5 lore raw

PATCH 1/1 i2c-tools: install devt headers to staging dir

Quoted 6 lines · Julien Boibessot

Hello,

Arnout, Thomas,
thanks for reviewing.

On 24/09/2016 16:18, Thomas Petazzoni wrote:

[snip]

Quoted 16 lines
Quoted 8 lines

This reverts commit ff673f9a22b1467878f1a117f2c6198e9683d5c7, as the modified i2c-dev.h from i2c-tools has some definitions that conflict with the i2c.h from the kernel headers. This means that a userspace program or library that includes both will fail to build, as is the case with libsoc.

Fixes:

Quoted 7 lines

http://autobuild.buildroot.org/results/1f4/1f451a338487a2a3c8a8f9b18540d41b90ee5aac/

So, if we are going to merge the same patch again, I'd like to be sure that we won't fall into the exact same problems we had the previous time. Could you check this?

Quoted 5 lines

Sorry for having missed that one ! Sadly, the same problem will occur with my patch.
I have currently no idea how to solve that and still trying to figure out how it can works on debian systems with libi2c-dev package installed. So meanwhile you can forget about my patch.

I guess Debian doesn't have packages that include both i2c.h and i2c-dev.h.
libsoc, for example, doesn't exist in Debian.

I guess the solution would be for i2c-tools to #include or #include_next the
relevant kernel headers, instead of redefining. Or to have both i2c.h and i2c-dev.h so that both kernel headers end up being overwritten.

Regards,
Arnout

Signature · 6 lines
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF
#6 lore raw

PATCH 1/1 i2c-tools: install devt headers to staging dir

Quoted 8 lines
Quoted 7 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Arnout" == Arnout Vandecappelle <[email protected]> writes:

Sorry for having missed that one ! Sadly, the same problem will occur with my patch.
I have currently no idea how to solve that and still trying to figure out how it can works on debian systems with libi2c-dev package installed. So meanwhile you can forget about my patch.

Quoted 6 lines

I guess Debian doesn't have packages that include both i2c.h and i2c-dev.h.
libsoc, for example, doesn't exist in Debian.

I guess the solution would be for i2c-tools to #include or #include_next the
relevant kernel headers, instead of redefining. Or to have both i2c.h and i2c-dev.h so that both kernel headers end up being overwritten.

Does the i2c-tools version of this file add anything important on top of the Linux headers? The i2c /dev interface afaik hasn't changed in MANY years.

Signature · 1 line
Bye, Peter Korsgaard
#7 lore raw

PATCH 1/1 i2c-tools: install devt headers to staging dir

Hi Peter,

Quoted 11 lines · Peter Korsgaard
Quoted 10 lines
Quoted 7 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Arnout" == Arnout Vandecappelle <[email protected]> writes:

Sorry for having missed that one ! Sadly, the same problem will occur with my patch.
I have currently no idea how to solve that and still trying to figure out how it can works on debian systems with libi2c-dev package installed. So meanwhile you can forget about my patch.

I guess Debian doesn't have packages that include both i2c.h and i2c-dev.h.
libsoc, for example, doesn't exist in Debian.

Quoted 7 lines
Quoted 3 lines

I guess the solution would be for i2c-tools to #include or #include_next the
relevant kernel headers, instead of redefining. Or to have both i2c.h and i2c-dev.h so that both kernel headers end up being overwritten.

Does the i2c-tools version of this file add anything important on top of the Linux headers? The i2c /dev interface afaik hasn't changed in MANY years.

The i2c-tools version of i2c-dev.h adds a number of convenient i2c_smbus_*() routines, that wrap around the I2C_SMBUS ioctl.

baruch

Signature · 3 lines
     http://baruch.siach.name/blog/                  ~. .~   Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
   - baruch at tkos.co.il - tel: +972.52.368.4656, http://www.tkos.co.il -
#8 lore raw

PATCH 1/1 i2c-tools: install devt headers to staging dir

Hello,

Quoted 17 lines · Baruch Siach

Hi Peter,

Quoted 14 lines · Peter Korsgaard
Quoted 13 lines
Quoted 6 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Arnout" == Arnout Vandecappelle <[email protected]> writes:

Sorry for having missed that one ! Sadly, the same problem will occur with my patch.
I have currently no idea how to solve that and still trying to figure out how it can works on debian systems with libi2c-dev package installed. So meanwhile you can forget about my patch.

I guess Debian doesn't have packages that include both i2c.h and i2c-dev.h.
libsoc, for example, doesn't exist in Debian.

I guess the solution would be for i2c-tools to #include or #include_next the
relevant kernel headers, instead of redefining. Or to have both i2c.h and i2c-dev.h so that both kernel headers end up being overwritten.

Quoted 5 lines
Quoted 3 lines

Does the i2c-tools version of this file add anything important on top of the Linux headers? The i2c /dev interface afaik hasn't changed in MANY years.

The i2c-tools version of i2c-dev.h adds a number of convenient i2c_smbus_*() routines, that wrap around the I2C_SMBUS ioctl.

These i2c_smbus_*() routines are used by some userspace I2C drivers (not yet in BR), that's why I sent the patch to re-install i2c-dev.h

Regards,
Julien

#9 lore raw

PATCH 1/1 i2c-tools: install devt headers to staging dir

Quoted 10 lines
Quoted 7 lines
Quoted 5 lines
Quoted 1 line
Quoted 1 line

"Julien" == Julien Boibessot <[email protected]> writes:

Does the i2c-tools version of this file add anything important on top of the Linux headers? The i2c /dev interface afaik hasn't changed in MANY years.

The i2c-tools version of i2c-dev.h adds a number of convenient i2c_smbus_*() routines, that wrap around the I2C_SMBUS ioctl.

These i2c_smbus_*() routines are used by some userspace I2C drivers (not yet in BR), that's why I sent the patch to re-install i2c-dev.h

It is quite painful to have multiple incompatible versions of the same header file, and i2c-tools imho shouldn't overwrite kernel headers.

Have this issue been discussed with upstream?

Signature · 2 lines
Venlig hilsen,
Peter Korsgaard