Yocto Setup TFTP/NFS: Difference between revisions

From Variscite Wiki
No edit summary
No edit summary
Line 53: Line 53:
{{#ifeq: {{#var:HARDWARE_NAME}} | DART-MX8M |
{{#ifeq: {{#var:HARDWARE_NAME}} | DART-MX8M |
{{Note|Default kernel configuration should be modified to compile Ethernet driver into kernel image instead compiling it as a loadable module.
{{Note|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}}
Follow our kernel compilation guide {{Varlink|Yocto_Build_Linux|{{#var:RELEASE_LINK}}|Build kernel from source code}}
Run "make menuconfig", go to "Device Drivers → Network device support → Ethernet driver support → Freescale devices → FEC ethernet controller" and press y.
Run "make menuconfig", go to "Device Drivers → Network device support → Ethernet driver support → Freescale devices → FEC ethernet controller" and press y.
Compile the kernel and copy arch/arm64/boot/Image.gz to /tftpbbot }}
Compile the kernel and copy arch/arm64/boot/Image.gz to /tftpbbot }}
}}
}}



Revision as of 14:11, 9 August 2018

- 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 
$ sudo mkdir rootfs
$ cd rootfs
$ sudo tar xvf  ..//tmp/deploy/images//fsl-image-gui-.tar.gz
$ sudo gedit /etc/exports

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

/home/<uname>/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:
$ 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
}
$ sudo mkdir /tftpboot
$ sudo chmod -R 777 /tftpboot
$ sudo /etc/init.d/xinetd restart
$ cd //
$ cp tmp/deploy/images// /tftpboot
$ cp tmp/deploy/images//-imx*.dtb /tftpboot
$ sudo rename 's/-//' /tftpboot/-*.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 /rootfs (change <uname> to the name of user)
$ setenv bootcmd run netboot
$ saveenv 

You are all set. Pushing reset on the board will run your Yocto result file system.