Skip to contentSkip to conversation

package/avahi: add optional support for libcap

PATCH Superseded Bernd Kuhls 4 participants 5 messages Feb 21, 2016 – Feb 25, 2016

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 package/avahi: add optional support for libcap

When libcap was compiled before, avahi daemon will use it as optional dependency:

$ output/host/usr/bin/x86_64-linux-readelf -a output/target/usr/sbin/avahi-daemon | grep NEEDED | sort
 0x0000000000000001 (NEEDED)             Shared library: [libavahi-common.so.3]
 0x0000000000000001 (NEEDED)             Shared library: [libavahi-core.so.7]
 0x0000000000000001 (NEEDED)             Shared library: [libcap.so.2]
[...]

The build system offers no option to en-/disable libcap support:
http://git.0pointer.net/avahi.git/tree/configure.ac#n382

The check for libcap was placed inside the BR2_PACKAGE_AVAHI_DAEMON because only avahi-daemon uses libcap, it provides chroot support.

---
v2: moved the new code block a bit and added more notes about the usage
of libcap (Thomas)

 package/avahi/avahi.mk | 3 +++
 1 file changed, 3 insertions(+)
package/avahi/avahi.mk +3 -0
index 5d6e6a8..e84a69e 100644
@@ -118,6 +118,9 @@ endif
 ifeq ($(BR2_PACKAGE_AVAHI_DAEMON),y)
 AVAHI_DEPENDENCIES += expat
 AVAHI_CONF_OPTS += --with-xml=expat
+ifeq ($(BR2_PACKAGE_LIBCAP),y)
+AVAHI_DEPENDENCIES += libcap
+endif
 else
 AVAHI_CONF_OPTS += --with-xml=none
 endif
Signature · 1 line
2.7.0
#1 lore raw

PATCH v2 1/1 package/avahi: add optional support for libcap

Dear Bernd Kuhls,

Quoted 9 lines · Bernd Kuhls

When libcap was compiled before, avahi daemon will use it as optional dependency:

$ output/host/usr/bin/x86_64-linux-readelf -a output/target/usr/sbin/avahi-daemon | grep NEEDED | sort
 0x0000000000000001 (NEEDED)             Shared library: [libavahi-common.so.3]
 0x0000000000000001 (NEEDED)             Shared library: [libavahi-core.so.7]
 0x0000000000000001 (NEEDED)             Shared library: [libcap.so.2]
[...]
Quoted 5 lines

The build system offers no option to en-/disable libcap support:
http://git.0pointer.net/avahi.git/tree/configure.ac#n382

The check for libcap was placed inside the BR2_PACKAGE_AVAHI_DAEMON because only avahi-daemon uses libcap, it provides chroot support.

Still, the configure.ac test is done unconditionally (i.e regardless of whether the daemon is enabled or not), so I believe we should also do the same.

Peter, Yann, Arnout, your thoughts?

Thanks,

Thomas

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

PATCH v2 1/1 package/avahi: add optional support for libcap

Quoted 16 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Thomas" == Thomas Petazzoni <[email protected]> writes:

Dear Bernd Kuhls,

Quoted 12 lines · Bernd Kuhls

When libcap was compiled before, avahi daemon will use it as optional dependency:

$ output/host/usr/bin/x86_64-linux-readelf -a output/target/usr/sbin/avahi-daemon | grep NEEDED | sort
0x0000000000000001 (NEEDED)             Shared library: [libavahi-common.so.3]
0x0000000000000001 (NEEDED)             Shared library: [libavahi-core.so.7]
0x0000000000000001 (NEEDED)             Shared library: [libcap.so.2]
[...]

The build system offers no option to en-/disable libcap support:
http://git.0pointer.net/avahi.git/tree/configure.ac#n382

Quoted 8 lines
Quoted 2 lines

The check for libcap was placed inside the BR2_PACKAGE_AVAHI_DAEMON because only avahi-daemon uses libcap, it provides chroot support.

Still, the configure.ac test is done unconditionally (i.e regardless of whether the daemon is enabled or not), so I believe we should also do the same.

Peter, Yann, Arnout, your thoughts?

It's safer to do it unconditionally (and we are unlikely to have problems with dependency loops with avahi/libcap, so that's not an issue either).

So I would prefer to have it outside the _DAEMON conditional as well.

Signature · 2 lines
Venlig hilsen,
Peter Korsgaard 
#3 lore raw

PATCH v2 1/1 package/avahi: add optional support for libcap

Bernd, Thomas, Peter, All,

On 2016-02-21 21:43 +0100, Peter Korsgaard spake thusly:

Quoted 23 lines
Quoted 22 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Thomas" == Thomas Petazzoni <[email protected]> writes:

Dear Bernd Kuhls,

Quoted 9 lines · Bernd Kuhls

When libcap was compiled before, avahi daemon will use it as optional dependency:

$ output/host/usr/bin/x86_64-linux-readelf -a output/target/usr/sbin/avahi-daemon | grep NEEDED | sort
0x0000000000000001 (NEEDED)             Shared library: [libavahi-common.so.3]
0x0000000000000001 (NEEDED)             Shared library: [libavahi-core.so.7]
0x0000000000000001 (NEEDED)             Shared library: [libcap.so.2]
[...]
Quoted 5 lines

The build system offers no option to en-/disable libcap support:
http://git.0pointer.net/avahi.git/tree/configure.ac#n382

The check for libcap was placed inside the BR2_PACKAGE_AVAHI_DAEMON because only avahi-daemon uses libcap, it provides chroot support.

Still, the configure.ac test is done unconditionally (i.e regardless of whether the daemon is enabled or not), so I believe we should also do the same.

Quoted 7 lines
Quoted 1 line

Peter, Yann, Arnout, your thoughts?

It's safer to do it unconditionally (and we are unlikely to have problems with dependency loops with avahi/libcap, so that's not an issue either).

So I would prefer to have it outside the _DAEMON conditional as well.

Yes, agreed.

With a comment explaining so, of course.

Regards,
Yann E. MORIN.

Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
#4 lore raw

PATCH v2 1/1 package/avahi: add optional support for libcap

In reply to Bernd Kuhls

Bernd,

Quoted 12 lines · Bernd Kuhls

When libcap was compiled before, avahi daemon will use it as optional dependency:

$ output/host/usr/bin/x86_64-linux-readelf -a output/target/usr/sbin/avahi-daemon | grep NEEDED | sort
 0x0000000000000001 (NEEDED)             Shared library: [libavahi-common.so.3]
 0x0000000000000001 (NEEDED)             Shared library: [libavahi-core.so.7]
 0x0000000000000001 (NEEDED)             Shared library: [libcap.so.2]
[...]

The build system offers no option to en-/disable libcap support:
http://git.0pointer.net/avahi.git/tree/configure.ac#n382

Quoted 7 lines

The check for libcap was placed inside the BR2_PACKAGE_AVAHI_DAEMON because only avahi-daemon uses libcap, it provides chroot support.

---
v2: moved the new code block a bit and added more notes about the usage
of libcap (Thomas)

I've changed the patch to have the libcap condition outside of the avahi daemon condition, as discussed during the review, and applied to master.

Thanks!

Thomas

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