Changes

Jump to: navigation, search

Setting up tftp and nfs

5 bytes added, 13:31, 20 July 2012
no edit summary
===Introduction===
Especially during development, user you would like to be able to interact with have full control over the target system. This section describes how to configure your host system for this purpose.
==== How to configure a TFTP Server ====
One of the most useful features of a bootloader during development is the possibility capability to download the Linux kernel from the network. This saves a lot of time because developer doesnyou don't have to flash the image in flash NOR every time he/she modifies ityou want to try a different one. U-Boot implements the a TFTP protocol client (see the tftp command), so the host system must be configured to enable the TFTP service. Installation and configuration of a tftp server depends on the host Linux distributionrunning on the host machine: * For '''Fedora/Red Hat''':** if not included in the distribution, download the tftp package with the preferred method. For example, run yum install tftp-server** edit the configuration file /etc/xinetd.d/tftp and change the option disable from yes to no** create the tftp root directory: mkdir /tftpboot** assign the permission: chmod -R 777 /tftpboot and chown -R nobody /tftpboot** run chkconfig tftp on** restart xinetd: /etc/init.d/xinetd restart
For Fedora/Red Hat:
if not included in the distribution, download the tftp package with the preferred method. For example, run yum install tftp-server
edit the configuration file /etc/xinetd.d/tftp and change the option disable from yes to no
create the tftp root directory: mkdir /tftpboot
assign the permission: chmod -R 777 /tftpboot and chown -R nobody /tftpboot
run chkconfig tftp on
restart xinetd: /etc/init.d/xinetd restart
To change the tftp root directory, user should edit the /etc/xinetd.d/tftp file and modify the server_args option.
* For '''Debian/Ubuntu 8.x''':** download the atftp package with the preferred method. For example, run sudo apt-get install atftp** edit the /etc/default/atftp and change the USE_INETD to false** create the tftp root directory: sudo mkdir /tftpboot** assign the permission: sudo chmod -R 777 /tftpboot and sudo chown -R nobody /tftpboot** start the server: sudo /etc/init.d/atftpd start 
To change the tftp root directory, user should edit the /etc/default/atftp file.
==== How to configure a NFS Server ====
One of the most important components of a Linux system is the root file system. A good development root file system provides the developer with all the useful tools that can help him/her on his/her work. Such a root file system can become very big in size, so it's hard to store it in flash memory. So the most convenient thing is to mount the whole root file system from the network, allowing the host system and the target to share the same files. In such a way, you can quickly modify the root file system, even “on the fly” (meaning that the file system can be modified while the system is running).
The most common way to setup a system like the one described is through NFS. As for tftp, installation and configuration depends on the Linux distribution on the host.
One of the most important components of a Linux system is the root file system. A good development root file system provides the developer with all the useful tools that can help him/her on his/her work. Such a root file system can become very big in size, so it* For '''s hard to store it in flash memory. User could split the file system in different parts, mounting them from different media (flash, network, usb...). But the most convenient thing is to mount the whole root file system from the network, allowing the host system and the target to share the same files. In such a way, the developer can quickly modify the root file system, even “on the fly” (meaning that the file system can be modified while the system is running).The most common way to setup a system like the one described is through NFS. As for tftp, installation and configuration depends on the host linux distribution. For Debian/Ubuntu 8.x''':** download the nfs packages with the preferred method. For example, run sudo apt-get install nfs-kernel-server nfs-common portmap** when configuring portmap, do not bind loopback. If loopback is bound, reconfigure portmap (sudo dpkg-reconfigure portmap), then restart it: sudo /etc/init.d/portmap restart** NFS exports from a server are controlled by the file /etc/exports. So, to export the directory /home/user, edit the /etc/exports file adding the following line:. This line exports the "/home/user" directory with read and write permissions to all hosts.<pre>
/home/user *(rw,sync,no_root_squash)
This line exports the "</home/user" directory with read and write permissions to all hosts.pre>** Save the file and restart the server: sudo /etc/init.d/nfs-kernel-server restart
For other distributions, the procedure will be very similar: the NFS configuration is always modified editing the /etc/exports file. The packages names, the method to install them and how to restart the servers may vary.

Navigation menu