[avahi] embedding avahi

Lennart Poettering lennart at poettering.net
Wed Sep 13 14:19:23 PDT 2006


On Wed, 13.09.06 16:30, Vet, Paul (Paul.Vet at christiedigital.com) wrote:

> Hi,

Hi!

> I'm wondering how possible it is to strip avahi down to the bare minimum for
> installation on a small device.  How large would such a minimal
> version be?

Good question.

The embeddable core of Avahi is about 200K large (x86/Linux), i guess
with a little bit optimizing for size (i.e. -Os, compiling statically)
and removing unnecessary features you could get near 100K without too
much trouble.

However, we don't have much experience with this, so YMMV. 

> What is the absolute minimum required set of external libraries?  

That depends. If you need just the embeddable mDNS core of Avahi
(libavahi-core) then you need no other deps. However, I've you want to
have the "avahi-daemon" binary with its configuration files and
command line parsing, you need libdaemon and libexpat. If you want
access to the avahi core from other processes using our client API you
need D-Bus.

Please have a look on the dependency table on:
       
   http://avahi.org/wiki/DownloadAvahi#Requirements

> Would it be possible to write a simple non-dbus version of the
> daemon?

No need for writing this. All you have to do is passing --disable-dbus
to the configure script. However, if you do that Avahi will not be
accessible from other processes, i.e. tools like "avahi-browse" will
not be available. The static service and host name definition file is
still availablle, though. For many embedded devices that just want to
announce a service this should probably suffice.

For more sophistacated devices it is probably best to write your own
minimal daemon that makes direct use of avahi-core and doesn't need
any IPC functionality. The API documentation for this embeddable core
is built only when --enable-core-docs is passed to the configure
script and is not available online. 

Please remember that mDNS requires Multicast support in the kernel,
hence the overall size of your boot image might increase additionally.

Lennart

-- 
Lennart Poettering; lennart [at] poettering [dot] net
ICQ# 11060553; GPG 0x1A015CC4; http://0pointer.net/lennart/


More information about the avahi mailing list