Книга: Embedded Linux Primer: A Practical, Real-World Approach

12.3.1. TFTP Server

12.3.1. TFTP Server

Configuring TFTP on your Linux development host is not difficult. Of course, the details might vary, depending on which Linux distribution you choose for your development workstation. The guidelines presented here are based on Red Hat and Fedora Core Linux distributions.

TFTP is a TCP/IP service that must be enabled on your workstation. To enable TFTP service, you must instruct your server to respond to incoming TFTP packets and spawn your TFTP server. On many Linux distributions, this is done by editing a configuration file used by the xinetd Internet superserver. For example, on the Red Hat and Fedora desktop Linux distributions, this file is /etc/xinetd.d/tftp. Listing 12-4 contains a TFTP configuration from a Fedora Core 2 development workstation to enable the TFTP service. It has been slightly rearranged to fit the page.

Listing 12-4. TFTP Configuration

# default: off
# description: The tftp server serves files using the trivial
# file transfer protocol. The tftp protocol is often used to
# boot diskless workstations, download configuration files to
# network-aware printers, and to start the installation process
# for some operating systems.
service tftp
{
 socket_type = dgram
 protocol = udp
 wait = yes
 user = root
 server = /usr/sbin/in.tftpd
 server_args = -c -s /tftpboot
 disable = no
 per_source = 11
 cps = 100 2
 flags = IPv4
}

In this typical setup, the TFTP service has been enabled (disable = no) and configured to serve files located in this workstation's /tftpboot directory. When the xinetd Internet superserver receives an incoming TFTP request, it consults this configuration and spawns the server specified (/usr/sbin/in.tftpd). The command line arguments specified by server_args are passed to the in.tftpd process. In this case, the -s switch tells in.tftpd to switch to the specified directory (/tftpboot), and the -c flag allows the creation of new files. This is useful to write files to the server from the target.

Consult the documentation that came with your desktop distribution for details specific to your environment.

Оглавление книги


Генерация: 0.032. Запросов К БД/Cache: 0 / 0
поделиться
Вверх Вниз