https://download.samba.org/pub/samba/
http://samba.2283325.n4.nabble.com/Tough-question-errors-while-cross-compiling-to-MIPS-td2469448.html
先仔细阅读 configure 配置脚本使用说明
# ./configure --help `configure' configures this package to adapt to many kinds of systems. Usage: ./configure [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print `checking...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for `--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or `..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [/usr/local/samba] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, `make install' will install all the files in `/usr/local/samba/bin', `/usr/local/samba/lib' etc. You can specify an installation prefix other than `/usr/local/samba' using `--prefix', for instance `--prefix=$HOME'.根据步骤2的方法,将修改后的makefile文件放在samba-3.0.37目录下,然后 make 进行配置编译
samba-3.0.37# make开发板上面: 创建工作目录: mkdir /usr/local/samba /usr/local/samba/bin /usr/local/samba/lib /usr/local/samba/private /usr/local/samba/var 在/usr/local/samba/lib创建配置文件:smb.conf
# cat /usr/local/samba/lib/smb.conf display charset =UTF-8 unix charset = UTF-8 [global] interfaces = eth0 workgroup =MYGROUP server string =Samba netbios name =myarm guest account=root security =share ### sudo chmod 777 /share /// do it first [share] path=/share available=yes browsable=yes public=yes writable=yes拷贝 samba-3.0.37/source/bin/smbd 到 开发板的 /usr/local/samba/bin 目录下面; 在 /usr/local/samba/bin 目录下面执行 ./smbd -D
在PC中打开 \\192.168.1.230 就可以看到开发板的内容了。
如果 smb没有运行,可以用 smbd -i -d 8 启动smbd,可以打印启动信息,其中-i 是交互模式,-d是打印调试级别。 对照出错提示进行调试。
smbd -i -d 8参考: 1, 嵌入式samba功能的实现,linux下samba的移植 https://blog.csdn.net/ternence_hsu/article/details/70241669 2, 移植Samba-2.2.12到Hi3520 http://blog.chinaunix.net/uid-20682890-id-3483188.html 3, Tough question: errors while cross compiling to MIPS http://samba.2283325.n4.nabble.com/Tough-question-errors-while-cross-compiling-to-MIPS-td2469448.html