(Created page with " == Cross Compiling Samba == Download the source and uncompress: <PRE> wget http://www.samba.org/samba/ftp/stable/samba-3.6.3.tar.gz tar -xzf samba-3.6.3.tar.gz </PRE> <PRE...") |
|||
(8 intermediate revisions by one user not shown) | |||
Line 5: | Line 5: | ||
<PRE> | <PRE> | ||
− | wget http:// | + | wget http://samba.org/samba/ftp/stable/samba-3.6.23.tar.gz |
− | tar -xzf samba-3.6. | + | tar -xzf samba-3.6.23.tar.gz |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
</PRE> | </PRE> | ||
Line 16: | Line 12: | ||
<PRE> | <PRE> | ||
− | cd samba-3.6. | + | cd samba-3.6.23/source3 |
./autogen.sh | ./autogen.sh | ||
./configure --without-krb5 --without-ldap --without-ads \ | ./configure --without-krb5 --without-ldap --without-ads \ | ||
--disable-cups --enable-swat=no --with-winbind=no \ | --disable-cups --enable-swat=no --with-winbind=no \ | ||
− | --target=arm | + | --target=arm-linux-gnueabi --host=arm-linux-gnueabi \ |
− | --prefix= | + | --prefix= --with-configdir=/etc \ |
samba_cv_CC_NEGATIVE_ENUM_VALUES=yes \ | samba_cv_CC_NEGATIVE_ENUM_VALUES=yes \ | ||
libreplace_cv_HAVE_GETADDRINFO=no \ | libreplace_cv_HAVE_GETADDRINFO=no \ | ||
ac_cv_file__proc_sys_kernel_core_pattern=yes | ac_cv_file__proc_sys_kernel_core_pattern=yes | ||
make | make | ||
− | make install DESTDIR=/home | + | make install DESTDIR=/home/export/rootfs |
</PRE> | </PRE> | ||
Line 51: | Line 47: | ||
/sbin/nmbd -D | /sbin/nmbd -D | ||
</PRE> | </PRE> | ||
+ | |||
+ | == Creating users == | ||
+ | |||
+ | You can add new Samba users using | ||
+ | |||
+ | <PRE> | ||
+ | smbpassword -a <username> | ||
+ | </PRE> | ||
+ | |||
+ | To be successful, there must be an entry in /etc/passwd corresponding to the user. | ||
+ | |||
+ | == Notes on minimal systems == | ||
+ | |||
+ | If smbd or nmbd reports <TT>smbd: error while loading shared libraries: libgcc_s.so.1: cannot open shared object file: No such file or directory</TT>, then you are missing the GCC low-level runtime library. You can copy it from your arm-linux-gnueabi cross compiler: | ||
+ | |||
+ | <PRE> | ||
+ | cp /usr/arm-linux-gnueabi/lib/libgcc_s.so.1 /home/export/rootfs/lib | ||
+ | </PRE> | ||
+ | |||
+ | If smbd fails to start, check the logs in /var/log.smbd. If smbd fails to daemonise and there is no error message, potentially you have a user account problem. If you don't have a /etc/passwd file, create one with a root and nobody user: | ||
+ | |||
+ | <PRE> | ||
+ | root::0:0:root:/root:/bin/bash | ||
+ | nobody:x:65534:65534:nobody:/nonexistent:/bin/bash | ||
+ | </PRE> | ||
+ | |||
+ | == Download pre-built binaries == | ||
+ | |||
+ | The link below contains a bzip2 tarball of Samba compiled for ARM: | ||
+ | |||
+ | * [http://wiki.beyondlogic.org/prebuilt/samba-3.6.3-arm-none-linux-gnueabi.tar.bz2 samba-3.6.3-arm-none-linux-gnueabi.tar.bz2] [md5hash 2e433743d8531644e71010f4a122d1bd] | ||
+ | * Built using : | ||
+ | ** arm-none-linux-gnueabi-gcc version 4.6.1 (Sourcery CodeBench Lite 2011.09-70) | ||
+ | |||
+ | |||
+ | * [http://wiki.beyondlogic.org/prebuilt/samba-3.6.23-arm-linux-gnueabi.tar.bz2 samba-3.6.23-arm-linux-gnueabi.tar.bz2] [md5hash 52c8c8883fa1387623491c3ba1ca661f] | ||
+ | * Built using : | ||
+ | ** arm-linux-gnueabi-gcc version 4.7.3 (Ubuntu/Linaro 4.7.3-1ubuntu1) |
Download the source and uncompress:
wget http://samba.org/samba/ftp/stable/samba-3.6.23.tar.gz tar -xzf samba-3.6.23.tar.gz
And cross compile for ARM:
cd samba-3.6.23/source3 ./autogen.sh ./configure --without-krb5 --without-ldap --without-ads \ --disable-cups --enable-swat=no --with-winbind=no \ --target=arm-linux-gnueabi --host=arm-linux-gnueabi \ --prefix= --with-configdir=/etc \ samba_cv_CC_NEGATIVE_ENUM_VALUES=yes \ libreplace_cv_HAVE_GETADDRINFO=no \ ac_cv_file__proc_sys_kernel_core_pattern=yes make make install DESTDIR=/home/export/rootfs
Create a Samba configuration file (smb.conf) and place it in /etc. Below is a minimal example configuration, sharing the home directories located in /home.
[global] workgroup = WORKGROUP netbios name = SAMBA_FS [Home] path = /home writable = yes comment = Home Directories
Samba can be started using the following. smbd is the main Samba3 daemon and handles the SMB protocol. nmbd provides NetBIOS name server support.
/sbin/smbd -D /sbin/nmbd -D
You can add new Samba users using
smbpassword -a <username>
To be successful, there must be an entry in /etc/passwd corresponding to the user.
If smbd or nmbd reports smbd: error while loading shared libraries: libgcc_s.so.1: cannot open shared object file: No such file or directory, then you are missing the GCC low-level runtime library. You can copy it from your arm-linux-gnueabi cross compiler:
cp /usr/arm-linux-gnueabi/lib/libgcc_s.so.1 /home/export/rootfs/lib
If smbd fails to start, check the logs in /var/log.smbd. If smbd fails to daemonise and there is no error message, potentially you have a user account problem. If you don't have a /etc/passwd file, create one with a root and nobody user:
root::0:0:root:/root:/bin/bash nobody:x:65534:65534:nobody:/nonexistent:/bin/bash
The link below contains a bzip2 tarball of Samba compiled for ARM: