Samstag, 8. September 2012

Netatalk 2.2.3 for DD-WRT

The new version 2.2.3 is available here.

As before it has been compiled against BerkeleyDB 4.7.25 and works with OSX Lion (10.7). It has not been tested with Mountain Lion (10.8).

Have fun!

9 Kommentare:

  1. I'm going to build a netatalk to fit my macbook and g300nh.

    I checked both your instructions and http://www.nslu2-linux.org/wiki/Optware/AddAPackageToOptware
    But, failed to get buildroot-svn-17310.tar.gz, and I found here is a git server of buildroot(http://git.buildroot.net/buildroot/) instead of svn server.

    So, I have to download the latest buildroot but the patches have many conflicts. How can you achieved that?

    AntwortenLöschen
  2. Thanks for the great work!

    I had Time Machine running through Netatalk on 10.8. Due to the slow speeds I was getting I reformated my HD to ext3. Samba is much faster now, but when I try to connect through afp (guest access, as before) the drive is read only.

    Any idea why this problem occured with the change of file system?

    P.S I never got Avahi to work, but that did not seem to be a problem in the past. Also I am using Tomato.

    Thanks

    AntwortenLöschen
  3. Hi All,

    if someone are interested i have successfully compile and have it work netatalk (version 2.2.0 and 2.2.4) with libdb52 (version 5.2.28) on my dd-wrt 19342.

    The libdb52 must be compiled with --with-mutex=MIPS/gcc-assembly directive.

    The code require the following patch:

    $ cat mips_mutex_fix.patch
    --- src/dbinc/mutex_int.h.orig 2012-11-07 09:04:50.131891701 +0100
    +++ src/dbinc/mutex_int.h 2012-11-07 09:05:14.552436867 +0100
    @@ -778,6 +778,7 @@
    static inline void
    MUTEX_UNSET(tsl_t *tsl) {
    __asm__ volatile(
    + " .set mips2 \n"
    " .set noreorder \n"
    " sync \n"
    " sw $0, %0 \n"

    This is the patch for libdb52 makefile that i use:

    $ cat libdb52.mk.patch
    --- libdb52.mk.orig 2012-11-09 09:37:46.234712362 +0100
    +++ libdb52.mk 2012-11-09 10:12:25.674715083 +0100
    @@ -36,7 +36,7 @@
    #
    # LIBDB52_IPK_VERSION should be incremented when the ipk changes.
    #
    -LIBDB52_IPK_VERSION=1
    +LIBDB52_IPK_VERSION=2

    #
    # LIBDB52_CONFFILES should be a list of user-editable files
    @@ -46,7 +46,7 @@
    # LIBDB52_PATCHES should list any patches, in the the order in
    # which they should be applied to the source code.
    #
    -#LIBDB52_PATCHES=$(LIBDB52_SOURCE_DIR)/configure.patch
    +LIBDB52_PATCHES=$(LIBDB52_SOURCE_DIR)/mips_mutex_fix.patch

    #
    # If the compilation of the package requires additional
    @@ -58,7 +58,8 @@
    $(if $(filter arm armeb, $(TARGET_ARCH)), --with-mutex=ARM/gcc-assembly, \
    $(if $(filter powerpc ppc, $(TARGET_ARCH)), --with-mutex=PPC/gcc-assembly, \
    $(if $(filter x86 i386 i686, $(TARGET_ARCH)), --with-mutex=x86/gcc-assembly, \
    - ))) \
    + $(if $(filter mips mipsel, $(TARGET_ARCH)), --with-mutex=MIPS/gcc-assembly, \
    + )))) \
    )

    #

    I have also successfully compiled netatalk 2.2.4 with dbd cnid schema supported and worked (instead of the cdb). If someone are interested tell me.

    Thank to nGotme for you work.

    AntwortenLöschen
  4. Hi,

    could you please share details (and maybe both packages)? I am getting failure like "tsock_getfd: getaddrinfo: CNID server localhost:4700 : Bad value for ai_flags" and think because of older berkeley db 4.7.25.

    Many Regards!

    AntwortenLöschen
  5. Hi Soeren,

    you intended with dbd schema, right ?

    if yes, there is a couple of problem:

    - the patch dbd_def_AI_NUMERICSERV.patch used to compile netatalk on OPTWARE repository are wrong for DD-WRT platform and need to be modified with the follow:

    cerlymb:netatalk cerly$ cat dbd_def_AI_NUMERICSERV_ddwrt.patch
    --- libatalk/cnid/dbd/cnid_dbd.c.orig 2012-11-09 11:46:13.454711955 +0100
    +++ libatalk/cnid/dbd/cnid_dbd.c 2012-11-09 11:52:13.902722304 +0100
    @@ -65,6 +65,10 @@
    select(0, NULL, NULL, NULL, &tv);
    }

    +#ifndef AI_NUMERICSERV
    +#define AI_NUMERICSERV 0
    +#endif
    +
    static int tsock_getfd(const char *host, const char *port)
    {
    int sock = -1;

    - netatalk on DD-WRT platform have a problem to resolv network address, for example convert localhost to 127.0.0.1 ip address. I don't know why, i haven't inv
    estigated, the work around is to run cnid_metad with -h 127.0.0.1 parameter and configure the volume to search the cnid server to 127.0.0.1. My configure on A
    ppleVolumes.default are:

    "/mnt/data/cerly/Time Machine" "Time Machine 01" allow:cerly cnidserver:127.0.0.
    1 cnidscheme:dbd ea:ad options:tm,upriv,usedots

    If you want i can share both packages but, how can i do it in this blog ?

    However the follow are the patch that i used for makefile e for compile netatalk2.2.4:


    $ cat netatalk.mk.2.2.4.patch
    --- netatalk.mk.orig 2012-11-09 09:37:15.546712965 +0100
    +++ netatalk.mk 2012-11-09 14:19:40.790757437 +0100
    @@ -21,7 +21,7 @@
    # "NSLU2 Linux" other developers will feel free to edit.
    #
    NETATALK_SITE=http://$(SOURCEFORGE_MIRROR)/sourceforge/netatalk
    -NETATALK_VERSION=2.2.0
    +NETATALK_VERSION=2.2.4
    NETATALK_SOURCE=netatalk-$(NETATALK_VERSION).tar.gz
    NETATALK_DIR=netatalk-$(NETATALK_VERSION)
    NETATALK_UNZIP=zcat
    @@ -29,8 +29,8 @@
    NETATALK_DESCRIPTION=Apple talk networking daemon.
    NETATALK_SECTION=networking
    NETATALK_PRIORITY=optional
    -NETATALK_DEPENDS=libdb52
    -NETATALK_SUGGESTS=libgcrypt
    +NETATALK_DEPENDS=libdb52, libgcrypt
    +NETATALK_SUGGESTS=openssl
    NETATALK_CONFLICTS=

    #
    @@ -41,7 +41,7 @@
    #
    # NETATALK_IPK_VERSION should be incremented when the ipk changes.
    #
    -NETATALK_IPK_VERSION=2
    +NETATALK_IPK_VERSION=1

    #
    # NETATALK_CONFFILES should be a list of user-editable files
    @@ -51,8 +51,12 @@
    # NETATALK_PATCHES should list any patches, in the the order in
    # which they should be applied to the source code.
    #
    +ifeq (ddwrt, $(OPTWARE_TARGET))
    +NETATALK_PATCHES = $(NETATALK_SOURCE_DIR)/dbd_def_AI_NUMERICSERV_ddwrt.patch
    +else
    NETATALK_PATCHES = $(NETATALK_SOURCE_DIR)/dbd_def_AI_NUMERICSERV.patch
    -NETATALK_PATCHES+= $(NETATALK_SOURCE_DIR)/afp_asp_include.patch
    +endif
    +#NETATALK_PATCHES+= $(NETATALK_SOURCE_DIR)/afp_asp_include.patch
    NETATALK_PATCHES+=#$(NETATALK_SOURCE_DIR)/db3-check.patch

    NETATALK_CONFIG_ARGS ?=
    @@ -144,6 +148,7 @@
    --target=$(GNU_TARGET_NAME) \
    --prefix=/opt \
    --with-bdb=$(STAGING_PREFIX) \
    + --with-cnid-cdb-backend \
    --with-libgcrypt-dir=$(STAGING_PREFIX) \
    --with-ssl-dir=$(STAGING_PREFIX) \
    --without-shadow \

    $ cat dbd_def_AI_NUMERICSERV_ddwrt.patch
    --- libatalk/cnid/dbd/cnid_dbd.c.orig 2012-11-09 11:46:13.454711955 +0100
    +++ libatalk/cnid/dbd/cnid_dbd.c 2012-11-09 11:52:13.902722304 +0100
    @@ -65,6 +65,10 @@
    select(0, NULL, NULL, NULL, &tv);
    }

    +#ifndef AI_NUMERICSERV
    +#define AI_NUMERICSERV 0
    +#endif
    +
    static int tsock_getfd(const char *host, const char *port)
    {
    int sock = -1;

    Sergio

    AntwortenLöschen
  6. Still no shadow support though :/ Is it much work to get that?

    AntwortenLöschen
  7. Hi Sergio,

    sorry for late response. i would really appreciate it (and think would not be alone :) ), if you could upload the berkeley db and netatalk e.g. to "mega.co.nz".

    i tried your steps but have not been successful, also searched for logfiles and their corresponding failure message but never found any workaround - think i really need a simple *.deb package which i can install via ipkg ;)

    have many thanks in advance,

    Soeren

    AntwortenLöschen
  8. Hi Soeren,

    no problem for late.

    This is the link where you can download my files:

    https://mega.co.nz/#F!C9BRlbpR!DPfjrTcb6BkAODjoYlacgg

    The link is a folder that contain the ipk packages of netatalk and libdb52, the make file and patch that i used to compile the packages and my configuration files of netatalk as a example.

    Remember to run cnid_metad process with -h 127.0.0.1 parameter like as:

    /opt/sbin/cnid_metad -h 127.0.0.1 -l log_note -f /var/log/netatalk.log

    What kind of problem do you have when try to compile packages ?

    Bye
    Sergio

    AntwortenLöschen
  9. I have installed the DD-WRT firmware in my WNDR3700 netgear router, but I don't have a clue on how to make this nettalk work. Could someone please explain to me? I have no programming knowledge. Thank you very much.

    AntwortenLöschen