预先准备:主机ubuntu安装配置tftp服务器、nfs服务器参考:开发板从网络启动 / boot board from network的环境安装设置

复制内核、设备树、根文件系统到根目录

1、复制内核、设备树到tftp根目录下,你可能需要根据实际情况修改路径,下同。

host$ cd PHYTEC_BSP/yocto_ti/build/arago-tmp-external-linaro-toolchain/deploy/images/am57xx-phycore-rdk
host$ cp zImage-am57xx-phycore-rdk.bin /tftpboot/zImage
host$ cp zImage-am57xx-phycore-rdk.dtb /tftpboot/am57xx-phycore-rdk.dtb

2、将根文件系统复制NFS共享目录

host$ cp tisdk-rootfs-image-am57xx-phycore-rdk.tar.gz /home/nicola/nfsroot/

3、进入NFS共享目录解压根文件系统

host$ cd /home/nicola/nfsroot
host$ mkdir am57xx-phycore-rdk
host$ tar zxvf tisdk-rootfs-image-am57xx-phycore-rdk.tar.gz  -C  am57xx-phycore-rdk


开发板uboot环境设置

1、uboot网络设置

U-Boot# setenv ipaddr 192.168.5.126 
U-Boot# setenv serverip 192.168.5.108 
U-Boot# setenv gatewayip 192.168.5.1 
U-Boot# setenv netmask 255.255.255.0 
U-Boot# setenv tftploc /tftpboot 
U-Boot# setenv rootpath /home/nicola/nfsroot/am57xx-phycore-rdk
U-Boot# saveenv

2、开发板网络启动选项,注意以下设置顺序,需要按照该顺序各个变量才能正确展开。

U-Boot# setenv static_ip ${ipaddr}:${serverip}:${gatewayip}:${netmask}:${hostname}:eth0:off
U-Boot# setenv netboot echo Booting from network ...\; setenv autoload no\; run netloadimage\; run netloadfdt\; run netargs\; bootz ${loadaddr} - ${fdtaddr} 
U-Boot# setenv netargs setenv bootargs console=${console} ${optargs} root=/dev/nfs nfsroot=${serverip}:${rootpath},${nfsopts} rw ip=${static_ip}
U-Boot# saveenv

3、开发板设置从网络启动

U-Boot# setenv bootcmd 'run boot_net'
U-Boot# saveenv

4、输入boot命令就可以从网络启动了

U-Boot# boot

参考文档:

nfsboot - http://elixir.free-electrons.com/linux/latest/source/Documentation/filesystems/nfs/nfsroot.txt

uboot-nfs - https://www.denx.de/wiki/DULG/LinuxNfsRoot

kernel command parameters - 

http://elixir.free-electrons.com/linux/latest/source/Documentation/admin-guide/kernel-parameters.rst

http://elixir.free-electrons.com/linux/latest/source/Documentation/admin-guide/kernel-parameters.txt



  • No labels