Difference between revisions of "IMX8/iMX8MEVK/Yocto/Alternative image loading"
(→Kernel TFTP + NFS File System Boot Option) |
|||
Line 33: | Line 33: | ||
=== Kernel TFTP + NFS File System Boot Option === | === Kernel TFTP + NFS File System Boot Option === | ||
− | + | When booting over NFS, the core kernel and file system are kept on a central server and then loaded onto the board to be booted. In order to "netboot" your firmware, you will simply need a working u-boot console session; by default, some of the environment variables shown below might already be defined, re-defining them should not cause trouble. | |
Revision as of 11:51, 19 November 2018
|
Contents
Basic Boot Options
For setting up the basic boot options via board switches, you can check the Selecting Boot Options page.
Network Boot
While developing, booting without the need to update your SD card every single time you rebuild your kernel / file system might significantly speed-up and ease your work. Network based boot options provide the alternative to boot your kernel from the SD card and mount your file system over NFS or even boot the kernel image from a TFTP server and later mount the file system over NFS; both options require some simple host setup as shown below.
NFS File System Boot Option
When booting over NFS, the file system is stored in the host / server, this method provides flexibility to constantly modify the content of the file system (install, update applications) without the need of removing the SD card.
- Power ON the i.MX8M EVK board, stop the booting process while still in u-boot, in the next step we will set a number of u-boot environment variables.
- While in u-boot, set the following environment variables:
u-boot=> setenv nfsroot /home/$USER/imx8-evk-dummy/rootfs u-boot=> setenv netargs 'setenv bootargs console=${console} root=/dev/nfs ip=dhcp rw nfsrootdebug nfsroot=${serverip}:${nfsroot},v3,tcp'
- Finally, boot the board:
u-boot=> boot
Kernel TFTP + NFS File System Boot Option
When booting over NFS, the core kernel and file system are kept on a central server and then loaded onto the board to be booted. In order to "netboot" your firmware, you will simply need a working u-boot console session; by default, some of the environment variables shown below might already be defined, re-defining them should not cause trouble.
NOTE: This procedure assumes that you have been able to complete a Yocto build cycle for the i.MX8M EVK as specified in the Building Yocto section and that you have configured a TFTP server service, some useful hints from RidgeRun's developer site here
- Copy the file system directory to a location outside the Yocto directory.
Yocto's internal directory layout can be rather complex, in the case of the file system for the i.MX8M EVK, the file system directory can be found under the following path:
{YOCTO_BUILD_DIR}/tmp/work/{TARGET}/{IMAGE}/1.0-r0/rootfs
One example for a Yocto Rocko build,
cd $YOCTO_BUIlD_DIR/build/tmp/work/imx8mqevk-poky-linux/fsl-image-multimedia-full/1.0-r0 mkdir /home/$USER/imx8-evk-dummy cp -r rootfs /home/$USER/imx8-evk-dummy/
- Copy the kernel image and kernel device tree blob into the TFTP directory (as configured during the TFTP service setup).
cd $YOCTO_BUIlD_DIR/build/tmp/deploy/images/imx8mqevk cp Image /srv/tftp cp Image-fsl-imx8mq-evk.dtb /srv/tftp/fsl-imx8mq-evk.dtb
- Power ON the i.MX8M EVK board, stop the booting process while still in u-boot, in the next step we will set a number of u-boot environment variables.
- While in u-boot, set the following environment variables:
u-boot=> setenv image Image; setenv fdt_file fsl-imx8mq-evk.dtb u-boot=> setenv loadaddr 0x40480000; setenv fdt_addr 0x43000000 u-boot=> setenv nfsroot /home/$USER/imx8-evk-dummy/rootfs u-boot=> setenv netargs 'setenv bootargs console=${console} root=/dev/nfs ip=dhcp rw nfsrootdebug nfsroot=${serverip}:${nfsroot},v3,tcp' u-boot=> setenv netboot 'echo Booting from net...; setenv autoload no; setenv autostart no; dhcp; setenv serverip <server_ip_address>; run netargs; tftpboot ${loadaddr} ${image}; \ tftpboot ${fdt_addr} ${fdt_file}; booti ${loadaddr} - ${fdt_addr}' *** Modify the server_ip_address to match your working environment.
- Boot the board, this command should load both the kernel image and device tree blob file from the TFTP server and mount the file system over NFS.
u-boot=> run netboot Booting from net... BOOTP broadcast 1 BOOTP broadcast 2 BOOTP broadcast 3 DHCP client bound to address 10.251.101.98 (1055 ms) Using ethernet@30be0000 device TFTP from server 10.251.101.145; our IP address is 10.251.101.98 Filename 'Image'. Load address: 0x40480000 Loading: ################################################################# ################################################################# . . . . ################################################################# 1.3 MiB/s done Bytes transferred = 20054528 (1320200 hex) Using ethernet@30be0000 device TFTP from server 10.251.101.145; our IP address is 10.251.101.98 Filename 'fsl-imx8mq-evk.dtb'. Load address: 0x43000000 Loading: ######### 876 KiB/s done Bytes transferred = 42199 (a4d7 hex) ## Flattened Device Tree blob at 43000000 Booting using the fdt blob at 0x43000000 Using Device Tree in place at 0000000043000000, end 000000004300d4d6 Starting kernel ...