]> git.kernelconcepts.de Git - karo-tx-redboot.git/blob - doc/html/ref/configuring-the-redboot-environment.html
Initial revision
[karo-tx-redboot.git] / doc / html / ref / configuring-the-redboot-environment.html
1 <!-- Copyright (C) 2003 Red Hat, Inc.                                -->
2 <!-- This material may be distributed only subject to the terms      -->
3 <!-- and conditions set forth in the Open Publication License, v1.0  -->
4 <!-- or later (the latest version is presently available at          -->
5 <!-- http://www.opencontent.org/openpub/).                           -->
6 <!-- Distribution of the work or derivative of the work in any       -->
7 <!-- standard (paper) book form is prohibited unless prior           -->
8 <!-- permission is obtained from the copyright holder.               -->
9 <HTML
10 ><HEAD
11 ><TITLE
12 >Configuring the RedBoot Environment</TITLE
13 ><meta name="MSSmartTagsPreventParsing" content="TRUE">
14 <META
15 NAME="GENERATOR"
16 CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
17 "><LINK
18 REL="HOME"
19 TITLE="eCos Reference Manual"
20 HREF="ecos-ref.html"><LINK
21 REL="UP"
22 TITLE="Getting Started with RedBoot"
23 HREF="getting-started-with-redboot.html"><LINK
24 REL="PREVIOUS"
25 TITLE="RedBoot Resource Usage"
26 HREF="resource-usage.html"><LINK
27 REL="NEXT"
28 TITLE="RedBoot Commands and Examples"
29 HREF="redboot-commands-and-examples.html"></HEAD
30 ><BODY
31 CLASS="SECT1"
32 BGCOLOR="#FFFFFF"
33 TEXT="#000000"
34 LINK="#0000FF"
35 VLINK="#840084"
36 ALINK="#0000FF"
37 ><DIV
38 CLASS="NAVHEADER"
39 ><TABLE
40 SUMMARY="Header navigation table"
41 WIDTH="100%"
42 BORDER="0"
43 CELLPADDING="0"
44 CELLSPACING="0"
45 ><TR
46 ><TH
47 COLSPAN="3"
48 ALIGN="center"
49 >eCos Reference Manual</TH
50 ></TR
51 ><TR
52 ><TD
53 WIDTH="10%"
54 ALIGN="left"
55 VALIGN="bottom"
56 ><A
57 HREF="resource-usage.html"
58 ACCESSKEY="P"
59 >Prev</A
60 ></TD
61 ><TD
62 WIDTH="80%"
63 ALIGN="center"
64 VALIGN="bottom"
65 >Chapter 1. Getting Started with RedBoot</TD
66 ><TD
67 WIDTH="10%"
68 ALIGN="right"
69 VALIGN="bottom"
70 ><A
71 HREF="redboot-commands-and-examples.html"
72 ACCESSKEY="N"
73 >Next</A
74 ></TD
75 ></TR
76 ></TABLE
77 ><HR
78 ALIGN="LEFT"
79 WIDTH="100%"></DIV
80 ><DIV
81 CLASS="SECT1"
82 ><H1
83 CLASS="SECT1"
84 ><A
85 NAME="CONFIGURING-THE-REDBOOT-ENVIRONMENT">Configuring the RedBoot Environment</H1
86 ><P
87 >Once installed, RedBoot will operate fairly generically. However,
88 there are some features that can be configured for a particular installation.
89 These depend primarily on whether flash and/or networking support are available. The remainder
90 of this discussion assumes that support for both of these options is included
91 in RedBoot.</P
92 ><DIV
93 CLASS="SECT2"
94 ><H2
95 CLASS="SECT2"
96 ><A
97 NAME="TARGET-NETWORK-CONFIGURATION">Target Network Configuration</H2
98 ><P
99 >Each node in a networked
100 system needs to have a unique address. Since the network support in RedBoot
101 is based on TCP/IP, this address
102 is an IP (Internet Protocol) address. There are two ways for a system to &#8220;know&#8221;
103 its IP address. First, it can be stored locally on the platform. This is known
104 as having a static IP address. Second, the system can use the network itself
105 to discover its IP address. This is known as a dynamic IP address. RedBoot
106 supports this dynamic IP address mode by use of the BOOTP (a subset of DHCP) protocol. In this case, RedBoot will ask the network (actually
107 some generic server on the network) for the IP address to use.</P
108 ><DIV
109 CLASS="NOTE"
110 ><BLOCKQUOTE
111 CLASS="NOTE"
112 ><P
113 ><B
114 >NOTE: </B
115 >Currently, RedBoot only supports BOOTP. In future releases, DHCP may
116 also be supported, but such support will be limited to additional data items,
117 not lease-based address allocation.</P
118 ></BLOCKQUOTE
119 ></DIV
120 ><P
121 >The choice of IP
122 address type is made via the <B
123 CLASS="COMMAND"
124 >fconfig</B
125 > command. Once a selection
126 is made, it will be stored in flash memory. RedBoot only queries the flash
127 configuration information at reset, so any changes will require restarting
128 the platform.</P
129 ><P
130 >Here is an example of the RedBoot <B
131 CLASS="COMMAND"
132 >fconfig</B
133 >
134 command, showing network addressing:    </P
135 ><TABLE
136 BORDER="5"
137 BGCOLOR="#E0E0F0"
138 WIDTH="70%"
139 ><TR
140 ><TD
141 ><PRE
142 CLASS="PROGRAMLISTING"
143 >RedBoot&#62; <TT
144 CLASS="USERINPUT"
145 ><B
146 >fconfig -l</B
147 ></TT
148 >
149 Run script at boot: false
150 Use BOOTP for network configuration: false
151 Local IP address: 192.168.1.29
152 Default server IP address: 192.168.1.101
153 DNS server IP address: 192.168.1.1
154 GDB connection port: 9000
155 Network debug at boot time: false  </PRE
156 ></TD
157 ></TR
158 ></TABLE
159 ><P
160 >In this case, the board has been configured with a static IP address
161 listed as the Local IP address. The default server IP address specifies which
162 network node to communicate with for TFTP service. This address can be overridden
163 directly in the TFTP
164 commands.</P
165 ><P
166 >The <TT
167 CLASS="COMPUTEROUTPUT"
168 >DNS server IP address</TT
169 > option
170 controls where RedBoot should make DNS lookups. A setting of 0.0.0.0 will disable DNS
171 lookups. The DNS server IP address can also be set at runtime.</P
172 ><P
173 >If the selection for <TT
174 CLASS="COMPUTEROUTPUT"
175 >Use BOOTP for network configuration</TT
176 > had been <TT
177 CLASS="COMPUTEROUTPUT"
178 >true</TT
179 >, these IP
180 addresses would be determined at boot time, via the BOOTP protocol. The final
181 number which needs to be configured, regardless of IP address selection mode,
182 is the <TT
183 CLASS="COMPUTEROUTPUT"
184 >GDB connection port</TT
185 >. RedBoot allows for incoming commands
186 on either the available serial ports or via the network. This port number
187 is the TCP port that RedBoot will use to accept incoming connections.  </P
188 ><P
189 >These connections can be used for GDB sessions, but they can also be
190 used for generic RedBoot commands. In particular, it is possible to communicate
191 with RedBoot via the telnet
192 protocol. For example, on Linux&reg;: </P
193 ><TABLE
194 BORDER="5"
195 BGCOLOR="#E0E0F0"
196 WIDTH="70%"
197 ><TR
198 ><TD
199 ><PRE
200 CLASS="PROGRAMLISTING"
201 >% telnet redboot_board 9000
202 Connected to redboot_board
203 Escape character is &#8216;^]&#8217;.
204 RedBoot&#62;  </PRE
205 ></TD
206 ></TR
207 ></TABLE
208 ></DIV
209 ><DIV
210 CLASS="SECT2"
211 ><H2
212 CLASS="SECT2"
213 ><A
214 NAME="AEN2722">Host Network Configuration</H2
215 ><P
216 >RedBoot
217 may require three different classes of service from a network host:   </P
218 ><P
219 ></P
220 ><UL
221 ><LI
222 ><P
223 >dynamic IP address allocation, using BOOTP   </P
224 ></LI
225 ><LI
226 ><P
227 >TFTP service for file downloading </P
228 ></LI
229 ><LI
230 ><P
231 >DNS server for hostname lookups </P
232 ></LI
233 ></UL
234 ><P
235 >Depending on the host system, these services may or may not be available
236 or enabled by default. See your system documentation for more details.</P
237 ><P
238 >In particular, on Red Hat Linux, neither of these services will be configured
239 out of the box. The following will provide a limited explanation of how to
240 set them up. These configuration setups must be done as <TT
241 CLASS="COMPUTEROUTPUT"
242 >root</TT
243 > on the host or server machine.</P
244 ><DIV
245 CLASS="SECT3"
246 ><H3
247 CLASS="SECT3"
248 ><A
249 NAME="AEN2743">Enable TFTP on Red Hat Linux 6.2</H3
250 ><DIV
251 CLASS="PROCEDURE"
252 ><OL
253 TYPE="1"
254 ><LI
255 ><P
256 >Ensure that
257 you have the tftp-server RPM package installed. By default, this installs
258 the TFTP server in a disabled state. These steps will enable it:</P
259 ></LI
260 ><LI
261 ><P
262 >Make sure that the following line is uncommented in the control
263 file <TT
264 CLASS="FILENAME"
265 >/etc/inetd.conf</TT
266 > <TABLE
267 BORDER="5"
268 BGCOLOR="#E0E0F0"
269 WIDTH="70%"
270 ><TR
271 ><TD
272 ><PRE
273 CLASS="SCREEN"
274 >tftp dgram   udp     wait    root    /usr/sbin/tcpd      /usr/sbin/in.tftpd</PRE
275 ></TD
276 ></TR
277 ></TABLE
278 ></P
279 ><P
280 ></P
281 ></LI
282 ><LI
283 ><P
284 >If it was necessary to change the line in Step 2, then the inetd
285 server must be restarted, which can be done via the command:    <TABLE
286 BORDER="5"
287 BGCOLOR="#E0E0F0"
288 WIDTH="70%"
289 ><TR
290 ><TD
291 ><PRE
292 CLASS="PROGRAMLISTING"
293 ># service inet reload</PRE
294 ></TD
295 ></TR
296 ></TABLE
297 ></P
298 ></LI
299 ></OL
300 ></DIV
301 ></DIV
302 ><DIV
303 CLASS="SECT3"
304 ><H3
305 CLASS="SECT3"
306 ><A
307 NAME="AEN2762">Enable TFTP on Red Hat Linux 7 (or newer)</H3
308 ><DIV
309 CLASS="PROCEDURE"
310 ><OL
311 TYPE="1"
312 ><LI
313 ><P
314 >Ensure that the
315 xinetd RPM is installed.</P
316 ></LI
317 ><LI
318 ><P
319 >Ensure that the tftp-server RPM is installed.</P
320 ></LI
321 ><LI
322 ><P
323 >Enable TFTP by means of the following: <TABLE
324 BORDER="5"
325 BGCOLOR="#E0E0F0"
326 WIDTH="70%"
327 ><TR
328 ><TD
329 ><PRE
330 CLASS="PROGRAMLISTING"
331 >/sbin/chkconfig tftp on</PRE
332 ></TD
333 ></TR
334 ></TABLE
335 >Reload the xinetd configuration using the command:<TABLE
336 BORDER="5"
337 BGCOLOR="#E0E0F0"
338 WIDTH="70%"
339 ><TR
340 ><TD
341 ><PRE
342 CLASS="PROGRAMLISTING"
343 > /sbin/service xinetd reload </PRE
344 ></TD
345 ></TR
346 ></TABLE
347 >Create the directory /tftpboot
348 using the command <TABLE
349 BORDER="5"
350 BGCOLOR="#E0E0F0"
351 WIDTH="70%"
352 ><TR
353 ><TD
354 ><PRE
355 CLASS="PROGRAMLISTING"
356 >mkdir /tftpboot</PRE
357 ></TD
358 ></TR
359 ></TABLE
360 ></P
361 ></LI
362 ></OL
363 ></DIV
364 ><DIV
365 CLASS="NOTE"
366 ><BLOCKQUOTE
367 CLASS="NOTE"
368 ><P
369 ><B
370 >NOTE: </B
371 >Under Red Hat 7 you must address files by absolute pathnames, for example: <TT
372 CLASS="FILENAME"
373 >/tftpboot/boot.img</TT
374 > not <TT
375 CLASS="FILENAME"
376 >/boot.img</TT
377 >, as you may have done with
378 other implementations.
379 On systems newer than Red Hat 7 (7.1 and beyond), filenames are once again relative to the
380 <TT
381 CLASS="FILENAME"
382 >/tftpboot</TT
383 > directory.</P
384 ></BLOCKQUOTE
385 ></DIV
386 ></DIV
387 ><DIV
388 CLASS="SECT3"
389 ><H3
390 CLASS="SECT3"
391 ><A
392 NAME="AEN2786">Enable BOOTP/DHCP server on Red Hat Linux</H3
393 ><P
394 >First, ensure that you have
395 the proper package, <TT
396 CLASS="COMPUTEROUTPUT"
397 >dhcp</TT
398 > (not <TT
399 CLASS="COMPUTEROUTPUT"
400 >dhcpd</TT
401 >) installed. The DHCP server provides Dynamic Host Configuration,
402 that is, IP address and other data to hosts on a network. It does this in
403 different ways. Next, there can be a fixed relationship between a certain
404 node and the data, based on that node&#8217;s unique Ethernet Station Address
405 (ESA, sometimes called a MAC address). The other possibility is simply to
406 assign addresses that are free. The sample DHCP configuration file shown does
407 both. Refer to the DHCP documentation for more details.</P
408 ><DIV
409 CLASS="EXAMPLE"
410 ><A
411 NAME="AEN2797"><P
412 ><B
413 >Example 1-1. Sample DHCP configuration file</B
414 ></P
415 ><TABLE
416 BORDER="5"
417 BGCOLOR="#E0E0F0"
418 WIDTH="70%"
419 ><TR
420 ><TD
421 ><PRE
422 CLASS="PROGRAMLISTING"
423 >--------------- /etc/dhcpd.conf -----------------------------
424 default-lease-time 600;
425 max-lease-time 7200;
426 option subnet-mask 255.255.255.0;
427 option broadcast-address 192.168.1.255;
428 option domain-name-servers 198.41.0.4, 128.9.0.107;
429 option domain-name &#8220;bogus.com&#8221;;
430 allow bootp;
431 shared-network BOGUS {
432 subnet 192.168.1.0 netmask 255.255.255.0 {
433          option routers 192.168.1.101;
434          range 192.168.1.1 192.168.1.254;
435 }
436  }
437 host mbx {
438          hardware ethernet 08:00:3E:28:79:B8;
439          fixed-address 192.168.1.20;
440          filename &#8220;/tftpboot/192.168.1.21/zImage&#8221;;
441          default-lease-time -1;
442          server-name &#8220;srvr.bugus.com&#8221;;
443          server-identifier 192.168.1.101;
444          option host-name &#8220;mbx&#8221;;
445 } </PRE
446 ></TD
447 ></TR
448 ></TABLE
449 ></DIV
450 ><P
451 >Once the DHCP package has been installed and the configuration file
452 set up, type:<TABLE
453 BORDER="5"
454 BGCOLOR="#E0E0F0"
455 WIDTH="70%"
456 ><TR
457 ><TD
458 ><PRE
459 CLASS="SCREEN"
460 ># <TT
461 CLASS="USERINPUT"
462 ><B
463 >service dhcpd start</B
464 ></TT
465 ></PRE
466 ></TD
467 ></TR
468 ></TABLE
469 ></P
470 ></DIV
471 ><DIV
472 CLASS="SECT3"
473 ><H3
474 CLASS="SECT3"
475 ><A
476 NAME="AEN2803">Enable DNS server on Red Hat Linux</H3
477 ><P
478 >First, ensure that you have the proper
479 RPM package, <TT
480 CLASS="COMPUTEROUTPUT"
481 >caching-nameserver</TT
482 >
483 installed. Then change the configuration
484 (in <TT
485 CLASS="FILENAME"
486 >/etc/named.conf</TT
487 >) so that the
488 <TT
489 CLASS="COMPUTEROUTPUT"
490 >forwarders</TT
491 > point to the primary
492 nameservers for your machine, normally using the nameservers listed in
493 <TT
494 CLASS="FILENAME"
495 >/etc/resolv.conf</TT
496 >.</P
497 ><DIV
498 CLASS="EXAMPLE"
499 ><A
500 NAME="AEN2813"><P
501 ><B
502 >Example 1-2. Sample <TT
503 CLASS="FILENAME"
504 >/etc/named.conf</TT
505 > for Red Hat Linux 7.x</B
506 ></P
507 ><TABLE
508 BORDER="5"
509 BGCOLOR="#E0E0F0"
510 WIDTH="70%"
511 ><TR
512 ><TD
513 ><PRE
514 CLASS="PROGRAMLISTING"
515 >--------------- /etc/named.conf -----------------------------
516 // generated by named-bootconf.pl
517
518 options {
519         directory "/var/named";
520         /*
521          * If there is a firewall between you and nameservers you want
522          * to talk to, you might need to uncomment the query-source
523          * directive below.  Previous versions of BIND always asked
524          * questions using port 53, but BIND 8.1 uses an unprivileged
525          * port by default.
526          */
527         // query-source address * port 53;
528
529
530         forward first;
531         forwarders {
532                 212.242.40.3;
533                 212.242.40.51;
534         };
535 };
536
537 //
538 // a caching only nameserver config
539 //
540 // Uncomment the following for Red Hat Linux 7.2 or above:
541 // controls {
542 //         inet 127.0.0.1 allow { localhost; } keys { rndckey; };
543 // };
544 // include "/etc/rndc.key";
545 zone "." IN {
546         type hint;
547         file "named.ca";
548 };
549
550 zone "localhost" IN {
551         type master;
552         file "localhost.zone";
553         allow-update { none; };
554 };
555
556 zone "0.0.127.in-addr.arpa" IN {
557         type master;
558         file "named.local";
559         allow-update { none; };
560 };&#13;</PRE
561 ></TD
562 ></TR
563 ></TABLE
564 ></DIV
565 ><P
566 >Make sure the server is started with the command:
567 <TABLE
568 BORDER="5"
569 BGCOLOR="#E0E0F0"
570 WIDTH="70%"
571 ><TR
572 ><TD
573 ><PRE
574 CLASS="SCREEN"
575 ># <TT
576 CLASS="USERINPUT"
577 ><B
578 >service named start</B
579 ></TT
580 ></PRE
581 ></TD
582 ></TR
583 ></TABLE
584 > and is
585 started on next reboot with the command
586 <TABLE
587 BORDER="5"
588 BGCOLOR="#E0E0F0"
589 WIDTH="70%"
590 ><TR
591 ><TD
592 ><PRE
593 CLASS="SCREEN"
594 ># <TT
595 CLASS="USERINPUT"
596 ><B
597 >chkconfig named on</B
598 ></TT
599 ></PRE
600 ></TD
601 ></TR
602 ></TABLE
603 >
604 Finally, you may wish to change
605 <TT
606 CLASS="FILENAME"
607 >/etc/resolv.conf</TT
608 > to use
609 <TT
610 CLASS="COMPUTEROUTPUT"
611 >127.0.0.1</TT
612 > as the nameserver for your
613 local machine.</P
614 ></DIV
615 ><DIV
616 CLASS="SECT3"
617 ><H3
618 CLASS="SECT3"
619 ><A
620 NAME="AEN2824">RedBoot network gateway</H3
621 ><P
622 >RedBoot cannot communicate with
623 machines on different subnets because it does not support routing. It always
624 assumes that it can get to an address directly, therefore it always tries
625 to ARP and then send packets directly to that unit. This means that whatever
626 it talks to must be on the same subnet. If you need to talk to a host on a
627 different subnet (even if it's on the same &#8216;wire&#8217;), you need to
628 go through an ARP proxy, providing that there is a Linux box connected to
629 the network which is able to route to the TFTP server. For example: <TT
630 CLASS="FILENAME"
631 >/proc/sys/net/ipv4/conf/<TT
632 CLASS="REPLACEABLE"
633 ><I
634 >&lt;interface&#62;</I
635 ></TT
636 >/proxy_arp </TT
637 >where <TT
638 CLASS="REPLACEABLE"
639 ><I
640 >&lt;interface&#62;</I
641 ></TT
642 >should be replaced with whichever network interface
643 is directly connected to the board.</P
644 ></DIV
645 ></DIV
646 ><DIV
647 CLASS="SECT2"
648 ><H2
649 CLASS="SECT2"
650 ><A
651 NAME="AEN2834">Verification</H2
652 ><P
653 >Once your network setup
654 has been configured, perform simple verification tests as follows: <P
655 ></P
656 ><UL
657 ><LI
658 ><P
659 >Reboot your system, to enable the setup, and then try to &#8216;ping&#8217;
660 the target board from a host.</P
661 ></LI
662 ><LI
663 ><P
664 >Once communication has been established, try to ping
665 a host using the RedBoot ping command - both by IP address and hostname.</P
666 ></LI
667 ><LI
668 ><P
669 >Try using the RedBoot load command to download a file
670 from a host.</P
671 ></LI
672 ></UL
673 ></P
674 ></DIV
675 ></DIV
676 ><DIV
677 CLASS="NAVFOOTER"
678 ><HR
679 ALIGN="LEFT"
680 WIDTH="100%"><TABLE
681 SUMMARY="Footer navigation table"
682 WIDTH="100%"
683 BORDER="0"
684 CELLPADDING="0"
685 CELLSPACING="0"
686 ><TR
687 ><TD
688 WIDTH="33%"
689 ALIGN="left"
690 VALIGN="top"
691 ><A
692 HREF="resource-usage.html"
693 ACCESSKEY="P"
694 >Prev</A
695 ></TD
696 ><TD
697 WIDTH="34%"
698 ALIGN="center"
699 VALIGN="top"
700 ><A
701 HREF="ecos-ref.html"
702 ACCESSKEY="H"
703 >Home</A
704 ></TD
705 ><TD
706 WIDTH="33%"
707 ALIGN="right"
708 VALIGN="top"
709 ><A
710 HREF="redboot-commands-and-examples.html"
711 ACCESSKEY="N"
712 >Next</A
713 ></TD
714 ></TR
715 ><TR
716 ><TD
717 WIDTH="33%"
718 ALIGN="left"
719 VALIGN="top"
720 >RedBoot Resource Usage</TD
721 ><TD
722 WIDTH="34%"
723 ALIGN="center"
724 VALIGN="top"
725 ><A
726 HREF="getting-started-with-redboot.html"
727 ACCESSKEY="U"
728 >Up</A
729 ></TD
730 ><TD
731 WIDTH="33%"
732 ALIGN="right"
733 VALIGN="top"
734 >RedBoot Commands and Examples</TD
735 ></TR
736 ></TABLE
737 ></DIV
738 ></BODY
739 ></HTML
740 >