Difference between revisions of "Setting up tftp and nfs"

From DAVE Developer's Wiki
Jump to: navigation, search
(Created page with "{{InfoBoxTop}} {{Applies To Linux}} {{Applies To U-Boot}} {{AppliesToAndroid}} {{InfoBoxBottom}} ===Introduction===")
 
Line 4: Line 4:
 
{{AppliesToAndroid}}
 
{{AppliesToAndroid}}
 
{{InfoBoxBottom}}
 
{{InfoBoxBottom}}
 +
 +
 +
[[Category:HowTo]]
  
 
===Introduction===
 
===Introduction===
 +
 +
Especially during development, user would like to be able to interact with 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 to download the Linux kernel from the network. This saves a lot of time because developer doesn't have to flash the image in NOR every time he/she modifies it. U-Boot implements the TFTP protocol (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 distribution:
 +
 +
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. 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:
 +
/home/user *(rw,sync,no_root_squash)
 +
This line exports the "/home/user" directory with read and write permissions to all hosts.
 +
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.

Revision as of 13:24, 20 July 2012

Info Box
Tux.png Applies to Linux
Tux.png Applies to U-Boot
Android-logo.jpg Applies to Android

Introduction[edit | edit source]

Especially during development, user would like to be able to interact with the target system. This section describes how to configure your host system for this purpose.

How to configure a TFTP Server[edit | edit source]

One of the most useful features of a bootloader during development is the possibility to download the Linux kernel from the network. This saves a lot of time because developer doesn't have to flash the image in NOR every time he/she modifies it. U-Boot implements the TFTP protocol (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 distribution:

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[edit | edit source]

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. 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: /home/user *(rw,sync,no_root_squash) This line exports the "/home/user" directory with read and write permissions to all hosts. 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.