|
EDA365欢迎您登录!
您需要 登录 才可以下载或查看,没有帐号?注册
x
socFPGA同主机共享文件的三种方法。我喜欢用后两种
2 ?+ R% k! J* Z4 ^8 @ 第一种方法用开发板厂家提供的scp命令,这里不详说了,我一般不用,太麻烦。 P4 x+ V; j+ Z! o% W4 Y
" `& l# B: U" B
第二种方法是用samba, 这种方法适合初学都,不过搭环境有些麻烦,假若你的开发板厂家的SD img 里没有移值好的samba,初学就很难搭起来。搭好了,就可以同WINDOWS 共享文件了。就是在开发板上建一个共享文件夹共享给windows。
3 x6 ]0 Z0 X6 Z: B- j+ J5 h A! F& M假若不会移植samba,没关系,到https://rocketboards.org/网站上下载个alta_socfpga工程的SD img,上面有移植好的samba。
. B6 I- [! `& O0 N! A8 X下面是samba的配置方法7 F8 Y1 ]/ a/ \( S
root@zjh:~# vi /etc/samba/smb.conf在最后添加
4 O4 c9 I1 X% k, ]" C[home]
# H( w& C2 P+ A% C% @( {/ t path = /home & c9 s6 a% E1 @$ y* J. a: I y
browseable = yes 4 m: z% x0 d% P. U2 b" x" {/ i
writeable = yes - N- L! R8 ]6 ]" n
valid user = zjh ! F* s( x. n9 J
添加 samba 用户并设置密码 / U6 |( \: N- x! h# f# V9 G9 c
root@zjh:~# smbpasswd -a zjh * S: a. c6 r& m" f
New SMB password: xxxxxxxx
5 G6 V( z* p0 y% p% {) fRetype new SMB password: xxxxxxxx. v% l- t) P, l7 H! C: D' [; u8 X, c. R
4 K- X) |, }8 B7 V, [2 P0 p 第三种方法采用网络挂载的主法。这个也很方便,但是要在主机上装linux才行。再在linux上按装NFS,以下是按装NFS的方法- h2 V" A. q7 s) k) ]
安装 nfs 4 n$ Z; B& K2 }) c* N+ ]
root@zjh:~# apt-get install nfs-kernel-server
7 s, H5 n# ]" f( i 修改配置文件root@zjh:~# vi /etc/exports
: X: }: `. b$ Z /home/work/rootfs *(rw,sync,no_root_squash)
: C7 F7 {7 J. S1 ^ 说明:
* c \9 D" m0 s, g( y9 Q O2 v5 X rw:allow both read and write requests on this NFS volume. The default is to disallow anyrequest which changes the filesystem. This can also be made explicit by using the ro option. 8 g- Q. k& O2 j2 J& O( j6 X& z5 H, Y
sync:reply to requests only after the changes have been committed to stable storage (see asyncabove). , m1 S6 g" W+ \
no_root_squash:turn off root squashing. This option is mainly useful for diskless clients.
5 E5 G7 X8 c. \8 [下面是文件挂载命令:- V( n) _; ~/ ^. c' D
mount -t nfs 192.168.100.63:/home/work/rootfs /home/xuser -o nolock
0 j2 A8 b% y. o# V
8 O0 @# u8 D3 T' b- [6 } |
|