缥缈九哥

五,建立FTP,NFS和交叉编译环境

0
阅读(1677)

1,用命令配置TFTP服务
    A, 建立TFTP系统根目录并修改权限
        root@yuanxh-desktop:/home/yuanxh/at91_works# mkdir  /tftpboot
        root@yuanxh-desktop:/home/yuanxh/at91_works# chmod 777  /tftpboot
    B,安装TFTP服务器端和客户端
        root@yuanxh-desktop:/# sudo apt-get install tftp tftpd openbsd-inetd
    C,修改配置文件使用TFTP根目录
        root@yuanxh-desktop:/home/yuanxh/at91_works# vi  /etc/inetd.conf
        在/etc/inetd.conf新行中填入以下内容
        tftp    dgram   udp     wait    nobody  /usr/sbin/tcpd /usr/sbin/in.tftpd /tftpboot
    D,启动服务
        root@yuanxh-desktop:/home/yuanxh/at91_works#  /etc/init.d/openbsd-inetd  restart
    E,测试服务
        root@yuanxh-desktop:/home/yuanxh# touch /tftpboot/aaa
        root@yuanxh-desktop:/home/yuanxh# vi /tftpboot/aaa
        root@yuanxh-desktop:/home/yuanxh# tftp 192.168.1.100
        tftp> get aaa
        tftp> quit
        root@yuanxh-desktop:/home/yuanxh# cat aaa

2,用命令配置NFS服务
    A,安装NFS服务器端
        root@yuanxh-desktop:/home/yuanxh# apt-get install nfs-kernel-server  nfs-common  portmap
    B,配置访问目录及权限
        root@yuanxh-desktop:/home/yuanxh/at91_works# mkdir  /nfsboot
        root@yuanxh-desktop:/home/yuanxh/at91_works# chmod 777  /nfsboot
        root@yuanxh-desktop:/home/yuanxh/at91_works# touch  /nfsboot/yuanxh
        root@yuanxh-desktop:/# vi /etc/exports
        在/etc/exports新行中填入以下内容
        /nfsboot  192.168.1.0/24(rw,sync)
    C,启动服务
        root@yuanxh-desktop:/# exportfs -ra
        root@yuanxh-desktop:/# /etc/init.d/portmap restart
        root@yuanxh-desktop:/# /etc/init.d/nfs-common restart
        root@yuanxh-desktop:/# /etc/init.d/nfs-kernel-server restart
    D,测试服务
        root@yuanxh-desktop:/# mount 192.168.1.100:/nfsboot  /mnt
        root@yuanxh-desktop:/home/yuanxh# ll /mnt
        root@yuanxh-desktop:/home/yuanxh# rm -rf /mnt/yuanxh
        root@yuanxh-desktop:/home/yuanxh# showmount
        root@yuanxh-desktop:/home/yuanxh# df
        root@yuanxh-desktop:/home/yuanxh# umount /mnt
        root@yuanxh-desktop:/home/yuanxh# ll /nfsboot
       
3,安装交叉编译工具链
    A,利用SecureCRT 5.1.3登陆,传送文件到系统
        root@yuanxh-desktop:/home/yuanxh# mkdir /usr/local/arm
        root@yuanxh-desktop:/home/yuanxh# chmod 777 /usr/local/arm/
        root@yuanxh-desktop:/home/yuanxh# cd /usr/local/arm/
        root@yuanxh-desktop:/usr/local/arm# rz
        在SecureCRT弹出的窗口中选择交叉编译工具安装包
    B,解压交叉编译工具包
        root@yuanxh-desktop:/usr/local/arm# tar xjvf arm-2007q3-51-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2
        root@yuanxh-desktop:/usr/local/arm# tar xjvf arm-2007q3-53-arm-none-eabi-i686-pc-linux-gnu.tar.bz2
    C,安装ELDK交叉编译工具
        在虚拟机窗口中右击“arm-2007-01-22-uclibc.iso”选择“解压到此处”来解压;
        root@yuanxh-desktop:/usr/local/arm# cd arm-2007-01-22-uclibc/
        root@yuanxh-desktop:/usr/local/arm/arm-2007-01-22-uclibc# chmod 777 install
        root@yuanxh-desktop:/usr/local/arm/arm-2007-01-22-uclibc# ./install -d /usr/local/arm/eldk-uclibc-4.1
        在虚拟机窗口中右击“arm-2007-01-21.iso”选择“解压到此处”来解压;
        root@yuanxh-desktop:/usr/local/arm# cd arm-2007-01-21/
        root@yuanxh-desktop:/usr/local/arm/arm-2007-01-21# chmod 777 install
        root@yuanxh-desktop:/usr/local/arm/arm-2007-01-21# ./install -d /usr/local/arm/eldk-4.1
    D,把编译器路径添加到系统路径中
        root@yuanxh-desktop:/usr/local/arm#  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
  启动新系统路径
  root@yuanxh-desktop:/usr/local/arm# source /root/.bashrc
  显示新系统路径
  root@yuanxh-desktop:/usr/local/arm# echo $PATH
  查看版本号
  root@yuanxh-desktop:/usr/local/arm# arm-linux-gcc -v
    E,查看交叉编译工具版本信息
        root@yuanxh-desktop:/usr/local/arm# ./arm-2007q3/bin/arm-none-eabi-gcc -v
        root@yuanxh-desktop:/usr/local/arm# ./arm-2007q3/bin/arm-none-linux-gnueabi-gcc -v
        root@yuanxh-desktop:/usr/local/arm# ./eldk-uclibc-4.1/usr/bin/arm-linux-gcc -v