I would like to use Solaris 10 as a NAS server for our office - taking advantage of the goodness of ZFS to manage mirrored storage.
I'm new to Solaris having spent most of my time on FreeBSD and Linux. I have managed to get it installed OK, patched up-to-date with smpatch, set up a two-disk ZFS mirror and enabled CIFS file sharing. The problem I have is that there are a lot of Mac users in my company and they prefer using Apple's native filesharing. This means installing netatalk.
I couldn't find any packages for netatalk, so I found these intructions and tried to follow them:
I installed GCC and berkeleydb44_devel using blastwave but I can't get netatalk to compile either the vanilla version or the patched version from the link above - it configures OK with:
cnid_index.c:277: warning passing argument 2 of 'db->stat' from incompatible pointer type
cnid_index.c:277: error: too few arguments to function 'db->stat'
Is there an easier way of doing this (a pre-built package would be great!), or can anyone point me in the right direction to get it working please?
Apologies if this is the wrong place to ask these questions.
There's usually one for Developers so start there. If not, ususally in the tarball is a file called MAINTAINERS with names and e-mail addresses for you to use.
My first try was to install nettalk w/o Berkely DB installed:
# cd netatalk-2.0.3
________________________________________________
[SunOS 5.10/bash] root@wgls01.nz.thenational.com:/root/netatalk-2.0.3
# RANLIB=echo CC=gcc LDFLAGS=-R/usr/local/lib ./configure \
<div class="jive-quote">--prefix=/opt/netatalk --with-ssl-dir=/usr/sfw --with-bdb=/usr/local</div>
...
Checking default DID scheme... cdb
checking whether default CNID scheme has been activated... yes
checking for Berkeley DB headers in /usr/local/include/db4.2... no
checking for Berkeley DB headers in /usr/local/include/db42... no
checking for Berkeley DB headers in /usr/local/include/db4.1... no
checking for Berkeley DB headers in /usr/local/include/db41... no
...
checking for objdir... .libs
checking for ar... no
checking for ranlib... no
checking for strip... no
...
NOTE: I did not noticed the error with ar in the previous try of configure.
After a long research, the problem was identified with ar not beign located by configure.
# PATH=$PATH:/usr/ccs/bin;export PATH;../dist/configure
...
checking for objdir... .libs
checking for ar... ar
checking for ranlib... ranlib
checking for strip... strip
...
# make
...
gcc -O3 -o .libs/db_verify .libs/db_verify.o .libs/util_cache.o .libs/util_sig.o ./.libs/libdb-4.6.so -lresolv -lsocket -lrt -lpthread -R/usr/local/BerkeleyDB.4.6/lib
creating db_verify
/usr/bin/sh ./libtool --mode=execute true db_verify
________________________________________________
[SunOS 5.10/bash] root@wgls01.nz.thenational.com:/root/db-4.6.19/build_unix
# make install
Installing DB include files: /usr/local/BerkeleyDB.4.6/include ...
Installing DB library: /usr/local/BerkeleyDB.4.6/lib ...
...
Installing documentation: /usr/local/BerkeleyDB.4.6/docs ...
________________________________________________
[SunOS 5.10/bash] root@wgls01.nz.thenational.com:/root/db-4.6.19/build_unix
#
Now, back to nettalk:
________________________________________________
[SunOS 5.10/bash] root@wgls01.nz.thenational.com:/root/netatalk-2.0.3
# RANLIB=echo CC=gcc LDFLAGS=-R/usr/local/lib ./configure \
<div class="jive-quote">--prefix=/opt/netatalk --with-ssl-dir=/usr/sfw --with-bdb=/usr/local</div>
checking build system type... sparc-sun-solaris2.10
checking host system type... sparc-sun-solaris2.10
checking target system type... sparc-sun-solaris2.10
checking for a BSD-compatible install... ./install-sh -c
checking whether build environment is sane... yes
...
hecking whether default CNID scheme has been activated... yes
checking for Berkeley DB headers in /usr/local/include/db4.2... no
checking for Berkeley DB headers in /usr/local/include/db42... no
checking for Berkeley DB headers in /usr/local/include/db4.1... no
checking for Berkeley DB headers in /usr/local/include/db41... no
checking for Berkeley DB headers in /usr/local/include/db4... no
checking for Berkeley DB headers in /usr/local/include/... no
checking for Berkeley DB headers in /usr/local/db4.2... no
checking for Berkeley DB headers in /usr/local/db42... no
checking for Berkeley DB headers in /usr/local/db4.1... no
checking for Berkeley DB headers in /usr/local/db41... no
checking for Berkeley DB headers in /usr/local/db4... no
checking for Berkeley DB headers in /usr/local/... no
Make sure you have the required Berkeley DB libraries AND headers installed.
You can download the latest version from http://www.sleepycat.com.
If you have installed BDB in a non standard location use the
--with-bdb=/path/to/bdb configure option and make sure
your linker is configured to check for libraries there.
configure: error: Berkeley DB library required but not found!
________________________________________________
[SunOS 5.10/bash] root@wgls01.nz.thenational.com:/root/netatalk-2.0.3
# RANLIB=echo CC=gcc LDFLAGS=-R/usr/local/lib ./configure --prefix=/opt/netatalk --with-ssl-dir=/usr/sfw --with-bdb=/usr/local/BerkeleyDB.4.6
checking build system type... sparc-sun-solaris2.10
checking host system type... sparc-sun-solaris2.10
...
configure: error: Berkeley DB library required but not found!
# RANLIB=echo CC=gcc LDFLAGS=-R/usr/local/lib ./configure --prefix=/opt/netatalk --with-ssl-dir=/usr/sfw --with-bdb=/usr/local/BerkeleyDB.4.2
...
configure: error: Berkeley DB library required but not found!
Fixes
# ln -s /usr/local/BerkeleyDB.4.2/include /usr/local/include/db4.2
# (cd /usr/local/BerkeleyDB.4.2/lib; for x in *; do ln -s /usr/local/lib/$x $(pwd)/$x; done)
New try
# RANLIB=echo CC=gcc LDFLAGS=-R/usr/local/lib ./configure --prefix=/opt/netatalk --with-ssl-dir=/usr/sfw --with-bdb=/usr/local
...
configure: WARNING: If you're running Solaris or BSD you'll have to edit /etc/pam.conf to get PAM working.
configure: WARNING: You can also re-run configure and specify --without-pam to disable PAM support.
________________________________________________
[SunOS 5.10/bash] root@wgls01.nz.thenational.com:/root/netatalk-2.0.3
# make
...
pi.c: In function `tpi_identify':
tpi.c:47: error: `DDI_IDENTIFIED' undeclared (first use in this function)
tpi.c:47: error: (Each undeclared identifier is reported only once
tpi.c:47: error: for each function it appears in.)
tpi.c:49: error: `DDI_NOT_IDENTIFIED' undeclared (first use in this function)
...
To fix the previous problem, edit sys/solaris/tpi.c and includes the following two lines:
The netatalk software was designed to work with an older version of berkelely db (4.2)
The api for db has changed slightly in the meantime
Try this patch
diff -ru netatalk-2.0.3.orig//bin/cnid/cnid_index.c netatalk-2.0.3/bin/cnid/cnid
_index.c
--- netatalk-2.0.3.orig//bin/cnid/cnid_index.c Sun Apr 10 22:49:18 2005
+++ netatalk-2.0.3/bin/cnid/cnid_index.c Thu Mar 23 18:42:47 2006
@@ -274,7 +274,7 @@
DB_BTREE_STAT *sp;
DB *db = db_table[dbi].db;
- ret = db->stat(db, &sp, 0);
+ ret = db->stat(db, NULL, &sp, 0);
if (ret) {
LOG(log_error, logtype_cnid, "error getting stat infotmation on databas
e: %s", db_strerror(errno));
diff -ru netatalk-2.0.3.orig//etc/cnid_dbd/dbif.c netatalk-2.0.3/etc/cnid_dbd/db
if.c
--- netatalk-2.0.3.orig//etc/cnid_dbd/dbif.c Wed Dec 22 00:36:12 2004
+++ netatalk-2.0.3/etc/cnid_dbd/dbif.c Thu Mar 23 18:43:07 2006
@@ -514,7 +514,7 @@
DB_BTREE_STAT *sp;
DB *db = db_table[dbi].db;
- ret = db->stat(db, &sp, 0);
+ ret = db->stat(db, NULL, &sp, 0);
if (ret) {
LOG(log_error, logtype_cnid, "error getting stat infotmation on databas
e: %s", db_strerror(errno));
Hello.
I'm trying to compile netatalk-2.0.3 with BerkeleyDB.4.7. I applied the patch that Robert mentioned but I'm getting the following error:
then mv -f ".deps/main.Tpo" ".deps/main.Po"; \
else rm -f ".deps/main.Tpo"; exit 1; \
fi
main.c:15:38: /usr/ucbinclude/sys/file.h: No such file or directory
*** Error code 1
make: Fatal error: Command failed for target `main.o'
Current working directory /export/home/rem7/Desktop/netatalk-2.0.3/etc/atalkd
*** Error code 1
The following command caused the error:
set fnord $MAKEFLAGS; amf=$2; \
dot_seen=no; \
target=`echo all-recursive | sed s/-recursive//`; \
list='afpd cnid_dbd atalkd papd psf uams'; for subdir in $list; do \
echo "Making $target in $subdir"; \
if test "$subdir" = "."; then \
dot_seen=yes; \
local_target="$target-am"; \
else \
local_target="$target"; \
fi; \
(cd $subdir && make $local_target) \
|| case "$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
done; \
if test "$dot_seen" = "no"; then \
make "$target-am" || exit 1; \
fi; test -z "$fail"
make: Fatal error: Command failed for target `all-recursive'
Current working directory /export/home/rem7/Desktop/netatalk-2.0.3/etc
*** Error code 1
The following command caused the error:
set fnord $MAKEFLAGS; amf=$2; \
dot_seen=no; \
target=`echo all-recursive | sed s/-recursive//`; \
list='libatalk bin config etc man contrib distrib include sys doc macros'; for subdir in $list; do \
echo "Making $target in $subdir"; \
if test "$subdir" = "."; then \
dot_seen=yes; \
local_target="$target-am"; \
else \
local_target="$target"; \
fi; \
(cd $subdir && make $local_target) \
|| case "$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
done; \
if test "$dot_seen" = "no"; then \
make "$target-am" || exit 1; \
fi; test -z "$fail"
make: Fatal error: Command failed for target `all-recursive'
Current working directory /export/home/rem7/Desktop/netatalk-2.0.3
*** Error code 1
make: Fatal error: Command failed for target `all'
There are 6 programs that throw this error:
./etc/atalkd/main.c
./etc/cnid_dbd/dbif.c
./etc/papd/main.c
./etc/papd/lp.c
./bin/cnid/cnid_index.c
./sys/solaris/tpi.c
Make a backup of each file and then edit each. Near the top of each file, you will find a section that looks like:
#if defined( sun ) && defined( __svr4__ )
#include </usr/ucbinclude/sys/file.h>
#else /* sun __svr4__ */*
*#include <sys/file.h>*
*#endif /* sun __svr4__ */
And add '!' to make it become:
#if defined( sun ) && ! defined( __svr4__ )
#include </usr/ucbinclude/sys/file.h>
#else /* sun __svr4__ */*
*#include <sys/file.h>*
*#endif /* sun __svr4__ */
3) Download and unpack the source code for 'netatalk' from [Sourceforge|http://sourceforge.net/project/showfiles.php?group_id=8642|netatalk from Sourceforge]
4) Backup/modify the various sources that need to be fixed in order to compile, as previously documented in this disccusion thread.
5) I use the following script, 'BUILD', to configure the Makefile
Please don't post in threads that are long dead. When you have a question, start your own topic. Feel free to provide a link to an old post that may be relevant to your problem.