海思Hi3559av100移植samba文件服务器

下载地址

https://download.samba.org/pub/samba/

1、解压源码

tar -xvf samba-3.0.37.tar.gz

2、进入源码目录

cd samba-3.0.37/source/

3、配置

hi3559av100

./configure CC=aarch64-himix100-linux-gcc LD=aarch64-himix100-linux-ld ranlid=aarch64-himix100-linux-ranlid AR=aarch64-himix100-linux-ar --target=arm-aarch64-linux --host=i686

hi3519v101

./configure CC=arm-hisiv500-linux-gcc LD=arm-hisiv500-linux-ld ranlid=arm-hisiv500-linux-ranlid AR=arm-hisiv500-linux-ar --target=arm-hisiv500-linux --host=i686

出现错误:

configure: WARNING: If you wanted to set the --build type, don't use --host.
    If a cross compiler is detected then cross compile mode will be used.
SAMBA VERSION: 3.0.37
LIBREPLACE_LOCATION_CHECKS: START
checking build system type... x86_64-unknown-linux-gnu
checking host system type... i686-pc-none
checking target system type... arm-aarch64-linux-gnu
LIBREPLACE_LOCATION_CHECKS: END
LIBREPLACE_CC_CHECKS: START
checking for i686-gcc... aarch64-himix100-linux-gcc
checking for C compiler default output file name... 
configure: error: in `/home/year/nfs/ext/samba/samba-3.0.37/source':
configure: error: C compiler cannot create executables
See `config.log' for more details.

解决方法:

打开configure文件,在第588行下添加

test_cross_compiling=no

再出现错误,查看config.log,定位到configure文件第11498行

将“cross_compiling”改为“test_cross_compiling”,如图:

海思Hi3559av100移植samba文件服务器_第1张图片

再执行上面的configure,配置成功

4、编译

make

编译成功,生成的文件在samba-3.0.37/source/bin

5、嵌入式端

创建文件夹

mkdir -p /usr/local/samba/bin /usr/local/samba/lib /usr/local/samba/private /usr/local/samba/var

配置smb.conf

vi /usr/local/samba/lib/smb.conf

内容:

[global]
workgroup = workgroup
server string = camera
netbios name =camera
guest account=root
security =share
interfaces = eth0

[camera]
path = /mnt
guest ok=yes
browseable=yes
writable = yes
create mode=0777
directory mode=0777

开机自动运行:

vi /etc/init.d/rcS

添加:

/usr/local/samba/bin/smbd -D

ps查看进程,运行成功

海思Hi3559av100移植samba文件服务器_第2张图片

6、验证

我电脑,输入相机ip即可打开文件目录

\\192.168.1.88

海思Hi3559av100移植samba文件服务器_第3张图片

如果打不开,检查Windows程序功能SMB是否打开,如图

海思Hi3559av100移植samba文件服务器_第4张图片

参考:

https://blog.csdn.net/ternence_hsu/article/details/70241669

你可能感兴趣的:(海思开发)