搜档网
当前位置:搜档网 › Linux 开发环境搭建手册

Linux 开发环境搭建手册

IAC-335x-Kit 嵌入式开发板/评估板Linux开发环境

搭建手册

版本号v1.0

2013年3月

杭州启扬智能有限公司版权所有

QIYANG TECHNOLOGY Co., Ltd

Copyright Reserved

有任何技术问题或需要帮助,请联系:supports@https://www.sodocs.net/doc/33802326.html, 第2页 共8页 购买产品,请联系销售:sales@https://www.sodocs.net/doc/33802326.html,

更多信息请访问:https://www.sodocs.net/doc/33802326.html,

目录

前言 (3)

一、准备工作 (3)

二、配置NFS 网络文件系统 (3)

三、安装交叉编译器 (5)

四、SAMBA 服务器的设置 (6)

前言

欢迎使用杭州启扬智能科技有限公司开发板IAC-335X-Kit,本手册针对本产品的linux开发环境的搭建予以说明,请在开发之前阅读本手册,并搭建好linux开发环境

一、准备工作

装有Linux系统(ubuntu或其它Linux发行版),本手册以ubuntu 12.04操作为例

二、配置NFS网络文件系统

1、安装NFS服务

lisl@ubuntu:~$ sudo apt-get install nfs-kernel-server

2、创建NFS共享目录

假设NFS共享目录是/home/nfs

lisl@ubuntu:~$ sudo mkdir /home/nfs

3、配置NFS

lisl@ubuntu:~$ vi /etc/exports

在/etc/exports文件末尾加入下面一行:

/home/nfs *(rw,sync,no_subtree_check,no_root_squash)

如下图所示:

有任何技术问题或需要帮助,请联系:supports@https://www.sodocs.net/doc/33802326.html,第3页共8页购买产品,请联系销售:sales@https://www.sodocs.net/doc/33802326.html,

更多信息请访问:https://www.sodocs.net/doc/33802326.html,

允许所有用户访问NFS共享目录

4、启动NFS服务器

启动portmap和nfs-kernel-server服务:

lisl@ubuntu:~$ sudo service portmap start

lisl@ubuntu:~$ sudo service nfs-kernel-server start

注:如果开发板不能挂载到宿主机可以试下以下方式:

lisl@ubuntu:~$sudo exportfs –a

lisl@ubuntu:~$ sudo /etc/init.d/portmap restart

lisl@ubuntu:~$ sudo /etc/init.d/nfs-kernel-server restart

5、本地验证NFS

有任何技术问题或需要帮助,请联系:supports@https://www.sodocs.net/doc/33802326.html,第4页共8页购买产品,请联系销售:sales@https://www.sodocs.net/doc/33802326.html,

更多信息请访问:https://www.sodocs.net/doc/33802326.html,

三、安装交叉编译器

在PC机上编译目标板所用的linux 内核和其他应用程序时要用到交叉编译器,我们的主板光盘中有做好的交叉编译工具链。

1、解压交叉编译工具链

把交叉编译工具链的压缩包拷贝到~/opt目录下

lisl@ubuntu:~$ cp arm-arago-linux-gnueabi.tar.gz ~/opt

lisl@ubuntu:~$ cd ~/opt

lisl@ubuntu:~$ tar -xvzf arm-arago-linux-gnueabi.tar.gz

这样在~/opt目录下就会有arm-arago-linux-gnueabi文件夹,这就是我们所要使用的交叉编译器

2、把交叉编译器的路径添加到环境变量里

lisl@ubuntu:~$ cd ~

lisl@ubuntu:~$ vi .bashrc

编辑.bashrc文件,在该文件最后后面添加以下路径:

export PATH=$PATH:~/opt/arm-arago-linux-gnueabi/bin

3、使新的环境变量生效

lisl@ubuntu:~$ source ~/.bashrc

4、查看交叉编译器版本信息

在终端输入以下命令来查看交叉编译器是否安装正确

lisl@ubuntu:~$ arm-arago-linux-gnueabi-gcc -v

如图所示:

有任何技术问题或需要帮助,请联系:supports@https://www.sodocs.net/doc/33802326.html,第5页共8页购买产品,请联系销售:sales@https://www.sodocs.net/doc/33802326.html,

更多信息请访问:https://www.sodocs.net/doc/33802326.html,

若出现上图中所显示的交叉编译器的信息,则说明交叉编译器安装正确,对应gcc版本为4.5.3,接下来就可以使用该编译器编译u-boot、内核及应用程序了。

四、samba服务器的设置

如果使用的ubuntu是在虚拟机下安装的,需要与windows的资源共享,可以在ubuntu操作系统下安装配置samba服务器,具体安装步骤如下:

1、安装samba服务

lisl@ubuntu:~$ sudo apt-get install samba smbfs

2、配置samba

编辑 /etc/samba/smb.conf配置文件

lisl@ubuntu:~$ sudo vi /etc/samba/smb.conf

①、将里面的security = user前面的#号去掉

②、在文件末尾添加以下内容:

有任何技术问题或需要帮助,请联系:supports@https://www.sodocs.net/doc/33802326.html,第6页共8页购买产品,请联系销售:sales@https://www.sodocs.net/doc/33802326.html,

更多信息请访问:https://www.sodocs.net/doc/33802326.html,

有任何技术问题或需要帮助,请联系:supports@https://www.sodocs.net/doc/33802326.html, 第7页 共8页 购买产品,请联系销售:sales@https://www.sodocs.net/doc/33802326.html,

更多信息请访问:https://www.sodocs.net/doc/33802326.html,

[samba] comment = Home Directories path = /home/lisl/samba available = yes browseable = yes read only = no public = yes

注:path后面的路径要用实际的绝对路径,若使用~/samba会导致一直不能访问

3、在系统设置里创建一个用户,用户名为samba

4、将samba 用户设置为samba 帐户

lisl@ubuntu:~$ sudo smbpasswd -a samba

lisl@ubuntu:~$ mkdir ~/samba

lisl@ubuntu:~$ chmod 777 ~/samba

5、重启samba 服务器

lisl@ubuntu:~$ sudo /etc/init.d/smbd restart 或者使用以下命令:

lisl@ubuntu:~$ sudo service smbd stop

lisl@ubuntu:~$ sudo service smbd restart

6、访问samba 服务器

如果重启samba 服务没有问题,我们就可以来验证samba 共享

在Windows 操作系统的文件夹处输入 "\\" + "ubuntu 机器的ip 地址 "

例:\\192.168.1.241

进入后可以看到共享目录samba,通过此目录就可以很方便的实现windows 与ubuntu 的资源共享了

杭州启扬智能科技有限公司

电话:0571-******** / 87858822

传真:0571-********

支持:0571-********

E-MAIL:supports@https://www.sodocs.net/doc/33802326.html,

网址:https://www.sodocs.net/doc/33802326.html,

地址:杭州市西湖区西湖科技园西园1路8号3A幢5F

邮编:310013

有任何技术问题或需要帮助,请联系:supports@https://www.sodocs.net/doc/33802326.html,第8页共8页购买产品,请联系销售:sales@https://www.sodocs.net/doc/33802326.html,

更多信息请访问:https://www.sodocs.net/doc/33802326.html,

相关主题