↵
参考:https://community.nxp.com/docs/DOC-103717
#apt-get install xinetd tftp tftpd isc-dhcp-server nfs-kernel-server portmap
(1)xinetd.conf 添加配置信息
#gedit /etc/xinetd.conf
添加如下 配置信息
service tftp
{
socket_type = dgram
protocol = udp
wait = yes
user = root
server = /usr/sbin/in.tftpd
server_args = -s /home/winton/project/image/ (存放zImage文件的路径)
disable = no
}
其中 /home/winton/project/image/ 为我的路径
(2)重启xinetd服务
#service xinetd restart
(3)测试tftp
#tftp localhost
#tftp> get {An Image found in the tftp folder}
#tftp> quit
(1)添加配置信息
#gedit /etc/exports
添加 :/homewinton/project/rootfs_nfs *(rw,no_root_squash)
其中/homewinton/project/rootfs_nfs 为我的路径
(2)重启服务
sudo service portmap restart
sudo service nfs-kernel-server restart
baudrate=115200
board_name=CWD6ULL
board_rev=14X14
bootargs=console=ttymxc0,115200 ubi.mtd=3 root=ubi0:rootfs rootfstype=ubifs mtdparts=gpmi-nand:4m(boot),10m(kernel),1m(dtb),-(rootfs)
bootcmd=nand read ${loadaddr} 0x400000 0xA00000;nand read ${fdt_addr} 0xE00000 0x100000;bootz ${loadaddr} - ${fdt_addr}
bootcmd_mfg=run mfgtool_args;bootz ${loadaddr} ${initrd_addr} ${fdt_addr};
bootdelay=3
console=ttymxc0
ethact=FEC0
ethprime=FEC
fdt_addr=0x83000000
fdt_high=0xffffffff
initrd_addr=0x83800000
initrd_high=0xffffffff
loadaddr=0x80800000
mfgtool_args=setenv bootargs console=${console},${baudrate} rdinit=/linuxrc g_mass_storage.stall=0 g_mass_storage.removable=1 g_mass_storage.file=/fat g_mass_storage.ro=1 g_mass_storage.idVendor=0x066F g_mass_storage.idProduct=0x37FF g_mass_storage.iSerialNumber="" mtdparts=gpmi-nand:4m(boot),10m(kernel),1m(dtb),-(rootfs) clk_ignore_unused
panel=TFT35CWD
#setenv serverip 192.168.0.229
#setenv ethaddr 12:34:56:78:9A:BC
#setenv nfs_root /home/winton/project/rootfs_nfs
#setenv fdt_file imx6ull-14x14-evk-gpmi-weim.dtb
#setenv nfs_bootargs 'setenv bootargs console=ttymxc0,115200 root=/dev/nfs ip=dhcp nfsroot=${serverip}:${nfs_root},v3,tcp'
#setenv bootcmd 'run nfs_bootargs; dhcp zImage; dhcp ${fdt_addr} ${fdt_file}; bootz ${loadaddr} - ${fdt_addr}'
#saveenv
#reset
(1)help: 查看全部命令
(2)help: xxx 查看xxx命令细则
(3)bootz: 启动命令, bootz ${loadaddr} ${initrd_addr} ${fdt_addr}
loadaddr:内核镜像地址
initrd_addr:init ram disk地址,如果没有,可以用-代替。(initrd为系统引导过程中挂载的临时根文件系统)
fdt_addr: 设备树文件地址,格式为 xxx.dtb
(4)tftpboot /dhcp: 下载命令, tftpboot [loadAddress] [bootFileName] (要先在PC端设置 tftp服务)
dhcp - boot image via network using DHCP/TFTP protocol
tftpboot- boot image via network using TFTP protocol
(5)bootdelay : 启动时进入uboot设置的延时
(6)bootargs:uboot启行内核时传递给内核的启动参数
(7)bootcmd :uboot在不进入设置界面时自动执行的命令
(8)setenv 变量名 命令
命令可以是echo代码 ,也可以迭代setenv,可以有多条命令,各命令之间用 ;隔开
(9)saveenv:保存更改,
(10) reset:重启
#bootcmd=if mmc rescan; then if run loadbootscript; then run bootscript; else if test ${bootdev} = sd1; then echo update emmc_xxxx;run update_emmc;else echo mmc boot_xxx;if run loadimage; then run mmcboot; else run netboot; fi; fi; fi; else run netboot; fi;
#bootcmd_mfg=run mfgtool_args;bootz ${loadaddr} ${initrd_addr} ${fdt_addr};
等同于下面
bootcmd=
if mmc rescan; then //如果有mmc执行
if run loadbootscript; then
run bootscript;
else
if test ${bootdev} = sd1; then //上面的变量bootdev=mmc2 ,所以转else
echo update emmc.........;
run update_emmc;
else
echo mmc boot..........;
if run loadimage; then //如果fatload载入内核成功就执行,否则转netboot
run mmcboot;
else
run netboot;
fi;
fi;
fi;
else //没有mmc时执行
run netboot;
fi;