五,建立FTP,NFS和交叉编译环境
1,用命令配置TFTP服务
A, 建立TFTP系统根目录并修改权限
[email=root@yuanxh-desktop:/home/yuanxh/at91_works]
root@yuanxh-desktop:/home/yuanxh/at91_works[/email]# mkdir /tftpboot
[email=root@yuanxh-desktop:/home/yuanxh/at91_works]
root@yuanxh-desktop:/home/yuanxh/at91_works[/email]# chmod 777 /tftpboot
B,安装TFTP服务器端和客户端
[email=root@yuanxh-desktop:/]
root@yuanxh-desktop:/[/email]# sudo apt-get install tftp tftpd openbsd-inetd
C,修改配置文件使用TFTP根目录
[email=root@yuanxh-desktop:/home/yuanxh/at91_works]
root@yuanxh-desktop:/home/yuanxh/at91_works[/email]# vi /etc/inetd.conf
在/etc/inetd.conf如下行中,后面路径改成/tftpboot
tftp dgram udp wait nobody /usr/sbin/tcpd /usr/sbin/in.tftpd /tftpboot
D,启动服务
[email=root@yuanxh-desktop:/home/yuanxh/at91_works]
root@yuanxh-desktop:/home/yuanxh/at91_works[/email]# /etc/init.d/openbsd-inetd restart
E,测试服务
[email=root@yuanxh-desktop:/home/yuanxh]
root@yuanxh-desktop:/home/yuanxh[/email]# touch /tftpboot/aaa
[email=root@yuanxh-desktop:/home/yuanxh]
root@yuanxh-desktop:/home/yuanxh[/email]# vi /tftpboot/aaa
[email=root@yuanxh-desktop:/home/yuanxh]
root@yuanxh-desktop:/home/yuanxh[/email]# tftp 192.168.1.100
tftp> get aaa
tftp> quit
[email=root@yuanxh-desktop:/home/yuanxh]
root@yuanxh-desktop:/home/yuanxh[/email]# cat aaa
2,用命令配置NFS服务
A,安装NFS服务器端
[email=root@yuanxh-desktop:/home/yuanxh]
root@yuanxh-desktop:/home/yuanxh[/email]# apt-get install nfs-kernel-server nfs-common portmap
B,配置访问目录及权限
[email=root@yuanxh-desktop:/home/yuanxh/at91_works]
root@yuanxh-desktop:/home/yuanxh/at91_works[/email]# mkdir /nfsboot
[email=root@yuanxh-desktop:/home/yuanxh/at91_works]
root@yuanxh-desktop:/home/yuanxh/at91_works[/email]# chmod 777 /nfsboot
[email=root@yuanxh-desktop:/home/yuanxh/at91_works]
root@yuanxh-desktop:/home/yuanxh/at91_works[/email]# touch /nfsboot/yuanxh
[email=root@yuanxh-desktop:/]
root@yuanxh-desktop:/[/email]# vi /etc/exports
在/etc/exports新行中填入以下内容
/nfsboot *(rw,sync)
C,启动服务
[email=root@yuanxh-desktop:/]
root@yuanxh-desktop:/[/email]# exportfs -ra
[email=root@yuanxh-desktop:/]
root@yuanxh-desktop:/[/email]# /etc/init.d/portmap restart
[email=root@yuanxh-desktop:/]
root@yuanxh-desktop:/[/email]# /etc/init.d/nfs-common restart
[email=root@yuanxh-desktop:/]
root@yuanxh-desktop:/[/email]# /etc/init.d/nfs-kernel-server restart
D,测试服务
[email=root@yuanxh-desktop:/]
root@yuanxh-desktop:/[/email]# mount 192.168.1.100:/nfsboot /mnt
[email=root@yuanxh-desktop:/home/yuanxh]
root@yuanxh-desktop:/home/yuanxh[/email]# ll /mnt
[email=root@yuanxh-desktop:/home/yuanxh]
root@yuanxh-desktop:/home/yuanxh[/email]# rm -rf /mnt/yuanxh
[email=root@yuanxh-desktop:/home/yuanxh]
root@yuanxh-desktop:/home/yuanxh[/email]# showmount
[email=root@yuanxh-desktop:/home/yuanxh]
root@yuanxh-desktop:/home/yuanxh[/email]# df
[email=root@yuanxh-desktop:/home/yuanxh]
root@yuanxh-desktop:/home/yuanxh[/email]# umount /mnt
[email=root@yuanxh-desktop:/home/yuanxh]
root@yuanxh-desktop:/home/yuanxh[/email]# ll /nfsboot
3,安装交叉编译工具链
A,利用SecureCRT.v6.0.3登陆,传送文件到系统
[email=root@yuanxh-desktop:/home/yuanxh]
root@yuanxh-desktop:/home/yuanxh[/email]# mkdir /usr/local/arm
[email=root@yuanxh-desktop:/home/yuanxh]
root@yuanxh-desktop:/home/yuanxh[/email]# chmod 777 /usr/local/arm/
[email=root@yuanxh-desktop:/home/yuanxh]
root@yuanxh-desktop:/home/yuanxh[/email]# cd /usr/local/arm/
[email=root@yuanxh-desktop:/usr/local/arm]
root@yuanxh-desktop:/usr/local/arm[/email]# rz
在SecureCRT弹出的窗口中选择交叉编译工具安装包arm-2007-01-21.iso
B,安装ELDK交叉编译工具
[email=root@yuanxh-desktop:/usr/local/arm]
root@yuanxh-desktop:/usr/local/arm[/email]# cd /usr/local/
[email=root@yuanxh-desktop:/usr/local]
root@yuanxh-desktop:/usr/local[/email]# mkdir eldk-4.1
[email=root@yuanxh-desktop:/usr/local]
root@yuanxh-desktop:/usr/local[/email]# mount –o loop –t iso9660 arm-2007-01-21.iso /mnt/cdrom
[email=root@yuanxh-desktop:/usr/local]
root@yuanxh-desktop:/usr/local[/email]# cp -av /mnt/cdrom/* eldk-4.1/
[email=root@yuanxh-desktop:/usr/local]
root@yuanxh-desktop:/usr/local[/email]# cd eldk-4.1
[email=root@yuanxh-desktop:/usr/local/eldk-4.1]
root@yuanxh-desktop:/usr/local/eldk-4.1[/email]# chmod 777 install
[email=root@yuanxh-desktop:/usr/local/eldk-4.1]
root@yuanxh-desktop:/usr/local/eldk-4.1[/email]# ./install -d /usr/local/arm/eldk-4.1
注意:eldk-4.1在ubuntu-8.04安装的rpm工具版本有问题,处理方法请查看
http://lists.denx.de/pipermail/eldk/2008-July/000280.html
在
http://mirror.oss.lzu.edu.cn/software/embedded/eldk/4.2/ppc-linux-x86/distribution/RPMS/
中下载rpm-4.4.2-46.i386.rpm ,rpm-build-4.4.2-46.i386.rpm,rpm-devel-4.4.2-46.i386.rpm
在RPMS中增加rpm-4.4.2-46.i386.rpm ,rpm-build-4.4.2-46.i386.rpm,并在etc/rpm_cross.list 前两行中修改启用再安装。
D,把编译器路径添加到系统路径中
[email=root@yuanxh-desktop:/usr/local/arm]
root@yuanxh-desktop:/usr/local/arm[/email]# vi /root/.bashrc
在alias l='ls -CF'后的空白处填上:
PATH=$PATH:/usr/local/arm/eldk-4.1/usr/bin:/usr/local/arm/eldk-4.1/bin
export PATH
启动新系统路径
[email=root@yuanxh-desktop:/usr/local/arm]
root@yuanxh-desktop:/usr/local/arm[/email]# source /root/.bashrc
显示新系统路径
[email=root@yuanxh-desktop:/usr/local/arm]
root@yuanxh-desktop:/usr/local/arm[/email]# echo $PATH
查看版本号
[email=root@yuanxh-desktop:/usr/local/arm]
root@yuanxh-desktop:/usr/local/arm[/email]# arm-linux-gcc -v