Difference between revisions of "DESK-MX8M-L/General/Booting from NFS"

From DAVE Developer's Wiki
Jump to: navigation, search
Line 3: Line 3:
 
!colspan="4" style="width:100%; text-align:left"; border-bottom:solid 2px #ededed"|History
 
!colspan="4" style="width:100%; text-align:left"; border-bottom:solid 2px #ededed"|History
 
|-  
 
|-  
!style="border-left:solid 2px #73B2C7; border-right:solid 2px #73B2C7;border-top:solid 2px #73B2C7; border-bottom:solid 2px #73B2C7; background-color:#73B2C7; padding:5px; color:white"|Version
+
!style="border-left:solid 2px #73B2C7; border-right:solid 2px #73B2C7;border-top:solid 2px #73B2C7; border-bottom:solid 2px #73B2C7; background-color:#73B2C7; padding:5px; color:white"|ID#
 
!style="border-left:solid 2px #73B2C7; border-right:solid 2px #73B2C7;border-top:solid 2px #73B2C7; border-bottom:solid 2px #73B2C7; background-color:#73B2C7; padding:5px; color:white"|Issue Date
 
!style="border-left:solid 2px #73B2C7; border-right:solid 2px #73B2C7;border-top:solid 2px #73B2C7; border-bottom:solid 2px #73B2C7; background-color:#73B2C7; padding:5px; color:white"|Issue Date
 
!style="border-left:solid 2px #73B2C7; border-right:solid 2px #73B2C7;border-top:solid 2px #73B2C7; border-bottom:solid 2px #73B2C7; background-color:#73B2C7; padding:5px; color:white"|Notes
 
!style="border-left:solid 2px #73B2C7; border-right:solid 2px #73B2C7;border-top:solid 2px #73B2C7; border-bottom:solid 2px #73B2C7; background-color:#73B2C7; padding:5px; color:white"|Notes
 
|-
 
|-
|style="border-left:solid 2px #73B2C7; border-right:solid 2px #73B2C7;border-top:solid 2px #73B2C7; border-bottom:solid 2px #73B2C7; background-color:#edf8fb; padding:5px; color:#000000"|1.0.0
+
! style="border-left:solid 2px #73B2C7; border-right:solid 2px #73B2C7;border-top:solid 2px #73B2C7; border-bottom:solid 2px #73B2C7; background-color:#ededed; padding:5px; color:#000000" |{{oldid|17626|17626}}
|style="border-left:solid 2px #73B2C7; border-right:solid 2px #73B2C7;border-top:solid 2px #73B2C7; border-bottom:solid 2px #73B2C7; background-color:#edf8fb; padding:5px; color:#000000"|Feb 2022
+
! style="border-left:solid 2px #73B2C7; border-right:solid 2px #73B2C7;border-top:solid 2px #73B2C7; border-bottom:solid 2px #73B2C7; background-color:#ededed; padding:5px; color:#000000" |27/02/2023
|style="border-left:solid 2px #73B2C7; border-right:solid 2px #73B2C7;border-top:solid 2px #73B2C7; border-bottom:solid 2px #73B2C7; background-color:#edf8fb; padding:5px; color:#000000"|First DESK-MX8M-L release
+
! style="border-left:solid 2px #73B2C7; border-right:solid 2px #73B2C7;border-top:solid 2px #73B2C7; border-bottom:solid 2px #73B2C7; background-color:#ededed; padding:5px; color:#000000" |DESK-MX8M-L-2.0.0 release
 
|-
 
|-
 
|}
 
|}
Line 32: Line 32:
 
The [[DESK-MX8M-L]] Virtual Machine has the '''tftp''' and '''nfs''' services already running. Optionally, their configuration has to be changed according to the network configuration where the target is connected to.
 
The [[DESK-MX8M-L]] Virtual Machine has the '''tftp''' and '''nfs''' services already running. Optionally, their configuration has to be changed according to the network configuration where the target is connected to.
  
{{ImportantMessage|text=The ''Virtual Machine'' is created following the procedure at the [[DESK-MX8M-L/General/DVDK_Virtual_Machine#DVDK_for_release_2.0.0-rc2 | DVDK Virtual Machine]] wiki page}}
+
{{ImportantMessage|text=The ''Virtual Machine'' is created following the procedure at the [[DESK-MX8M-L/General/DVDK_Virtual_Machine#DVDK_for_release_2.0.0 | DVDK Virtual Machine]] wiki page}}
  
 
Check and properly configure the items the following chapters: network adapter, nfs server
 
Check and properly configure the items the following chapters: network adapter, nfs server
Line 97: Line 97:
 
* download the <code>fsl-imx-wayland-glibc-x86_64-meta-toolchain-aarch64-desk-mx8mp-toolchain-5.4-zeus.sh</code> from the mirror server
 
* download the <code>fsl-imx-wayland-glibc-x86_64-meta-toolchain-aarch64-desk-mx8mp-toolchain-5.4-zeus.sh</code> from the mirror server
 
<pre class="workstation-terminal">
 
<pre class="workstation-terminal">
dvdk@vagrant:~/desk-mx-l/rfs$ wget https://mirror.dave.eu/desk-mx-l/desk-mx8m-l-2.0.0-rc2/dave-image-devel-desk-mx8mp.tar.bz2
+
dvdk@vagrant:~/desk-mx-l/rfs$ wget https://mirror.dave.eu/desk-mx-l/desk-mx8m-l-2.0.0/dave-image-devel-desk-mx8mp.tar.bz2
 
dvdk@vagrant:~/desk-mx-l/rfs$  
 
dvdk@vagrant:~/desk-mx-l/rfs$  
 
</pre>
 
</pre>
 
extracting the archive (with '''root''' permissions!!) and create the symbolic link:
 
extracting the archive (with '''root''' permissions!!) and create the symbolic link:
 
<pre>
 
<pre>
mkdir /home/dvdk/desk-mx-l/rfs/desk-mx8m-l-2.0.0-rc2
+
mkdir /home/dvdk/desk-mx-l/rfs/desk-mx8m-l-2.0.0
sudo tar jxpf dave-image-devel-desk-mx8mp.tar.bz2 -C /home/dvdk/desk-mx-l/rfs/desk-mx8m-l-2.0.0-rc2/
+
sudo tar jxpf dave-image-devel-desk-mx8mp.tar.bz2 -C /home/dvdk/desk-mx-l/rfs/desk-mx8m-l-2.0.0/
ln -s /home/dvdk/desk-mx-l/rfs/desk-mx8m-l-2.0.0-rc2 /home/dvdk/desk-mx-l/rfs/desk-mx8m-l
+
ln -s /home/dvdk/desk-mx-l/rfs/desk-mx8m-l-2.0.0 /home/dvdk/desk-mx-l/rfs/desk-mx8m-l
 
</pre>
 
</pre>
  
Line 115: Line 115:
 
lrwxrwxrwx  1 root root        41 Apr  9  2021 desk-mx6-l -> /home/dvdk/desk-mx-l/rfs/desk-mx6-l-1.0.0
 
lrwxrwxrwx  1 root root        41 Apr  9  2021 desk-mx6-l -> /home/dvdk/desk-mx-l/rfs/desk-mx6-l-1.0.0
 
drwxr-xr-x 19  541  502      4096 Jan 25  2021 desk-mx6-l-1.0.0
 
drwxr-xr-x 19  541  502      4096 Jan 25  2021 desk-mx6-l-1.0.0
lrwxrwxrwx  1 dvdk dvdk        46 Feb 15 12:37 desk-mx8m-l -> /home/dvdk/desk-mx-l/rfs/desk-mx8m-l-2.0.0-rc2
+
lrwxrwxrwx  1 dvdk dvdk        46 Feb 15 12:37 desk-mx8m-l -> /home/dvdk/desk-mx-l/rfs/desk-mx8m-l-2.0.0
drwxrwxr-x  8 dvdk dvdk      4096 Feb 15 12:36 desk-mx8m-l-2.0.0-rc2
+
drwxrwxr-x  8 dvdk dvdk      4096 Feb 15 12:36 desk-mx8m-l-2.0.0
 
dvdk@vagrant:~/desk-mx-l/rfs$  
 
dvdk@vagrant:~/desk-mx-l/rfs$  
 
</pre>
 
</pre>
Line 136: Line 136:
 
<pre>
 
<pre>
 
=> setenv bootfile /tftpboot/desk-mx-l/Image
 
=> setenv bootfile /tftpboot/desk-mx-l/Image
=> setenv fdt_file /tftpboot/desk-mx-l/imx8mp-mito8mplus-cb1001.dtb
 
 
=> setenv loadk 'tftpboot ${loadaddr} ${serverip}:${bootfile}'
 
=> setenv loadk 'tftpboot ${loadaddr} ${serverip}:${bootfile}'
 
=> setenv loadfdt 'tftpboot ${fdt_addr} ${serverip}:${fdt_file}'
 
=> setenv loadfdt 'tftpboot ${fdt_addr} ${serverip}:${fdt_file}'
 
</pre>
 
</pre>
 +
 +
ORCA has its dtb file <code>imx8mp-mito8mplus-cb1001.dtb</code>
 +
setenv fdt_file /tftpboot/desk-mx-l/imx8mp-mito8mplus-cb1001.dtb
 +
 +
while MITO 8M Mini has its own ''dtb'' file <code>imx8mm-mito8mmini.dtb</code>
 +
setenv fdt_file /tftpboot/desk-mx-l/imx8mm-mito8mmini.dtb
 +
  
 
finally, the ''root file system'' directory on the Virtual Machine should be configured to let the kernel find the '''INIT'''
 
finally, the ''root file system'' directory on the Virtual Machine should be configured to let the kernel find the '''INIT'''
Line 145: Line 151:
 
<pre>=> setenv rootpath /home/dvdk/desk-mx-l/rfs/desk-mx8m-l</pre>
 
<pre>=> setenv rootpath /home/dvdk/desk-mx-l/rfs/desk-mx8m-l</pre>
  
To run this configuration just issue the '''net_nfs''' command which firstly downloads the kernel and device tree using the tftp protocol
+
To run this configuration just issue the '''netboot''' command which firstly downloads the kernel and device tree using the tftp protocol
  
 
<pre class="mw-collapsible mw-collapsed workstation-terminal">
 
<pre class="mw-collapsible mw-collapsed workstation-terminal">
 
=> run loadk loadfdt nfsargs addip addcons addmisc; booti ${loadaddr} - ${fdt_addr}
 
=> run loadk loadfdt nfsargs addip addcons addmisc; booti ${loadaddr} - ${fdt_addr}
 +
</pre>
  
</pre>
 
  
 
----
 
----
  
[[Category:ORCA]]
+
[[Category:ORCA]] [[Category:MITO 8M Mini]]

Revision as of 10:05, 27 February 2023

History
ID# Issue Date Notes

17626

27/02/2023 DESK-MX8M-L-2.0.0 release


Booting from NFS[edit | edit source]

This configuration is very helpful during the software development (both for kernel and applications). The kernel image is downloaded via TFTP while the root file system is remotely mounted via NFS from the host. It is assumed that the development host:

  • is connected with the target host board through an Ethernet LAN
  • exports the directory containing the root file system for the target through the NFS server
  • runs a TFTP server.
  • has a proper subnet IP address

net_nfs configuration[edit | edit source]

DESK-MX8M-L Virtual Machine is properly configured for the TFTP and NFS debug.

In any case, some variables has to be configured on the target and the VM itself has to be configured for respect to the network environment.

Host (Virtual Machine) configuration[edit | edit source]

The DESK-MX8M-L Virtual Machine has the tftp and nfs services already running. Optionally, their configuration has to be changed according to the network configuration where the target is connected to.


200px-Emblem-important.svg.png

The Virtual Machine is created following the procedure at the DVDK Virtual Machine wiki page

Check and properly configure the items the following chapters: network adapter, nfs server

network adapter[edit | edit source]

The network adpater should be configured in bridge mode in order to allow the target to get the files from the VM


Network-bridge.png


XELK VM Network.png


then check or re-configure the Host IP address

dvdk@vagrant:~$ ifconfig 
eth0      Link encap:Ethernet  HWaddr 08:00:27:ed:54:80  
          inet addr:192.168.0.121  Bcast:192.168.0.255  Mask:255.255.255.0
          inet6 addr: fe80::a00:27ff:feed:5480/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:342143 errors:0 dropped:0 overruns:0 frame:0
          TX packets:267700 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:160784829 (160.7 MB)  TX bytes:214001179 (214.0 MB)

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:201 errors:0 dropped:0 overruns:0 frame:0
          TX packets:201 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1 
          RX bytes:21929 (21.9 KB)  TX bytes:21929 (21.9 KB)

dvdk@vagrant:~$ 

nfs server[edit | edit source]

The NFS server should exports the correct file system directory (in our example)

dvdk@vagrant:~$ cat /etc/exports 
/home 0.0.0.0/0.0.0.0(rw,async,no_root_squash,no_subtree_check,crossmnt)
dvdk@vagrant:~$ 

otherwise, change its configuration and then restart the nfs server:

dvdk@vagrant:~$ sudo /etc/init.d/nfs-kernel-server restart
[sudo] password for dvdk: 
 * Stopping NFS kernel daemon                                                                                                                                                                                                         [ OK ] 
 * Unexporting directories for NFS kernel daemon...                                                                                                                                                                                   [ OK ] 
 * Exporting directories for NFS kernel daemon...                                                                                                                                                                                     [ OK ] 
 * Starting NFS kernel daemon                                                                                                                                                                                                         [ OK ] 
dvdk@vagrant:~$ 

Installing the root file system[edit | edit source]

Using the DESK-MX6-L Virtual Machine it is required to extracting the rfs in the exported file system:

  • download the fsl-imx-wayland-glibc-x86_64-meta-toolchain-aarch64-desk-mx8mp-toolchain-5.4-zeus.sh from the mirror server
dvdk@vagrant:~/desk-mx-l/rfs$ wget https://mirror.dave.eu/desk-mx-l/desk-mx8m-l-2.0.0/dave-image-devel-desk-mx8mp.tar.bz2
dvdk@vagrant:~/desk-mx-l/rfs$ 

extracting the archive (with root permissions!!) and create the symbolic link:

mkdir /home/dvdk/desk-mx-l/rfs/desk-mx8m-l-2.0.0
sudo tar jxpf dave-image-devel-desk-mx8mp.tar.bz2 -C /home/dvdk/desk-mx-l/rfs/desk-mx8m-l-2.0.0/
ln -s /home/dvdk/desk-mx-l/rfs/desk-mx8m-l-2.0.0 /home/dvdk/desk-mx-l/rfs/desk-mx8m-l

Then, the rfs directory appears like this:

dvdk@vagrant:~/desk-mx-l/rfs$ ls -la
total 725876
drwxr-xr-x  4 dvdk dvdk      4096 Feb 15 12:37 .
drwxr-xr-x  7 dvdk dvdk      4096 Feb 15 11:50 ..
lrwxrwxrwx  1 root root        41 Apr  9  2021 desk-mx6-l -> /home/dvdk/desk-mx-l/rfs/desk-mx6-l-1.0.0
drwxr-xr-x 19  541  502      4096 Jan 25  2021 desk-mx6-l-1.0.0
lrwxrwxrwx  1 dvdk dvdk        46 Feb 15 12:37 desk-mx8m-l -> /home/dvdk/desk-mx-l/rfs/desk-mx8m-l-2.0.0
drwxrwxr-x  8 dvdk dvdk      4096 Feb 15 12:36 desk-mx8m-l-2.0.0
dvdk@vagrant:~/desk-mx-l/rfs$ 

Target configuration[edit | edit source]

The IP address for server and target should be configured: an example (for a network subnet 192.168.0.x)

=> setenv serverip 192.168.0.120
=> setenv ipaddr 192.168.0.121
  • serverip is the IP address of the host machine running the tftp/nfs server
  • ipaddr is the IP address of the target

The kernel and device tree files have to be selected

=> setenv bootfile /tftpboot/desk-mx-l/Image
=> setenv loadk 'tftpboot ${loadaddr} ${serverip}:${bootfile}'
=> setenv loadfdt 'tftpboot ${fdt_addr} ${serverip}:${fdt_file}'

ORCA has its dtb file imx8mp-mito8mplus-cb1001.dtb

setenv fdt_file /tftpboot/desk-mx-l/imx8mp-mito8mplus-cb1001.dtb

while MITO 8M Mini has its own dtb file imx8mm-mito8mmini.dtb

setenv fdt_file /tftpboot/desk-mx-l/imx8mm-mito8mmini.dtb


finally, the root file system directory on the Virtual Machine should be configured to let the kernel find the INIT

=> setenv rootpath /home/dvdk/desk-mx-l/rfs/desk-mx8m-l

To run this configuration just issue the netboot command which firstly downloads the kernel and device tree using the tftp protocol

=> run loadk loadfdt nfsargs addip addcons addmisc; booti ${loadaddr} - ${fdt_addr}