arm移植samba

ARM 357浏览

一、编译
1、从http://www.samba.org/samba/ftp/old-versions/上下载Samba 3.0.23.tar.gz
的软码包,解压;

2、环境
1)在fedora 9的 vi /root/.bash_profile 中加:
PATH=$PATH:/usr/local/arm/4.4.3/bin:$HOME/bin

2)运行configure:
[root@localhost source]#  CC=arm-linux-gcc ./configure --host=i686 --target=arm-linux --disable-cups --disable-iprint

3)完了以后要修改一下include/config.h,加上
#define HAVE_IFACE_IFCONF 1

5.改lib/time.c,如下:
[root@localhost source]# vi lib/time.c +60
59 #else
60
61 gettimeofday(tval,NULL);
62 #endif
说明:注译掉第60行;第61行加上"gettimeofday(tval,NULL);"

5.make

[root@localhost source]#make clean

[root@localhost source]#make

 

二.使用
1.在ARM开发板上建以下目录:

/usr/local/samba/bin
/usr/local/samba/private
/usr/local/samba/lib

/usr/local/samba/var

因为在上面的configure中的路径我用的是默认的,在smb运行时要用到.并把/samba3.0.23/source/bin目录下的所有文件考到ARM开发板的/usr/local/samba/bin目录中.

2.在ARM开发板的/usr/local/samba/lib目录中建smb.conf配置文件,容如如下:
[global]
workgroup = ARMSMB
netbios name = ArmSMB
server string = Arm Linux Samba Server
security = share

[share] #显示的共享文件夹名
path = /home/share #要共享的文件夹路径
writeable = yes
browseable = yes
guest ok = yes

3.运行smb
#./smbd -D
#./nmbd -D

[root@FriendlyARM bin]# ps
308 root 2056 S ./smbd -D
309 root 2048 S ./smbd -D

如果ps看不到如上如容,说明smb没有运行,可以用smbd -i -d 8 启动smb,可以打印启动信息,其中-i 是交互模式,-d是打印调试级别。

4.在windows-->开始-->运行,中输入//192.168.2.230(这是开发板IP)不用密码就可看到ARM开发板smb共享了.

smbclient  -L  //127.0.0.1    本地连接测试

本人测试结果: 

使用版本samba3.0.20

平台mini2440

[root@ bin]# ./smbclient -L //127.0.0.1
creating lame upcase table
creating lame lowcase table
WARNING: no network interfaces found
Error connecting to 127.0.0.1 (Connection refused)
Connection to 127.0.0.1 failed

[root@ bin]# ./smbd -i -d 8

can't determine netmask for 192.168.1.25
WARNING: no network interfaces found
Netbios name list:-
my_netbios_names[0]="192"
push_sec_ctx(0, 0) : sec_ctx_stack_ndx = 1
push_conn_ctx(0) : conn_ctx_stack_ndx = 0
setting sec ctx (0, 0) - sec_ctx_stack_ndx = 1
NT user token: (NULL)
UNIX token of user 0
Primary group is 0 and contains 0 supplementary groups
Trying to load: smbpasswd
Attempting to register passdb backend smbpasswd
Successfully added passdb backend 'smbpasswd'
Attempting to register passdb backend tdbsam
Successfully added passdb backend 'tdbsam'
Attempting to register passdb backend guest
Successfully added passdb backend 'guest'
Attempting to find an passdb backend to match smbpasswd (smbpasswd)
Found pdb backend smbpasswd
pdb backend smbpasswd has a valid init
Attempting to find an passdb backend to match guest (guest)
Found pdb backend guest
pdb backend guest has a valid init
getsmbfilepwent: end of file reached.
endsmbfilepwent_internal: closed password file.
pop_sec_ctx (0, 0) - sec_ctx_stack_ndx = 0
User nobody in passdb, but getpwnam() fails!
attempting to free (and zero) a server_info structure