2012/09/11

compile samba on arm


NOTES:

v3.6.7 : too big, total 26MB not suitable due to limited storage space.

v2.2.12: ok. not support Win7 (?), need more patches...


v3.3.16 : ok, around 12MB with Win7 defaults.

---

# tar zxvf samba-3.6.7.tar.gz
# cd samba-3.6.7/source3/
# ./autogen.sh
# export samba_cv_USE_SETREUID=yes
# export samba_cv_CC_NEGATIVE_ENUM_VALUES=yes
# ./configure --host=arm-linux --without-pam --without-ldap --without-ads --without-pam_smbpass --without-sys-quotas --without-utmp --without-cluster-support --without-acl-support --without-wbclient --without-winbind --without-dnsupdate --without-dmapi --disable-avahi --disable-swat --disable-pie --disable-smbtorture4 --disable-cups --disable-iprint --disable-fam --disable-relro
   :
error: cannot run test program while cross compiling
   :

# vi configure
### find below blue text in configure, and add red ones '} #'

echo "$as_me: error: cannot run test program while cross compiling
See \`config.log' for more details." >&2;}
} #   { (exit 1); exit 1; }; }


### run above ./configure again

# make
# cd bin/
# cp -af nmbd smbd smbpasswd libtalloc* libtdb* PATH/TO/YOUR/BOARD

---
On the board
# mkdir -p /usr/local/samba
# mkdir -p /usr/local/samba/lib

# vi /usr/local/samba/lib/smb.conf


[homes]
        comment = Home Directories
        valid users = %S
        read only = no
        create mask = 0664
        directory mask = 0775
        browseable = no

[printers]
        browseable = no

[global]
        load printers = no
        printable = no
        security = user
        encrypt passwords = yes
        passdb backend = tdbsam
        username map = /usr/local/samba/lib/smbusers

        workgroup = workgroup
        netbios name = samba
        server string = "Samba (v3.6.7)"


###  /etc/passwd, /etc/group for reference

# cat /etc/passwd
root:$1$nHN6m8b.$/gnpAn1L2mYaQuuaDz6RU1:0:0:root:/root:/bin/sh
   :
nobody:x:99:99:nobody:/home:/bin/sh
   :
admin:$1$XL0OM1aR$xjup9ihWC1W736mmvDvMT/:1001:1001:Linux User,,,:/mnt:/bin/sh
operator:$1$l7PxfnFM$qhisTMqd9mI/F1qMS3Fq./:1002:1001:Linux User,,,:/mnt:/bin/sh
guest:$1$a2z3qMUf$0CKhI69tlfeNQq8IcEYyR/:1003:1001:Linux User,,,:/mnt:/bin/sh

# cat /etc/group
root:x:0:
   :
nobody:x:99:admin,operator,guest
   :
ftp:x:1001:admin,operator,guest


# cd PATH/TO/SMB_BINARIES
# ./nmbd -D
# ./smbd -D


沒有留言: