移植share级别samba-3.2.15服务器到arm板

 

该版本支持IPV6

 


1.获取source code, http://www.samba.org Samba 3.2.15
2.解压

方法一:自己指定了samba一些配置文件和日志文件的存放路径
运行./configure CC=arm-linux-gcc AR=arm-linux-ar LD=arm-linux-ld RANLIB=arm-linux-ranlib \
--host=i686 \
--target=arm-linux \
--prefix= \
--disable-cups \
--disable-iprint \
--disable-pie \
--disable-fam \
--with-ads=no \
--with-ldap=no \
--with-cifsmount=no \
--with-logfilebase=/var/log \
--with-libdir=/usr/lib \
--with-swatdir=/usr/local/swat \
--with-rootsbindir=/sbin \
--with-lockdir=/var/lock \
--with-piddir=/var/lock \
--with-privatedir=/etc/samba \
--with-configdir=/etc/samba \
--cache-file=arm-linux.cache

可以复制的
./configure CC=arm-linux-gcc AR=arm-linux-ar LD=arm-linux-ld RANLIB=arm-linux-ranlib \
--host=i686 \
--target=arm-linux \
--prefix= \
--disable-cups \
--disable-iprint \
--disable-pie \
--disable-fam \
--with-ads=no \
--with-ldap=no \
--with-cifsmount=no \
--with-logfilebase=/var/log \
--with-libdir=/usr/lib \
--with-swatdir=/usr/local/swat \
--with-rootsbindir=/sbin \
--with-lockdir=/var/lock \
--with-piddir=/var/lock \
--with-privatedir=/etc/samba \
--with-configdir=/etc/samba \
--cache-file=arm-linux.cache

 

方法二:使用samba默认的路径(推荐)
 ./configure CC=arm-linux-gcc AR=arm-linux-ar LD=arm-linux-ld RANLIB=arm-linux-ranlib \
--host=i686 \
--target=arm-linux \
--disable-cups \
--disable-iprint \
--cache-file=arm-linux.cache
可以复制的
 ./configure CC=arm-linux-gcc AR=arm-linux-ar LD=arm-linux-ld RANLIB=arm-linux-ranlib \
--host=i686 \
--target=arm-linux \
--disable-cups \
--disable-iprint \
--cache-file=arm-linux.cache

经过以上的配置会出现的错误:
 
查看config.log文件的最后,将光标移到最后,找到配置终止的地方,我找到的关键字是“HAVE_VOLATILE”,然后打开configure文件,直接在该文件下查找“HAVE_VOLATILE”
如图:
 

修改如下:

 

然后要删除config.log这个文件之后再来./configure
以后还会出现一个问题:(修改图如下)

 

这个问题解决了基本上就没有什么问题了,最后得到Makefile文件

3.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目录中.

 

5.
share级别配置(ubantu下和开发板下这个配置都可以)
根据上面在./configure 的时候是否指定了路径来在arm文件系统中的/etc/samba或者在/usr/local/samba/lib/中创建smb.conf
[global]
workgroup = ARMSMB
netbios name =ArmSMB
server string = Arm Linux Samba Server
guest account = root
security = share

[share]
path = /root/share
writeable = yes
browseable = yes
guest ok = yes

user级别配置(只在ubantu下配置有效,开发板下会出现问题)
根据上面在./configure 的时候是否指定了路径来在arm文件系统中的/etc/samba或者在/usr/local/samba/lib/中创建smb.conf


以下把samba默认的配置选项都列举出来了
[global]
  workgroup = MYGROUP
 server string = Samba Server
 security = user
;   hosts allow = 192.168.1. 192.168.2. 127.
 load printers = no
;   printcap name = /etc/printcap
;   printcap name = lpstat
;   printing = cups
;  guest account = pcguest
   log file = /usr/local/samba/var/log.%m
   max log size = 50
;   password server = <NT-Server-Name>
;   realm = MY_REALM
;   passdb backend = tdbsam
;   include = /usr/local/samba/lib/smb.conf.%m
;   interfaces = 192.168.12.2/24 192.168.13.2/24
;   local master = no
;   os level = 33
;   domain master = yes
;   preferred master = yes
;   domain logons = yes
;   logon script = %m.bat
;   logon script = %U.bat
;   logon path = \\%L\Profiles\%U
;   wins support = yes
;   wins server = w.x.y.z
;   wins proxy = yes
   dns proxy = no

;  add user script = /usr/sbin/useradd %u
;  add group script = /usr/sbin/groupadd %g
;  add machine script = /usr/sbin/adduser -n -g machines -c Machine -d /dev/null -s /bin/false %u
;  delete user script = /usr/sbin/userdel %u
;  delete user from group script = /usr/sbin/deluser %u %g
;  delete group script = /usr/sbin/groupdel %g
 
以下 就是 一些 配置的例子
#============================ Share Definitions ==============================
;[homes]
 ;  comment = Home Directories
 ;  browseable = no
 ;  writable = yes

# Un-comment the following and create the netlogon directory for Domain Logons
; [netlogon]
;   comment = Network Logon Service
;   path = /usr/local/samba/lib/netlogon
;   guest ok = yes
;   writable = no
;   share modes = no


# Un-comment the following to provide a specific roving profile share
# the default is to use the user's home directory
;[Profiles]
;    path = /usr/local/samba/profiles
;    browseable = no
;    guest ok = yes


# NOTE: If you have a BSD-style print system there is no need to
# specifically define each individual printer
;[printers]
;   comment = All Printers
;   path = /usr/spool/samba
;   browseable = no

# Set public = yes to allow user 'guest account' to print
   guest ok = no
   writable = no
   printable = no

# This one is useful for people to share files
;[tmp]
;   comment = Temporary file space
;   path = /tmp
;   read only = no
;   public = yes

# A publicly accessible directory, but read only, except for people in
# the "staff" group
;[public]
;   comment = Public Stuff
;   path = /home/samba
;   public = yes
;   writable = no
;   printable = no
;   write list = @staff

# Other examples.
#
# A private printer, usable only by fred. Spool data will be placed in fred's
# home directory. Note that fred must have write access to the spool directory,
# wherever it is.
;[fredsprn]
;   comment = Fred's Printer
;   valid users = fred
;   path = /homes/fred
;   printer = freds_printer
;   public = no
;   writable = no
;   printable = yes

# A private directory, usable only by fred. Note that fred requires write
# access to the directory.
;[fredsdir]
;   comment = Fred's Service
;   path = /usr/somewhere/private
;   valid users = fred
;   public = no
;   writable = yes

# a service which has a different directory for each machine that connects
# this allows you to tailor configurations to incoming machines. You could
# also use the %U option to tailor it by user name.
# The %m gets replaced with the machine name that is connecting.
;[pchome]
;  comment = PC Directories
;  path = /usr/pc/%m
;  public = no
;  writable = yes

# A publicly accessible directory, read/write to all users. Note that all files
# created in the directory by users will be owned by the default user, so
# any user with access can delete any other user's files. Obviously this
# directory must be writable by the default user. Another user could of course
# be specified, in which case all files would be owned by that user instead.
;[public]
;   path = /usr/somewhere/else/public
;   public = yes
;   only guest = yes
;   writable = yes
;   printable = no


# The following two entries demonstrate how to share a directory so that two
# users can place files there that will be owned by the specific users. In this
# setup, the directory should be writable by both users and should have the
# sticky bit set on it to prevent abuse. Obviously this could be extended to
# as many users as required.
;[myshare]
;   comment = Mary's and Fred's stuff
;   path = /usr/somewhere/shared
;   valid users = mary fred
;   public = no
;   writable = yes
;   printable = no
;   create mask = 0765

[text2]
comment = text2
path = /home/zxh
writable = yes
valid users = movie1
public = no

简化之后就是如下的配置情况
[global]
   workgroup = MYGROUP
  server string = Samba Server
  security = user
  load printers = no
  log file = /usr/local/samba/var/log.%m
  max log size = 50
  dns proxy = no

[text2]
comment = text2
path = /home/zxh
writable = yes
valid users = movie1
public = no

经过testparam检查获得的结果:
 

在ubantu下需要建立进行如下操作
#useradd movie1//建立ubantu下的系统用户
#passwd movie1 //为该用户配置密码
#smbpasswd -a movie1 //添加samba用户同时建立登陆密码(注意一定要保证movie1在系统用户里面是有的)
6.运行(使用smbd -i -d 8 可以进行调试)
nmbd -D
smbd -D

在windows进行登陆\\ip

 

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


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

 

 

 

 


 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值