Chinaunix首页 | 论坛 | 博客
  • 博客访问: 130971
  • 博文数量: 14
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 633
  • 用 户 组: 普通用户
  • 注册时间: 2013-09-05 11:44
文章存档

2014年(14)

我的朋友

分类: LINUX

2014-08-31 17:07:39

一、移植samba到ARM
1、下载源码


2、解压源码
# tar -xvf samba-3.5.22.tar.gz

3、进入源码目录
# cd samba-3.5.22/source3

4、运行配置脚本
$ ./configure --host=arm-linux --target=arm-linux 
如果报错
checking that the C compiler understands -Werror... cross
checking that the C compiler understands -w2... cross
checking that the C compiler understands -errwarn... cross
checking that the C compiler understands -qhalt... cross
checking that the C compiler understands negative enum values... configure: error: in `/home/work/samba-3.5.22/source3':
configure: error: cannot run test program while cross compiling
See `config.log' for more details
在configure文件的开头添加一下内容
samba_cv_CC_NEGATIVE_ENUM_VALUES=yes

5、编译源码
$ make
编译如果报
Compiling ../nsswitch/winbind_nss_linux.c
../nsswitch/winbind_nss_linux.c:29: error: 'PTHREAD_MUTEX_INITIALIZER' undeclared here (not in a function)
The following command failed:
修改nsswitch/winbind_nss_linux.c

#if HAVE_PTHREAD_H
#include
#endif

#include

如果报
Compiling ../nsswitch/wins.c
../nsswitch/wins.c:32: error: 'PTHREAD_MUTEX_INITIALIZER' undeclared here (not in a function)
修改nsswitch/wins.c

#if HAVE_PTHREAD_H
#include
#endif

#include

二、使用samba
1、在开发板中建立目录
/usr/local/samba/bin
/usr/local/samba/private
/usr/local/samba/lib
/usr/local/samba/var
/usr/local/samba/var/locks
/usr/local/samba/var/log

2、创建空文件
/usr/local/samba/lib/valid.dat
/usr/local/samba/private/secrets.tdb

3、将source3/bin目录下的nmbd、smbd、testparm、smbpasswd复制到开发板的/usr/local/samba/bin目录中
将source3/bin/libwbclient.so.0复制到开发板的/lib目录中

4、在开发板中创建配置文件/usr/local/samba/lib/smb.conf,内容为
[global]
workgroup =Mygroup
server string =MiFi Samba Server
netbios name =mifi
guest account=root
security =share
[share]
path =/usr/share
writeable =yes
guest ok=yes
public=yes
browseable=yes

5、在开发板上运行测试程序
# cd /usr/local/samba/bin
# ./testparm

6、添加用户
在开发板中创建文件/etc/passwd
# adduser nobody
# ./smbpasswd -a nobody
修改/etc/passwd

nobody:x:1000:1000:Linux User,,,:/home/nobody:/bin/sh

nobody:x:0:0:Linux User,,,:/home/nobody:/bin/sh

7、在开发板中运行smb
# ./nmbd -D
# ./smbd -D

8、如果需要打印日志,使用一下命令启动
# ./smbd -i -d 8

9、在windows资源管理器地址栏输入\\192.168.0.152就可以看见开发板共享的share目录
阅读(4379) | 评论(0) | 转发(0) |
3

上一篇:hostap移植到ARM

下一篇:ppp移植

给主人留下些什么吧!~~