📄 setting_up_a_tftp_server.html
字号:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html><head> <title></title> <link rel="stylesheet" media="screen" type="text/css" href="./style.css" /> <link rel="stylesheet" media="screen" type="text/css" href="./design.css" /> <link rel="stylesheet" media="print" type="text/css" href="./print.css" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /></head><body><a href=start.html>start</a></br><div class="toc"><div class="tocheader toctoggle" id="toc__header">Table of Contents</div><div id="toc__inside"><ul class="toc"><li class="clear"><ul class="toc"><li class="level2"><div class="li"><span class="li"><a href="#setting_up_a_tftp_server" class="toc">Setting up a TFTP Server</a></span></div><ul class="toc"><li class="level3"><div class="li"><span class="li"><a href="#debian_linux_instructions" class="toc">Debian Linux Instructions</a></span></div></li><li class="level3"><div class="li"><span class="li"><a href="#suse_linux_instructions" class="toc">SuSE Linux Instructions</a></span></div></li><li class="level3"><div class="li"><span class="li"><a href="#windows_instructions" class="toc">Windows Instructions</a></span></div></li><li class="level3"><div class="li"><span class="li"><a href="#using_u-boot_with_tftp" class="toc">Using U-Boot With TFTP</a></span></div></li></ul></li></ul></li></ul></div></div><h2><a name="setting_up_a_tftp_server" id="setting_up_a_tftp_server">Setting up a TFTP Server</a></h2><div class="level2"><p>Once U鈥態oot has been loaded onto the target system it may retrieve a memory image via a TFTP server. This section will describe how to setup a TFTP server under SuSE Linux as well as Windows and how to use this server to load uClinux via U鈥態oot.</p><p></p></div><!-- SECTION [1-518] --><h3><a name="debian_linux_instructions" id="debian_linux_instructions">Debian Linux Instructions</a></h3><div class="level3"><p><a href="http://www.davidsudjiman.info/?p=93" class="urlextern" title="http://www.davidsudjiman.info/?p=93" rel="nofollow">Here</a> are some instructions we have used for Debian (Ubuntu) systems.</p></div><!-- SECTION [519-662] --><h3><a name="suse_linux_instructions" id="suse_linux_instructions">SuSE Linux Instructions</a></h3><div class="level3"><p>The procedure for setting up a TFTP server under SuSE Linux is given below. For other distributions of Linux this procedure may differ slightly. You may have to install TFTP if it is not already installed on your system.</p></div><h4><a name="setting_up_from_command_line" id="setting_up_from_command_line">Setting up from command line</a></h4><div class="level4"><p> First, as root, make a directory to store the uClinux image which will be loaded onto the target system.</p><pre class="code">bash# mkdir /tftpboot</pre><p>Next the ownership of this directory must be changed to <code>nobody</code> as this is the default user ID setup by tftpd. It is also a good idea to give world write permission to this directory, to allow normal users (not <code>root</code>) to copy files for downloading.</p><pre class="code">bash# chown nobody:nobody /tftpbootbash# chmod 777 /tftpboot</pre><p>Next move the image of a compiled version of uClinux into the tftpboot directory. This file is usually named <em>linux</em>. For more information on compiling uClinux see <a href="compiling_the_kernel.html" class="wikilink1" title="compiling_the_kernel.html">Compiling the Kernel</a>.</p><p>Now the file <code>/etc/xinetd.d/tftp</code> must be edited to match the following: </p><pre class="code">service tftp{ socket_type = dgram protocol = udp wait = yes user = root server = /usr/sbin/in.tftpd server_args = -s /tftpboot disable = no }</pre><p>Under SuSE Linux 9.0 the following options needed to be changed from their default values:</p><p><strong>disable = no</strong> (enables the TFTP service)<br/> <strong>server_args = -s /tftpboot </strong> (sets the directory to <code>/tftpboot</code></p><p>Next, to start the TFTP server enter the following command as <code>root</code>: </p><pre class="code">bash# /etc/init.d/xinetd restart</pre></div><h4><a name="using_the_suse_gui" id="using_the_suse_gui">Using the Suse GUI</a></h4><div class="level4"><p> Alternately the TFTP server may be enabled through the XWindows interface. These instructions are for SuSE Linux 9.0. For other distributions of Linux this procedure may vary.</p><p>Open the <strong>Control Center</strong><em> </em>which is located under the start menu. The <strong>Control Center</strong> window should now be displayed:</p><p><a href="media/dhcp1.png" class="media" target="_blank" title="dhcp1.png"><img src="media/dhcp1.png" class="media" alt="" /></a></p><p>Click on <strong>YaST2 modules</strong>.</p><p>The YaST2 modules sub-menu should now be displayed in the sidebar:</p><p><a href="media/dhcp2.png" class="media" target="_blank" title="dhcp2.png"><img src="media/dhcp2.png" class="media" alt="" /></a></p><p>Click on <strong>Network Services</strong>.</p><p>The Network Services sub-menu should now be displayed in the sidebar:</p><p><a href="media/tftp1.png" class="media" target="_blank" title="tftp1.png"><img src="media/tftp1.png" class="media" alt="" /></a></p><p>Click on <strong>TFTP Server</strong> then click the <strong>Administrator Mode</strong> button (you will need the root password).</p><p>After entering the root password the TFTP server configuration module should now be displayed:</p><p><a href="media/tftp2.png" class="media" target="_blank" title="tftp2.png"><img src="media/tftp2.png" class="media" alt="" /></a></p><p>Select the <strong>Enable</strong> radio button.</p><p>Enter <strong>/tftpboot</strong> in the <strong>Boot Image Directory</strong> textbox.</p><p>Click <strong>Finish</strong>.</p></div><!-- SECTION [663-3191] --><h3><a name="windows_instructions" id="windows_instructions">Windows Instructions</a></h3><div class="level3"><p>There are several TFTP server programs available for the Windows platform. The setup instructions in this section are for the program TFTP Turbo. TFTP Turbo is available free of charge from <a href="http://www.weird-solutions.com/" class="urlextern" title="http://www.weird-solutions.com/" rel="nofollow">http://www.weird-solutions.com/download/index.html</a>. The setup procedure for other TFTP server programs will differ.</p><p>First, download the installer program for TFTP Turbo and run it. Follow the instructions given to install TFTP Turbo, select a full installation. Once installation is complete start TFTP Turbo. The TFTP Turbo main window should now be displayed:</p><p><a href="media/tftp3.png" class="media" target="_blank" title="tftp3.png"><img src="media/tftp3.png" class="media" alt="" /></a></p><p>Double Click on <strong>localhost</strong> in the <strong>Servers</strong> sidebar</p><p>The login dialog should now be displayed:</p><p><a href="media/dhcp10.png" class="media" target="_blank" title="dhcp10.png"><img src="media/dhcp10.png" class="media" alt="" /></a></p><p>Leave the <strong>Password</strong> field <strong>blank</strong> and click on <strong>Login</strong></p><p>With <strong>localhost</strong> still selected, under the <strong>Edit</strong> menu select <strong>Properties</strong>. The Server Properties dialog should now be displayed:</p><p><a href="media/tftp4.png" class="media" target="_blank" title="tftp4.png"><img src="media/tftp4.png" class="media" alt="" /></a></p><p>In the <strong>Virtual Root</strong> field enter the path to the directory you wish to use as the TFTP root directory.</p><p>In this example <code>C:\tftpboot</code> is used. Ensure that a valid uClinux kernel image exists in this directory.</p><p>Next, with <strong>localhost</strong> still selected, under the <strong>Tools</strong> menu select <strong>Control Service</strong>. The Control Service dialog should now be displayed:</p><p><a href="media/tftp5.png" class="media" target="_blank" title="tftp5.png"><img src="media/tftp5.png" class="media" alt="" /></a></p><p>If the message says “<em><strong>TFTP Turbo is running on localhost</strong></em>” simply click <strong>OK</strong>.</p><p>If the message says “<em><strong>TFTP Turbo is not running on localhost</strong></em>” click <strong>Start</strong> then click <strong>OK</strong>.</p><p>The TFTP Turbo server should now be running.</p></div><!-- SECTION [3192-4784] --><h3><a name="using_u-boot_with_tftp" id="using_u-boot_with_tftp">Using U-Boot With TFTP</a></h3><div class="level3"><p>To boot uClinux via TFTP open a terminal session in Minicom, HyperTerminal, or another terminal program. See <a href="terminal_programs.html" class="wikilink1" title="terminal_programs.html">Terminal Programs</a> on page for more information on setting up a terminal program to communicate with uClinux/U-Boot. Reset the target system and hit any key before the autoboot countdown finishes. You should now be at the U-Boot command prompt. Enter the command:</p><pre class="code">BOOT> print</pre><p>U-Boot’s environment variables should now be displayed and will look something like the following:</p><pre class="code">bootcmd=run tftp_bootbootdelay=30baudrate=57600loads_echo=1ipaddr=192.168.0.95serverip=192.168.0.32gatewayip=192.168.0.2netmask=255.255.255.0hostname=BF533netdev=eth0tftp_boot=tftp 0x1000000 linux;bootelf 0x1000000;echodhcp_boot=dhcp;bootelf 0x0x1000000;echoserial_boot=loadb;bootelf 0x1000000;echostdin=serialstdout=serialstderr=serial</pre><p>Ensure the following environment variables are set: </p><pre class="code">ipaddr=<valid IP address for the system>serverip=<IP address of machine running the TFTP server>gatewayip=<IP address of gateway>tftp_boot =tftp 0x1000000 linux;bootelf 0x1000000;echobootcmd=run tftp_boot</pre><p> A gateway IP may not be required if the server is on the same local network as the target platform, and this also assumes <code>linux</code> is the name of the uClinux memory image file in the TFTP boot directory.</p><p>If these environment variables are not set use the U-Boot <code>set</code> command: </p><pre class="code">STAMP> set <variable> <value></pre><p>The U-Boot command <code>save</code> can then be used to save the environment variables to flash memory.</p><pre class="code">STAMP> save</pre><p> <strong>set tftp_boot ‘tftp ftp 0×1000000 linux;bootelf 0×1000000;echo’</strong> </p><p>On restart, after the autoboot countdown timer finishes, U-Boot should now load the specified image via TFTP. Alternately a TFTP boot can be initiated from the U-Boot command line by entering the following commands at the U-Boot prompt (this assumes <code>linux</code> is the name of the uClinux memory image file):</p><pre class="code">BOOT> tftp 0x1000000 linuxBOOT> bootelf 0x1000000</pre></div><!-- SECTION [4785-] --></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -