基于winbond 950cdg samba for arm9+linux-2.6.17 的 移稙

来源:互联网 发布:unity3d培训机构 编辑:程序博客网 时间:2024/06/10 23:40

env.sh_smb-2.2.7a  在文章的底部
将env.sh_smb-2.2.7a 放入到解压后的  samba-2.2.7a/source/  下
 然后运行 
 ./env.sh_smb-2.2.7a
        在make 时可能会出现错误,
 vi nsswitch/winbindd_nss.h
   加入:typedef unsigned int uint32;
 保存
   make

  又出现错误.....
   删除: typedef unsigned int uint32;
    保存
   make
     (我也不清楚为什么,不过,通过了!)
        成功
        在 source/bin/下得到编译后的 程序如下
        nmbd
        smbd
        smbclient   ...
        arm-linux-strip  bin/*  压缩下
        file smbclient
        :smbclient: ELF 32-bit LSB executable, ARM, version 1 (SYSV), statically linked, stripped
        成功,
        接下来就是要对 文件系统进行配置了
        比如:
--with-configdir=$MB2_SAMBA      smb.conf  放在哪,这个在   configure 的选项中有配置了
--with-logfilebase=$MB2_SAMBA/log         log
--with-lockdir=$MB2_SAMBA/var/locks
--with-piddir=$MB2_SAMBA/var/locks           pid
--with-privatedir=$MB2_SAMBA/private       .....
 

          然后将写好的smb.conf放到/tmp/smb中  
          可以将  samba-2.2.7a/example/下的 smb.conf.default  改写成 smb.conf  用于开发板

          nmbd -i -d 3
          smbd -i -d 3  如果配置不正确,这些可以用于DEBUG
          nmbd -D
smbd -D
ps     
969 root       1092 S   /attach/ms0/smb2.7a/nmbd -D
971 root       2048 S   /attach/ms0/smb2.7a/smbd -D

 这个是用静太编译的,所以代码会大些,但是同样的配置对3.2.0以上的版本可以正常生成bin文件但在
ARM9板子上都不能运行 . 不知道为什么 ,请高手指教下!非常感谢!
 file  smbclient
 :bin/smbclient: ELF 32-bit LSB executable, ARM, version 1 (SYSV), dynamically linked (uses shared libs), stripped
在arm9板子上:  /attach/ms0/new3.2/smbclient: not found 

########################################################

#!/bin/sh
#export  LIBS=/usr/local/arm_linux_4.2/arm-none-linux-gnueabi/lib
export  CPPFLAGS=-I/usr/local/arm_linux_4.2/arm-linux/include
export  LDFLAGS='-L/usr/local/arm_linux_4.2/arm-linux/lib -L/usr/local/arm_linux_4.2/lib/gcc/arm-linux/4.2.1'
export  CC='/usr/local/arm_linux_4.2/bin/arm-linux-gcc -O2 -static '
export  PATH=$PATH:/usr/local/arm_linux_4.2/bin
export  AR=arm-linux-ar

echo /# > arm-linux.cache
MB2_SAMBA=/tmp/smb

./configure /
 --host=i686 /
 --target=arm-linux /
 --disable-cups  /
 --cache-file=arm-linux.cache /
 --disable-iprint /
 --disable-pie /
 --disable-fam /
    --disable-largefile    /
    --enable-swat=no /
    --enable-cup=no /
    --enable-iprint=no /
    --enable-pie=no /
    --enable-fam=no /
    --enable-static=yes /
    --enable-shared-libs=no /
    --enable-dnssd=no /
    --with-ldap=no /
    --with-ads=no /
    --with-cifsmount=no /
    --with-utmp=no /
    --with-libtalloc=no /
    --with-libtdb=no /
    --with-libnetapi=no /
    --with-libaddns=no /
    --with-libsmbclient=no /
    --with-libsmbsharemodes=no /
    --with-acl-support=no /
    --with-sendfile-support=no /
    --with-winbind=no /
    --with-static-modules=nmbd,smbd,smbclient,smbpasswd /
 --with-logfilebase=$MB2_SAMBA/log /
 --with-lockdir=$MB2_SAMBA/var/locks /
 --with-piddir=$MB2_SAMBA/var/locks /
 --with-privatedir=$MB2_SAMBA/private /
 --with-configdir=$MB2_SAMBA
#    --with-codepagedir=/tmp/codepagedir 

make clean
time make

cd ./bin
arm-linux-strip *
cd ..

########################################################

原创粉丝点击