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

From DAVE Developer's Wiki
Jump to: navigation, search
(Created page with "{{subst:Booting from nfs | nome-som=ORCA | kit-code=MX8M | kit = mx8m | kit-repo = desk-mx-l}}")
 
Line 7: Line 7:
 
!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"|X.Y.Z
+
|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:#edf8fb; padding:5px; color:#000000"|Month Year
+
|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:#edf8fb; padding:5px; color:#000000"|TBD
+
|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:#edf8fb; padding:5px; color:#000000"|[TBD_link X.Y.Z]
 
|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"|Month Year
 
|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"|TBD
 
|-
 
|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"|...
 
|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"|...
 
|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"|...
 
 
|-
 
|-
 
|}
 
|}
Line 111: Line 102:
 
* <code>ipaddr</code> is the IP address of the target
 
* <code>ipaddr</code> is the IP address of the target
  
The ''kernel'' and ''device tree'' files has to be selected
+
The ''kernel'' and ''device tree'' files have to be selected
  
 
<pre>
 
<pre>
=> setenv bootfile /tftpboot/{{{kit-repo}}}/''<uImage>''
+
=> setenv bootfile /tftpboot/desk-mx-l/Image
=> setenv fdtfile /tftpboot/{{{kit-repo}}}/''>carrier.dtb>''
+
=> setenv fdtfile /tftpboot/desk-mx-l/imx8mp-mito8mplus-cb1001.dtb
 
</pre>
 
</pre>
  
finally, the ''root file system'' directory on the Virtual Machine should be configured for let the kernel to find the '''INIT'''
+
finally, the ''root file system'' directory on the Virtual Machine should be configured to let the kernel find the '''INIT'''
  
<pre>=> setenv rootpath /home/dvdk/{{{kit-repo}}}/rfs/</pre>
+
<pre>=> setenv rootpath /home/dvdk/desk-mx-l/rfs/</pre>
  
To run this configuration just issue the '''net_nfs''' command which firstly download the kernel and device tree using the tftp protocol
+
To run this configuration just issue the '''net_nfs''' command which firstly downloads the kernel and device tree using the tftp protocol
  
 
''<TBD: sostituire il dump con il boot da nfs del kit>''
 
''<TBD: sostituire il dump con il boot da nfs del kit>''

Revision as of 11:16, 15 February 2022

History
Version Issue Date Notes
1.0.0 Feb 2022 First dESK-MX8M-L 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.

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:~$ 

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 fdtfile /tftpboot/desk-mx-l/imx8mp-mito8mplus-cb1001.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/

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

<TBD: sostituire il dump con il boot da nfs del kit>

=> run net_nfs