本帖最后由 yuanlai2010 于 2014-10-12 15:38 编辑
Helper2416基础开发环境篇
0:为了方便各种服务的使用,这里先关掉防火墙和selinux 1)关闭防火墙(永久) sudo systemctl stop firewalld.service sudo systemctl disable firewalld.service
2)关闭Selinux(永久) sudo vi /etc/sysconfig/selinux #This file controls the state of SELinux on the system. #SELINUX= can take one of these three values: # enforcing - SELinux security policy is enforced. # permissive - SELinux prints warnings instead of enforcing. # disabled - No SELinux policy is loaded.
SELINUX=disabled#change
1:安装arm-linux-gcc sudo tar -xvf arm926ej-eabi-4.4.6.tar -C /opt/ sodo yum install ld-linux.so.2 libstdc++.so.6 (安装运行所需的库) vim /etc/profile (设置环境变量) 在最后加入一行exportPATH=$PATH:/opt/arm-jyxtec-linux-gnueabi/bin
2:配置NFS服务器 1)安装nfs服务和rpcbind服务
sudo yum install rpcbind
sudo yum install nfs-utils
2)编辑/etc/exports文件
编辑/etc/exports文件,增加1个挂载点,内容如下:
/home/yuanlai/workspace*(rw,no_root_squash,no_all_squash)
3)修改挂载点的访问权限
sudo chmod 777 /home/yuanlai/workspace
4)启动rpcbind和nfs服务:
sudo systemctl restart rpcbind.service
sudo systemctl restartnfs.service # 立即启动NFS sudo systemctl enable nfs-server.service # 开机启动NFS
3:安装与配置minicom 1)安装minicom sudo yum install minicom
2)配置minicom sudo minicom -s +-----------------------------------------------------------------------+ |A - Serial Device : /dev/ttyUSB0 | | | |C - Callin Program : | |D - Callout Program : | |E - Bps/Par/Bits : 115200 8N1 | |F - Hardware Flow Control : No | |G - Software Flow Control : No | | | | Change which setting? | +-----------------------------------------------------------------------+
4:配置开发板网络接口(通过minicom在开发板内操作) 1)编辑配置文件 vi /etc/eth0-setting 内容如下(根据情况修改) IP=192.168.1.9 (开发板的IP地址) Mask=255.255.255.0 Gateway=192.168.1.1 DNS=202.82.1.1 MAC=08:90:90:90:90:20
2)通过配置文件配置网络接口 /sbin/ifconfiglo 127.0.0.1 /etc/init.d/ifconfig-eth0
5:挂载NFS到开发板 mount -t nfs -o nolock,tcp 192.168.1.2:/home/yuanlai/workspace/home/fedora
如下是我开发板的一个开机运行的脚本,用来自动挂载NFS - #!/bin/sh
-
- #See how we were called
- case "$1" in
- start)
- # ifconfig eth0 down
- # ifconfig eth0 hw ether 08:90:90:90:90:20
- # ifconfig eth0 192.168.1.9 netmask 255.255.255.0 up
- # route add default gw 192.168.1.1
- # echo nameserver 202.82.1.1>/etc/resolv.conf
- /sbin/ifconfig lo 127.0.0.1
- /etc/init.d/ifconfig-eth0
- mount -t nfs -o nolock,tcp 192.168.1.7:/home/Linux/workspace /home/centos
- mount -t nfs -o nolock,tcp 192.168.1.2:/home/yuanlai/workspace /home/fedora
- ;;
- stop)
- umount /home/centos
- umount /home/fedora
- ;;
- esac
- exit 0
-
复制代码 |