📄 configuring-the-redboot-environment.html
字号:
<!-- Copyright (C) 2003 Red Hat, Inc. --><!-- This material may be distributed only subject to the terms --><!-- and conditions set forth in the Open Publication License, v1.0 --><!-- or later (the latest version is presently available at --><!-- http://www.opencontent.org/openpub/). --><!-- Distribution of the work or derivative of the work in any --><!-- standard (paper) book form is prohibited unless prior --><!-- permission is obtained from the copyright holder. --><HTML><HEAD><TITLE>Configuring the RedBoot Environment</TITLE><meta name="MSSmartTagsPreventParsing" content="TRUE"><METANAME="GENERATOR"CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+"><LINKREL="HOME"TITLE="eCos Reference Manual"HREF="ecos-ref.html"><LINKREL="UP"TITLE="Getting Started with RedBoot"HREF="getting-started-with-redboot.html"><LINKREL="PREVIOUS"TITLE="RedBoot Resource Usage"HREF="resource-usage.html"><LINKREL="NEXT"TITLE="RedBoot Commands and Examples"HREF="redboot-commands-and-examples.html"></HEAD><BODYCLASS="SECT1"BGCOLOR="#FFFFFF"TEXT="#000000"LINK="#0000FF"VLINK="#840084"ALINK="#0000FF"><DIVCLASS="NAVHEADER"><TABLESUMMARY="Header navigation table"WIDTH="100%"BORDER="0"CELLPADDING="0"CELLSPACING="0"><TR><THCOLSPAN="3"ALIGN="center">eCos Reference Manual</TH></TR><TR><TDWIDTH="10%"ALIGN="left"VALIGN="bottom"><AHREF="resource-usage.html"ACCESSKEY="P">Prev</A></TD><TDWIDTH="80%"ALIGN="center"VALIGN="bottom">Chapter 1. Getting Started with RedBoot</TD><TDWIDTH="10%"ALIGN="right"VALIGN="bottom"><AHREF="redboot-commands-and-examples.html"ACCESSKEY="N">Next</A></TD></TR></TABLE><HRALIGN="LEFT"WIDTH="100%"></DIV><DIVCLASS="SECT1"><H1CLASS="SECT1"><ANAME="CONFIGURING-THE-REDBOOT-ENVIRONMENT">Configuring the RedBoot Environment</H1><P>Once installed, RedBoot will operate fairly generically. However,there are some features that can be configured for a particular installation.These depend primarily on whether flash and/or networking support are available. The remainderof this discussion assumes that support for both of these options is includedin RedBoot.</P><DIVCLASS="SECT2"><H2CLASS="SECT2"><ANAME="TARGET-NETWORK-CONFIGURATION">Target Network Configuration</H2><P>Each node in a networkedsystem needs to have a unique address. Since the network support in RedBootis based on TCP/IP, this addressis an IP (Internet Protocol) address. There are two ways for a system to “know”its IP address. First, it can be stored locally on the platform. This is knownas having a static IP address. Second, the system can use the network itselfto discover its IP address. This is known as a dynamic IP address. RedBootsupports this dynamic IP address mode by use of the BOOTP (a subset of DHCP) protocol. In this case, RedBoot will ask the network (actuallysome generic server on the network) for the IP address to use.</P><DIVCLASS="NOTE"><BLOCKQUOTECLASS="NOTE"><P><B>NOTE: </B>Currently, RedBoot only supports BOOTP. In future releases, DHCP mayalso be supported, but such support will be limited to additional data items,not lease-based address allocation.</P></BLOCKQUOTE></DIV><P>The choice of IPaddress type is made via the <BCLASS="COMMAND">fconfig</B> command. Once a selectionis made, it will be stored in flash memory. RedBoot only queries the flashconfiguration information at reset, so any changes will require restartingthe platform.</P><P>Here is an example of the RedBoot <BCLASS="COMMAND">fconfig</B>command, showing network addressing: </P><TABLEBORDER="5"BGCOLOR="#E0E0F0"WIDTH="70%"><TR><TD><PRECLASS="PROGRAMLISTING">RedBoot> <TTCLASS="USERINPUT"><B>fconfig -l</B></TT>Run script at boot: falseUse BOOTP for network configuration: falseLocal IP address: 192.168.1.29Default server IP address: 192.168.1.101DNS server IP address: 192.168.1.1GDB connection port: 9000Network debug at boot time: false </PRE></TD></TR></TABLE><P>In this case, the board has been configured with a static IP addresslisted as the Local IP address. The default server IP address specifies whichnetwork node to communicate with for TFTP service. This address can be overriddendirectly in the TFTPcommands.</P><P>The <TTCLASS="COMPUTEROUTPUT">DNS server IP address</TT> optioncontrols where RedBoot should make DNS lookups. A setting of 0.0.0.0 will disable DNSlookups. The DNS server IP address can also be set at runtime.</P><P>If the selection for <TTCLASS="COMPUTEROUTPUT">Use BOOTP for network configuration</TT> had been <TTCLASS="COMPUTEROUTPUT">true</TT>, these IPaddresses would be determined at boot time, via the BOOTP protocol. The finalnumber which needs to be configured, regardless of IP address selection mode,is the <TTCLASS="COMPUTEROUTPUT">GDB connection port</TT>. RedBoot allows for incoming commandson either the available serial ports or via the network. This port numberis the TCP port that RedBoot will use to accept incoming connections. </P><P>These connections can be used for GDB sessions, but they can also beused for generic RedBoot commands. In particular, it is possible to communicatewith RedBoot via the telnetprotocol. For example, on Linux®: </P><TABLEBORDER="5"BGCOLOR="#E0E0F0"WIDTH="70%"><TR><TD><PRECLASS="PROGRAMLISTING">% telnet redboot_board 9000Connected to redboot_boardEscape character is ‘^]’.RedBoot> </PRE></TD></TR></TABLE></DIV><DIVCLASS="SECT2"><H2CLASS="SECT2"><ANAME="AEN2722">Host Network Configuration</H2><P>RedBootmay require three different classes of service from a network host: </P><P></P><UL><LI><P>dynamic IP address allocation, using BOOTP </P></LI><LI><P>TFTP service for file downloading </P></LI><LI><P>DNS server for hostname lookups </P></LI></UL><P>Depending on the host system, these services may or may not be availableor enabled by default. See your system documentation for more details.</P><P>In particular, on Red Hat Linux, neither of these services will be configuredout of the box. The following will provide a limited explanation of how toset them up. These configuration setups must be done as <TTCLASS="COMPUTEROUTPUT">root</TT> on the host or server machine.</P><DIVCLASS="SECT3"><H3CLASS="SECT3"><ANAME="AEN2743">Enable TFTP on Red Hat Linux 6.2</H3><DIVCLASS="PROCEDURE"><OLTYPE="1"><LI><P>Ensure thatyou have the tftp-server RPM package installed. By default, this installsthe TFTP server in a disabled state. These steps will enable it:</P></LI><LI><P>Make sure that the following line is uncommented in the controlfile <TTCLASS="FILENAME">/etc/inetd.conf</TT> <TABLEBORDER="5"BGCOLOR="#E0E0F0"WIDTH="70%"><TR><TD><PRECLASS="SCREEN">tftp dgram udp wait root /usr/sbin/tcpd /usr/sbin/in.tftpd</PRE></TD></TR></TABLE></P><P></P></LI><LI><P>If it was necessary to change the line in Step 2, then the inetdserver must be restarted, which can be done via the command: <TABLEBORDER="5"BGCOLOR="#E0E0F0"WIDTH="70%"><TR><TD><PRECLASS="PROGRAMLISTING"># service inet reload</PRE></TD></TR></TABLE></P></LI></OL></DIV></DIV><DIVCLASS="SECT3"><H3CLASS="SECT3"><ANAME="AEN2762">Enable TFTP on Red Hat Linux 7 (or newer)</H3><DIVCLASS="PROCEDURE"><OLTYPE="1"><LI><P>Ensure that thexinetd RPM is installed.</P></LI><LI><P>Ensure that the tftp-server RPM is installed.</P></LI><LI><P>Enable TFTP by means of the following: <TABLEBORDER="5"BGCOLOR="#E0E0F0"WIDTH="70%"><TR><TD><PRECLASS="PROGRAMLISTING">/sbin/chkconfig tftp on</PRE></TD></TR></TABLE>Reload the xinetd configuration using the command:<TABLEBORDER="5"BGCOLOR="#E0E0F0"WIDTH="70%"><TR><TD><PRECLASS="PROGRAMLISTING"> /sbin/service xinetd reload </PRE></TD></TR></TABLE>Create the directory /tftpbootusing the command <TABLEBORDER="5"BGCOLOR="#E0E0F0"WIDTH="70%"><TR><TD><PRECLASS="PROGRAMLISTING">mkdir /tftpboot</PRE></TD></TR></TABLE></P></LI></OL></DIV><DIVCLASS="NOTE"><BLOCKQUOTECLASS="NOTE"><P><B>NOTE: </B
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -