一. 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
4.tftp命令
TFTP load烧写/启动TFTP服务
tftp Address filename
//fox example : tftp 0x2000000 mbootpImage // command to download the code
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)
测试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
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