Yocto Setup TFTP/NFS: Difference between revisions

From Variscite Wiki
(Show CONFIG_FEC note when kernel < 5.4.24 OR when (kernel >= 5.4.24 AND defconfig != imx8mq_var_dart_defconfig))
Line 2: Line 2:
--> {{#vardefine:RELEASE_PARAM|{{#urlget:release}}}} <!--
--> {{#vardefine:RELEASE_PARAM|{{#urlget:release}}}} <!--
--> {{#lst:Yocto_Platform_Customization|{{#var:RELEASE_PARAM|RELEASE_MORTY_V1.0_DART-6UL}}}} <!--
--> {{#lst:Yocto_Platform_Customization|{{#var:RELEASE_PARAM|RELEASE_MORTY_V1.0_DART-6UL}}}} <!--
--> {{PageHeader|{{#var:HARDWARE_NAME}} - Yocto Setup TFTP/NFS}} {{DocImage|category1={{#var:HARDWARE_NAME}}|category2=Yocto}} __toc__
--> {{PageHeader|{{#var:HARDWARE_NAME}} - Yocto Setup TFTP/NFS}} {{DocImage|category1={{#var:HARDWARE_NAME}}|category2=Yocto}} __toc__<!--
 
Show CONFIG_FEC note if these conditions met:
1. KERNEL_VER >= 5.4.24
2. KERNEL_DEFCONFIG == imx8mq_var_dart_defconfig
3. SOC_SERIES == imx8
or
1. KERNEL_VER < 5.4.24
2. SOC_SERIES == imx8
 
-->{{#vardefine:KERNEL_VER_VER|{{#explode:{{#var:KERNEL_VER}}|.|0}}}}<!--                                                                                    Parse Kernel Version XX.yy.zz
-->{{#vardefine:KERNEL_VER_MAJOR|{{#explode:{{#var:KERNEL_VER}}|.|1}}}}<!--                                                                                  Parse Kernel Version xx.YY.zz
-->{{#vardefine:KERNEL_VER_MINOR|{{#explode:{{#var:KERNEL_VER}}|.|2}}}}<!--                                                                                  Parse Kernel Version xx.yy.ZZ
-->{{#vardefine:SHOW_CONFIG_FEC|1}}<!--                                                                                                                      Initialize SHOW_CONFIG_FEC = 1
 
Check KERNEL_VER and KERNEL_DEFCONFIG
-->{{#ifexpr: {{#var:KERNEL_VER_VER}}.{{#var:KERNEL_VER_MAJOR}} >= 5.4|{{#ifexpr: {{#var:KERNEL_VER_MINOR}} >= 24|<!--                                      if KERNEL_VER > 5.4.24
-->{{#ifeq: {{#var:KERNEL_DEFCONFIG}} | imx8mq_var_dart_defconfig ||<!--                                                                                    and KERNEL_DEFCONFIG != imx8mq_var_dart_defconfig
-->{{#vardefine:SHOW_CONFIG_FEC | 0}}<!--                                                                                                                    SHOW_CONFIG_FEC = 0
-->}}|<!--minor >= 24-->}}|<!--major >= 5.4-->}}<!--
-->{{#ifeq: {{#var:SOC_SERIES}} | imx8 ||{{#vardefine:SHOW_CONFIG_FEC|0}}}}<!--                                                                              if SOC_SERIES != mx8, SHOW_CONFIG_FEC = 0 -->
= Running Yocto rootfs on Variscite board using TFTP &amp; NFS  =
= Running Yocto rootfs on Variscite board using TFTP &amp; NFS  =


Line 54: Line 74:
}}
}}


{{#ifeq: {{#var:SOC_SERIES}} | imx8 |
{{#ifexpr: {{#var:SHOW_CONFIG_FEC}} |
{{Note|'''The default kernel configuration should be modified to compile Ethernet driver into kernel image instead compiling it as a loadable module.'''
{{Note|'''The default kernel configuration should be modified to compile Ethernet driver into kernel image instead compiling it as a loadable module.'''
Follow our kernel compilation guide {{Varlink|Yocto_Build_Linux|{{#var:RELEASE_LINK}}|Build kernel from source code}}<br>
Follow our kernel compilation guide {{Varlink|Yocto_Build_Linux|{{#var:RELEASE_LINK}}|Build kernel from source code}}<br>

Revision as of 21:11, 19 October 2020

DART-6UL - Yocto Setup TFTP/NFS

Running Yocto rootfs on Variscite board using TFTP & NFS

Host

Make sure you installed NFS server:

$ sudo apt-get install nfs-kernel-server
$ cd ~/var-fslc-yocto
$ sudo mkdir rootfs
$ cd rootfs
$ sudo tar xvf  ../build_x11/tmp/deploy/images/imx6ul-var-dart/fsl-image-gui-imx6ul-var-dart.tar.gz
$ sudo gedit /etc/exports

Add the following line (change <uname> to the name of user):

/home/<uname>/var-fslc-yocto/rootfs    *(rw,sync,no_root_squash,no_all_squash,no_subtree_check) 

exit & save

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

Make sure you installed TFTP server:

$ sudo apt-get install xinetd tftpd tftp

Verify the following:

$ ls /usr/sbin/in.tftpd
$ sudo gedit /etc/xinetd.d/tftp
service tftp
{
	protocol = udp
	port = 69
	socket_type = dgram
	wait = yes
	user = nobody
	server = /usr/sbin/in.tftpd
	server_args = /tftpboot
	disable = no
}

and run:

$ sudo mkdir /tftpboot
$ sudo chmod -R 777 /tftpboot
$ sudo /etc/init.d/xinetd restart
$ cd ~/var-fslc-yocto/build_x11/


$ sudo cp tmp/deploy/images/imx6ul-var-dart/zImage /tftpboot
$ for f in tmp/deploy/images/imx6ul-var-dart/*.dtb; do if [[ -L $f ]] && [[ $f != *imx6ul-var-dart.dtb ]]; then sudo cp $f /tftpboot; fi done
$ sudo rename 's/zImage-//' /tftpboot/zImage-*.dtb


Target

Make sure you have a serial connection to the target.

Reset and hold the space bar. This will bring you to U-Boot command line.

=> setenv serverip 192.168.1.188
=> setenv nfsroot /home/<uname>/var-fslc-yocto/rootfs (change <uname> to the name of user)
=> setenv bootcmd run netboot
=> saveenv 

You are all set. Connect Ethernet cable, power cycle the DART-6UL and it should boot over NFS.