Search This Blog

Monday, February 20, 2012

NFS example

1. enable NFS on your local server/board
2. enable tftp on your local server/board
Maintained a copy of below links:
http://www.imxdev.org/wiki/index.php?title=All_Boards_NFS_on_Ubuntu
http://www.imxdev.org/wiki/index.php?title=All_Boards_NFS
http://www.imxdev.org/wiki/index.php?title=All_Boards_TFTP_on_Ubuntu
http://www.imxdev.org/wiki/index.php?title=All_Boards_TFTP

All Boards NFS on Ubuntu

Network File System (NFS)

Setting the host

1 - Install NFS Service on host typing:
$sudo apt-get install nfs-kernel-server
2 - Create symbolic link to ltib/rootfs
$sudo ln -s <ltib instalation folder>/rootfs /tftpboot/rootfs
3 - Setup exports typing:
$sudo gedit /etc/exports
and add the following line:
/tftpboot/rootfs/ *(rw,no_root_squash,no_subtree_check,async)
4 - Reestart the NFS server:
$sudo /etc/init.d/nfs-kernel-server restart
Now the host is ready to use NFS

Setting Target Linux Image to use NFS

1 - Run LTIB configuration typing:
$cd <ltib instalation folder>
$./ltib -c

2 - On first page menu, go to "Target Image Generation -> Options" as in the picture below.
Ltib nfs1.jpg

3 - Select the option NFS only and exit LTIB configuration to compile with the new configuration.
Ltib nfs2.jpg

4 - LTIB should start new compiling and create a new Linux image on /<ltib instalation folder>/rootfs/boot/zImage

5 - Copy the created image on /<ltib instalation folder>/rootfs/boot/zImage to /tftpboot/zImage

6 - The system is ready to run with NFS. The root file system on target will be located on host on /<ltib instalation folder>/rootfs/

==

Configure TFTP

For Debian and Based Systems Users:

To install tftpboot service first install tftp server:
$sudo apt-get install tftpd
Choose an Internet super server to install
Install xinetd OR inetd. Notice openbsd-inetd is alread installed on Ubuntu.

INET

  • Open a terminal as root
  • If inetd is not installed, install it typing:
$sudo apt-get install openbsd-inetd
  • create tftpboot folder and set permissions:
$sudo mkdir /tftpboot
$sudo chmod a+x /tftpboot
  • Edit tftp file
$sudo gedit /etc/inetd.conf
  • Add this line:
tftp dgram udp wait nobody /usr/sbin/tcpd /usr/sbin/in.tftpd /tftpboot
  • After restart the inetd server:
$ sudo /etc/init.d/openbsd-inetd  restart

XINET

  • Open a terminal as root
  • If xinetd is not installed, install it typing:
$sudo apt-get install xinetd
  • create tftpboot folder and set permissions:
$sudo mkdir /tftpboot
$sudo chmod a+x /tftpboot
  • Edit file tftp:
$sudo gedit /etc/xinetd.d/tftp
  • Add these lines
 service tftp
{
  socket_type = dgram
  protocol = udp
  wait = yes
  user = root
  server = /usr/sbin/in.tftpd
  server_args = /tftpboot
  disable = no
  per_source = 100 2
  flags = IPv4
}
  • After restart the inetd server:
$ sudo /etc/init.d/xinetd restart

1 comment: