Template:Booting from nfs
History | |||
---|---|---|---|
Version | Issue Date | Notes | |
X.Y.Z | Month Year | TBD | |
[TBD_link X.Y.Z] | Month Year | TBD | |
... | ... | ... |
Contents
Booting from NFS[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 source]
[[DESK-{{{kit-code}}}-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 source]
The [[DESK-{{{kit-code}}}-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 source]
The network adpater should be configured in bridge mode in order to allow the target to get the files from the VM
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 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 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 serveripaddr
is the IP address of the target
The kernel and device tree files has to be selected
=> setenv bootfile /tftpboot/{{{kit-repo}}}/''<uImage>'' => setenv fdtfile /tftpboot/{{{kit-repo}}}/''>carrier.dtb>''
finally, the root file system directory on the Virtual Machine should be configured for let the kernel to find the INIT
=> setenv rootpath /home/dvdk/{{{kit-repo}}}/rfs/
To run this configuration just issue the net_nfs command which firstly download the kernel and device tree using the tftp protocol
<TBD: sostituire il dump con il boot da nfs del kit>
=> run net_nfs
[[Category:{{{nome-som}}}]]