ubuntu16.04下安装tftp nfs服务

一.  ubuntu16.04下安装tftp-server 

1.安装tftp-server 
sudo apt-get install tftp-hpa(如果不需要客户端可以不安装)
 
tftp-hpa是客户端
 
tftpd-hpa是服务器端
 
2.配置TFTP服务器
 
sudo vim /etc/default/tftpd-hpa
 
将原来的内容改为:
 
TFTP_USERNAME="tftp"
 
TFTP_ADDRESS="0.0.0.0:69"
 
TFTP_DIRECTORY="tftp根目录" #服务器目录,需要设置权限为777,chomd 777
 
TFTP_OPTIONS="-l -c -s"
 
3.重新启动TFTP服务
 
sudo service tftpd-hpa restart

参考网址:http://blog.csdn.net/hens007/article/details/7255465



4.tftp命令

TFTP load烧写/启动TFTP服务
  tftp  Address filename

//fox example : tftp 0x2000000 mbootpImage // command to download the code


1:busybox下的tftp用法
tftp -g  -r u-boot.bin 192.168.0.18
2:linux下tftp的用法
tftp 192.168.0.18
get  u-boot.bin


二  ubuntu下安装nfs服务

    启动NFS服务

$sudo apt-get install nfs-kernel-server //install
service nfs-kernel-server //to see if installed
service nfs start
service portmap start

$sudo /etc/init.d/nfs-kernel-server restart //to effect NFS

 sudo mkdir /nfs
  sudo chmod 777 /nfs
 sudo service nfs-kernel-server restart


//Modify /etc/exports file as mentioned with root privileges

 sudo vim /etc/exports ,to add path

 /nfs/../ rootfs *(rw,sync, no_root_squash)  //;,no_subtree_check)

///root/targetfs *(rw,no_root_squash,no_all_squash,sync)
  测试NFS服务
 此时可以运行以下命令来显示一下共享出来的目录:
  exportfs -ra
 $showmount -e 

sudo mount -t nfs localhost:/opt/gm8136/target/rootfs-cpio /mnt/  

or

mount -t nfs -o nolock 192.168.1.216:/opt/gm8136/target/rootfs-cpio   /mnt


ifconfig eth0 192.168.0.17;route add default gw 192.168.0.1;
mkdir -p /tmp/nfs;mount -t nfs -o nolock -o tcp 192.168.1.133:/root/targetfs /tmp/nfs
mkdir -p /tmp/nfs;mount -t nfs -o nolock -o tcp 192.168.1.134:/root/targetfs /tmp/nfs


三. linux命令备忘



查找模块是否安装
rpm -qa | grep fribidi
rpm -qa | grep tftp


删除CVS目录
find . -name CVS |xargs rm -rf

find . -name "*.depend" |xargs rm -rf

tar  zcvf Filename.tar.gz Dirname  //--to compress 


四 *NFS启动方式*

//setenv bootargs 'console=ttyS0,115200 root=/dev/nfs rw nfsroot=192.168.1.216:/opt/gm8136/target/rootfs-cpio ip=192.168.1.209::192.168.1.163:255.255.255.0:eth0:off init=/linuxrc mem=128m' 


//setenv bootargs 'console=ttySGM0 noinitrd root=/dev/mtdblock5  rootfstype=squashfs mem=46m sensor=OV2710 wifi=MT7601 product=WIFI_DVR rtc=0 version=v1.2.3.2 phytype=1 rootfstype=squashfs switch_printk=1 video=gk_fb0:720x480,720x480,8,0'
//set tftpboot 'tftp ${loadaddr} ${bootfile};go 0x2000000'
set tftpboot ' root=/dev/nfs nfsroot=${nfsserver}:${rootpath} ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:${hostname}:${netdev} mac=${ethaddr} console=ttyS0,${baudrate} init=/linuxrc mem=${mem} gmmem=90M ;tftp ${loadaddr} ${bootfile};go ${loadaddr}'

set bootcmd 'run tftpboot'
set rootpath '/opt/STM/rootfs/rootfs_glibc'
Kernel command line: root=/dev/nfs nfsroot=192.168.57.124:/home/fs/rootfs_glibc,proto=tcp,nfsvers=3,nolock ip=192.168.55.209:192.168.55.144:192.168.55.1:255.255.255.0:"gk8602":eth0 mac=3C:97:0E:22:E1:14 phytype=0 console=ttySGK0,115200 mem=46M


nfsboot =setenv bootargs root=/dev/nfs nfsroot=${nfsserver}:${rootpath},proto=tcp,nfsvers=3,nolock ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:${hostname}:${netdev} mac=${ethaddr} phytype=${phytype} ${fb} console=${consoledev},${baudrate} mem=${mem} sensor=${sensor} wifi=${wifi} rtc=${rtc} acc=${acc} product=${product} ;sf probe; sf read 0xc1000000 0x100000 0x300000; bootm

tftpboot=setenv bootargs root=/dev/nfs nfsroot=${nfsserver}:${rootpath},proto=tcp,nfsvers=3,nolock ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:${hostname}:${netdev} mac=${ethaddr} phytype=${phytype} console=${consoledev},${baudrate} mem=${mem} ${fb} sensor=${sensor} rtc=${rtc} acc=${acc} wifi=${wifi} product=${product};tftpboot ${bootfile};bootm


         tftp 0xC1000000 u-boot_gk7101_yeburn.bin
         sf probe
         sf erase 0x0 0x50000             //0x40000-256k the size
         sf write 0xC1000000 0x0 0x50000  //0x40000
  

使用make menuconfig 等功能,都会用到ncurses库。
ubuntu下安装ncurses库的方法:
root权限下输入:sudo apt-get install libncurses5-dev


Openssl源码下载网站 http://www.openssl.org/source/,
./Configure linux-elf-arm -DL_ENDIAN linux:'arm-unknown-linux-uclibcgnueabi-gcc' shared --prefix=/home/yelsin/work/yelsin2017/openssl //要视具体路径而定
make 
make install
2 wpa_suplicant 的源码下载http://hostap.epitest.fi/wpa_supplicant/   makefile修改
  CFLAGS += -I/home/yelsin/work/yelsin2017/openssl/include   #yelsin  add L30
   LIBS += -lssl -L/home/yelsin/work/yelsin2017/openssl/lib/
   LIBS_p += -lcrypto -L/home/yelsin/work/yelsin2017/openssl/lib/
 cp defconfig .config
 make

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值