FAQ: Avahi-daemon for uClinux(2010-05-20)

Document created by Aaronwu Employee on Aug 28, 2013Last modified by sonic on Sep 8, 2013
Version 2Show Document
  • View in full screen mode

2010-05-20 10:50:05     Avahi-daemon for uClinux

Ben Webster (UNITED KINGDOM)

Message: 89595   

 

Hi,

 

I'd like to run avahi-daemon on an embedded blackfin system to publish details of the services it provides. This seems like it must be a common requirement, but I can't find any details of doing this. From what I can find, uClinux includes libavahi, but not the daemon itself? I wanted to check whether anyone had done this yet, before trying to compile avahi-daemon myself.

QuoteReplyEditDelete

 

 

2010-05-27 07:13:02     Re: Avahi-daemon for uClinux

Ben Webster (UNITED KINGDOM)

Message: 89916   

 

Just in case anyone else is trying to do this, I ended up answering my own question:

 

This is based on using 2009R1, and it should be fairly complete, YMMV.

 

This works by more or less following the page at   www.vpx.nu/dokuwiki/doku.php?id=avahi_zeroconf_for_linux, but with some additions (extra variables and adding in expat). The whole process is below:

 

    Get libdaemon 0.9 from   0pointer.de/lennart/projects/libdaemon/. Later may work, not sure.

 

    Export a variable to disable "setpgrp" check, then configure and make:

 

    export ac_cv_func_setpgrp_void=yes

    ./configure -host=bfin-uclinux -disable-lynx

    make

 

    Now get avahi 0.6.19 (later may work, I had problems with intltool) from   avahi.org/download/

 

    Set up expat in uclinux, "make menuconfig" and look for "expat" in the library configuration. Then make the kernel, and install the libraries into the bfin toolchain to let us build stuff externally (as described at the bottom of this page   docs.blackfin.uclinux.org/doku.php?id=uclinux-dist:existing_libraries&s[=expat] ):

 

    make vendor_staging_install

 

    Configure avahi and make:

 

    export ac_cv_func_realloc_0_nonnull=yes

    export ac_cv_func_malloc_0_nonnull=yes

    ./configure -host=bfin-uclinux \

    -prefix=/lib/firmware \

    -disable-shared \

    -enable-tests \

    -disable-gdbm \

    -disable-dbus \

    -with-distro=none \

    -disable-glib \

    -disable-qt3 \

    -disable-qt4 \

    -disable-gtk \

    -disable-doxygen-man \

    -disable-doxygen-rtf \

    -disable-doxygen-xml \

    -disable-doxygen-chm \

    -disable-doxygen-chi \

    -disable-manpages \

    CFLAGS="-DUCLINUX" \

    LDFLAGS="-pthread -Wl,-elf2flt" \

    LIBDAEMON_CFLAGS=-I/home/bwebster/avahi4blackfin/libdaemon-0.9/ \

    LIBDAEMON_LIBS=/home/bwebster/avahi4blackfin/libdaemon-0.9/libdaemon/.libs/libdaemon.a

 

    make

 

    You should be able to just copy the avahi-daemon executable onto the blackfin and run, probably as :

 

./avahi-daemon --f avahi-daemon.conf

 

    You'll also obviously need a suitable conf file. You may want to change the -prefix in the configure for avahi to make it default to the correct location for files. I've run the resulting executable and it does seem to work, but I haven't tested it fully yet.

 

QuoteReplyEditDelete

 

 

2010-06-09 03:26:51     Re: Avahi-daemon for uClinux

Daniele Pagani (ITALY)

Message: 90217   

 

Hi Ben,

 

your post is very interesting.

 

However, I receive an error on compiling avahi, after your steps:

 

./configure -host=bfin-uclinux -prefix=/lib/firmware -disable-shared -enable-tests -disable-gdbm -disable-dbus -with-distro=none -disable-glib -disable-qt3 -disable-qt4 -disable-gtk -disable-doxygen-man -disable-doxygen-rtf -disable-doxygen-xml -disable-doxygen-chm -disable-doxygen-chi -disable-manpages CFLAGS="-DUCLINUX" LDFLAGS="-pthread " LIBDAEMON_CFLAGS=-I/home/blackfin/libdaemon-0.9/ LIBDAEMON_LIBS=/home/blackfin/libdaemon-0.9/libdaemon/.libs/libdaemon.a

 

...

 

checking for XML_ParserCreate in -lexpat... no                                                                           

 

configure: error: *** libexpat not found ***

 

First of all, I need to compile without -elf2flt because I set "kernel support for FDPIC ELF binaries" in my configuration.

 

Then, I don't understand why I receive an error on libexpat.

 

I follow instructions for expat and I've this library in /staging/usr/lib

 

libexpat.a, libexpat.la, libexpat.so, libexpat.so.1, libexpat.so.1.5.2

 

and I find them also in my toolchain.

 

So, do I need to select libavahi in "make menuconfig"?

 

Regards,

 

Daniele.

 

config.log

TranslateQuoteReplyEditDelete

 

 

2010-07-22 05:28:17     Re: Avahi-daemon for uClinux

Ben Webster (UNITED KINGDOM)

Message: 91575   

 

Quick update - I've had a chance to test the daemon now, and so far it has worked as expected. You will also need to create a user for avahi, etc. but the process is as normal for avahi on any system (obviously you may need to recompile uClinux for any admin tools needed to create users,etc.).

Attachments

Outcomes