redboot.sgml

来自「eCos操作系统源码」· SGML 代码 · 共 737 行 · 第 1/3 页

SGML
737
字号
number which needs to be configured, regardless of IP address selection mode,is the <indexterm><primary>GDB connection port</primary></indexterm><computeroutput>GDB connection port</computeroutput>. 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.  </para><para>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 <indexterm><primary>telnet</primary></indexterm>telnetprotocol. For example, on Linux&reg;: </para><programlisting>% telnet redboot_board 9000Connected to redboot_boardEscape character is &lsquo;^]&rsquo;.RedBoot>  </programlisting></sect2><sect2><title>Host Network Configuration</title><para><indexterm><primary>host network configuration</primary></indexterm><indexterm><primary>network configuration</primary><secondary>host</secondary></indexterm><indexterm><primary>configuration</primary><secondary>network</secondary></indexterm>RedBootmay require three different classes of service from a network host:   </para><itemizedlist><listitem><para>dynamic IP address allocation, using BOOTP   </para></listitem><listitem><para>TFTP service for file downloading </para></listitem><listitem><para>DNS server for hostname lookups </para></listitem></itemizedlist><para>Depending on the host system, these services may or may not be availableor enabled by default. See your system documentation for more details.</para><para>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 <computeroutput>root</computeroutput> on the host or server machine.</para><sect3><title>Enable TFTP on Red Hat Linux 6.2</title><procedure><step><para><indexterm><primary>TFTP</primary><secondary>enabling on Red HatLinux 6.2</secondary></indexterm><indexterm><primary>Red Hat Linux</primary><secondary>enabling TFTP on version 6.2</secondary></indexterm>Ensure thatyou have the tftp-server RPM package installed. By default, this installsthe TFTP server in a disabled state. These steps will enable it:</para></step><step><para>Make sure that the following line is uncommented in the controlfile <filename>/etc/inetd.conf</filename> <screen>tftp dgram   udp     wait    root    /usr/sbin/tcpd      /usr/sbin/in.tftpd</screen></para><para></para></step><step><para>If it was necessary to change the line in Step 2, then the inetdserver must be restarted, which can be done via the command:    <programlisting># service inet reload</programlisting></para></step></procedure></sect3><sect3><title>Enable TFTP on Red Hat Linux 7 (or newer)</title><procedure><step><para><indexterm><primary>TFTP</primary><secondary>enabling on Red HatLinux 7</secondary></indexterm><indexterm><primary>Red Hat Linux</primary><secondary>enabling TFTP on version 7</secondary></indexterm>Ensure that thexinetd RPM is installed.</para></step><step><para>Ensure that the tftp-server RPM is installed.</para></step><step><para>Enable TFTP by means of the following: <programlisting>/sbin/chkconfig tftp on</programlisting>Reload the xinetd configuration using the command:<programlisting> /sbin/service xinetd reload </programlisting>Create the directory /tftpbootusing the command <programlisting>mkdir /tftpboot</programlisting></para></step><step><para>If you are using Red Hat 8 or newer, you may need to configurethe built-in firewall to allow through TFTP. Either edit<filename>/etc/sysconfig/iptables</filename> or run<command>redhat-config-securitylevel</command> on the command line or fromthe menu as System Settings->Security Settings to lower the security level.You should only do this with the permission of your systems administrator andif you are already behind a separate firewall.</para></step></procedure><note><title>NOTE</title><para>Under Red Hat 7 you must address files by absolute pathnames, for example: <filename>/tftpboot/boot.img</filename> not <filename>/boot.img</filename>, as you may have done withother implementations.On systems newer than Red Hat 7 (7.1 and beyond), filenames are once again relative to the<filename>/tftpboot</filename> directory.</para></note></sect3><sect3><title>Enable BOOTP/DHCP server on Red Hat Linux</title><para><indexterm><primary>DHCP</primary><secondary>enabling on Red Hat Linux</secondary></indexterm><indexterm><primary>BOOTP</primary><secondary>enabling on Red Hat Linux</secondary></indexterm>First, ensure that you havethe proper package, <computeroutput>dhcp</computeroutput> (not <computeroutput>dhcpd</computeroutput>) installed. The DHCP server provides Dynamic Host Configuration,that is, IP address and other data to hosts on a network. It does this indifferent ways. Next, there can be a fixed relationship between a certainnode and the data, based on that node&rsquo;s unique Ethernet Station Address(ESA, sometimes called a MAC address). The other possibility is simply toassign addresses that are free. The sample DHCP configuration file shown doesboth. Refer to the DHCP documentation for more details.</para><example><title>Sample DHCP configuration file</title><programlisting>--------------- /etc/dhcpd.conf -----------------------------default-lease-time 600;max-lease-time 7200;option subnet-mask 255.255.255.0;option broadcast-address 192.168.1.255;option domain-name-servers 198.41.0.4, 128.9.0.107;option domain-name &ldquo;bogus.com&rdquo;;allow bootp;shared-network BOGUS {subnet 192.168.1.0 netmask 255.255.255.0 {         option routers 192.168.1.101;         range 192.168.1.1 192.168.1.254;} }host mbx {         hardware ethernet 08:00:3E:28:79:B8;         fixed-address 192.168.1.20;         filename &ldquo;/tftpboot/192.168.1.21/zImage&rdquo;;         default-lease-time -1;         server-name &ldquo;srvr.bugus.com&rdquo;;         server-identifier 192.168.1.101;         option host-name &ldquo;mbx&rdquo;;} </programlisting></example><para>Once the DHCP package has been installed and the configuration fileset up, type:<screen># <userinput>service dhcpd start</userinput></screen></para></sect3><sect3><title>Enable DNS server on Red Hat Linux</title><para><indexterm><primary>DNS</primary><secondary>enabling on Red HatLinux</secondary></indexterm>First, ensure that you have the properRPM package, <computeroutput>caching-nameserver</computeroutput>installed. Then change the configuration(in <filename>/etc/named.conf</filename>) so that the<computeroutput>forwarders</computeroutput> point to the primarynameservers for your machine, normally using the nameservers listed in<filename>/etc/resolv.conf</filename>.</para><example><title>Sample <filename>/etc/named.conf</filename> for Red Hat Linux 7.x</title><programlisting>--------------- /etc/named.conf -----------------------------// generated by named-bootconf.ploptions {        directory "/var/named";        /*         * If there is a firewall between you and nameservers you want         * to talk to, you might need to uncomment the query-source         * directive below.  Previous versions of BIND always asked         * questions using port 53, but BIND 8.1 uses an unprivileged         * port by default.         */        // query-source address * port 53;        forward first;        forwarders {                212.242.40.3;                212.242.40.51;        };};//// a caching only nameserver config//// Uncomment the following for Red Hat Linux 7.2 or above:// controls {//         inet 127.0.0.1 allow { localhost; } keys { rndckey; };// };// include "/etc/rndc.key";zone "." IN {        type hint;        file "named.ca";};zone "localhost" IN {        type master;        file "localhost.zone";        allow-update { none; };};zone "0.0.127.in-addr.arpa" IN {        type master;        file "named.local";        allow-update { none; };};</programlisting></example><para>Make sure the server is started with the command:<screen># <userinput>service named start</userinput></screen> and isstarted on next reboot with the command<screen># <userinput>chkconfig named on</userinput></screen>Finally, you may wish to change<filename>/etc/resolv.conf</filename> to use<computeroutput>127.0.0.1</computeroutput> as the nameserver for yourlocal machine.</para></sect3><sect3><title>RedBoot network gateway</title><para><indexterm><primary>RedBoot network gateway</primary></indexterm><indexterm><primary>network gateway</primary></indexterm>RedBoot cannot communicate withmachines on different subnets because it does not support routing. It alwaysassumes that it can get to an address directly, therefore it always triesto ARP and then send packets directly to that unit. This means that whateverit talks to must be on the same subnet. If you need to talk to a host on adifferent subnet (even if it's on the same &lsquo;wire&rsquo;), you need togo through an ARP proxy, providing that there is a Linux box connected tothe network which is able to route to the TFTP server. For example: <filename>/proc/sys/net/ipv4/conf/<replaceable>&lt;interface></replaceable>/proxy_arp </filename>where <replaceable>&lt;interface></replaceable>should be replaced with whichever network interfaceis directly connected to the board.</para></sect3></sect2><sect2><title>Verification</title><para><indexterm><primary>verification (network)</primary></indexterm><indexterm><primary>network verification</primary></indexterm>Once your network setuphas been configured, perform simple verification tests as follows: <itemizedlist><listitem><para>Reboot your system, to enable the setup, and then try to &lsquo;ping&rsquo;the target board from a host.</para></listitem><listitem><para>Once communication has been established, try to pinga host using the RedBoot ping command - both by IP address and hostname.</para></listitem><listitem><para>Try using the RedBoot load command to download a filefrom a host.</para></listitem></itemizedlist></para></sect2></sect1></chapter><!-- Commands --><!-- &redboot-current-doc-redboot-cmds-sgml; --><!-- Rebuilding --><!-- &redboot-current-doc-redboot-rebuilding-sgml; --><!-- Installing and testing --><!-- &redboot-current-doc-redboot-installing-sgml; --><!-- Epilogue --><!-- &redboot-current-doc-redboot-epilogue-sgml; -->

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?