Skip to main content.
Navigation:
DENX
>
DULG
>
SystemSetup
Translations:
Edit
|
Attach
|
Raw
|
Ref-By
|
Printable
|
More
DULG
Sections of this site:
DENX Home
|
DULG
|
ELDK-5
|
Know
|
Training
|
U-Boot
|
U-Bootdoc
Topics
DULG Home
BoardSelect
Manual
FAQ
Application Notes
Changes
Index
List of pages in DULG
Search
%CONTENTS{topic=SystemSetup}% %SECTION0{name=SystemSetup}% System Setup Some tools are needed to install and configure U-Boot and Linux on the target system. Also, especially during development, you will want to be able to interact with the target system. This section describes how to configure your host system for this purpose. #SerialConsoleAccess %SECTION1{name=SerialConsoleAccess}% Serial Console Access To use U-Boot and Linux as a development system and to make full use of all their capabilities you will need access to a serial console port on your target system. Later, U-Boot and Linux can be configured to allow for automatic execution without any user interaction. There are several ways to access the serial console port on your target system, such as using a terminal server, but the most common way is to attach it to a serial port on your host. Additionally, you will need a terminal emulation program on your host system, such as =cu= or =kermit=. #ConfigureCu %SECTION1{name=ConfigureCu}% Configuring the "cu" command The =cu= command is part of the UUCP package and can be used to act as a dial-in terminal. It can also do simple file transfers, which can be used in U-Boot for image download. On RedHat systems you can check if the UUCP package is installed as follows: <verbatim> $ rpm -q uucp </verbatim> If necessary, install the UUCP package from your distribution media. To configure =cu= for use with U-Boot and Linux please make sure that the following entries are present in the =UUCP= configuration files; depending on your target configuration the serial port and/or the console baudrate may be different from the values used in this example: (_/dev/ttyS0_, %CONSOLE_BAUDRATE% bps, 8N1): * _/etc/uucp/sys_: <pre> # # /dev/ttyS0 at %CONSOLE_BAUDRATE% bps: # system S0@%CONSOLE_BAUDRATE% port serial0_%CONSOLE_BAUDRATE% time any </pre> * _/etc/uucp/port_: <pre> # # /dev/ttyS0 at %CONSOLE_BAUDRATE% bps: # port serial0_%CONSOLE_BAUDRATE% type direct device /dev/ttyS0 speed %CONSOLE_BAUDRATE% hardflow false </pre> You can then connect to the serial line using the command <pre> $ cu S0@%CONSOLE_BAUDRATE% Connected. </pre> To disconnect, type the escape character '~' followed by '.' at the beginning of a line. See also: =cu(1)=, =info uucp=. #ConfigureKermit %SECTION1{name=ConfigureKermit}% Configuring the "kermit" command The name =kermit= stands for a whole family of communications software for serial and network connections. The fact that it is available for most computers and operating systems makes it especially well suited for our purposes. =kermit= executes the commands in its initialization file, _.kermrc_, in your home directory before it executes any other commands, so this can be easily used to customize its behaviour using appropriate initialization commands. The following settings are recommended for use with U-Boot and Linux: * _~/.kermrc_: <pre> set line /dev/ttyS0 set speed %CONSOLE_BAUDRATE% set carrier-watch off set handshake none set flow-control none robust set file type bin set file name lit set rec pack 1000 set send pack 1000 set window 5 </pre> This example assumes that you use the first serial port of your host system (_/dev/ttyS0_) at a baudrate of %CONSOLE_BAUDRATE% to connect to the target's serial console port. You can then connect to the serial line: <pre> $ kermit -c Connecting to /dev/ttyS0, speed %CONSOLE_BAUDRATE%. The escape character is Ctrl-\ (ASCII 28, FS) Type the escape character followed by C to get back, or followed by ? to see other options. ---------------------------------------------------- </pre> %T% Due to licensing conditions you will often find two kermit packages in your GNU/Linux distribution. In this case you will want to install the =ckermit= package. The =gkermit= package is only a command line tool implementing the kermit transfer protocol. %T% If you cannot find =kermit= on the distribution media for your Linux host system, you can download it from the kermit project home page: [[http://www.columbia.edu/kermit/]] #UsingMinicom %SECTION1{name=UsingMinicom}% Using the "minicom" program =minicom= is another popular serial communication program. Unfortunately, many users have reported problems using it with U-Boot and Linux, especially when trying to use it for serial image download. It's use is therefore discouraged. #PermissionProblems %SECTION1{name=PermissionProblems}% Permission Denied Problems The terminal emulation program must have write access to the serial port and to any locking files that are used to prevent concurrent access from other applications. Depending on the used Linux distribution you may have to make sure that: * the serial device belongs to the same group as the =cu= command, and that the permissions of =cu= have the _setgid_ bit set * the =kermit= belongs to the same group as =cu= and has the _setgid_ bit set * the _/var/lock_ directory belongs to the same group as the =cu= command, and that the write permissions for the group are set #ConfigureTftp %SECTION1{name=ConfigureTftp}% Configuration of a TFTP Server The fastest way to use U-Boot to load a Linux kernel or an application image is file transfer over Ethernet. For this purpose, U-Boot implements the _TFTP_ protocol (see the =tftpboot= command in U-Boot). To enable TFTP support on your host system you must make sure that the TFTP daemon program _/usr/sbin/in.tftpd_ is installed. On RedHat systems you can verify this by running: <verbatim> $ rpm -q tftp-server </verbatim> If necessary, install the TFTP daemon program from your distribution media. Most Linux distributions disable the TFTP service by default. To enable it for example on RedHat systems, edit the file _/etc/xinetd.d/tftp_ and remove the line <verbatim> disable = yes </verbatim> or change it into a comment line by putting a hash character in front of it: %INCLUDE{DULGData.XinetdTftpConfiguration}% Also, make sure that the _/tftpboot_ directory exists and is world-readable (permissions at least "dr-xr-xr-x"). On newer Linux distros that use systemd, you would need to start the TFTP service, enable it, then tweak your firewall to allow TFTP traffic, something like this: <verbatim> $ sudo systemctl start tftp $ sudo systemctl enable tftp $ sudo firewall-cmd --permanent --add-service tftp $ sudo firewall-cmd --reload </verbatim> #ConfigureDhcp %SECTION1{name=ConfigureDhcp}% Configuration of a BOOTP / DHCP Server *BOOTP* resp. *DHCP* can be used to automatically pass configuration information to the target. The only thing the target must "know" about itself is its own Ethernet hardware (MAC) address. The following command can be used to check if DHCP support is available on your host system: <verbatim> $ rpm -q dhcp </verbatim> If necessary, install the DHCP package from your distribution media. Then you have to create the DHCP configuration file _/etc/dhcpd.conf_ that matches your network setup. The following example gives you an idea what to do: <pre> subnet %SUBNET% netmask %NETMASK% { option routers %SERVERIP%; option subnet-mask %NETMASK%; option domain-name "local.net"; option domain-name-servers ns.local.net; host trgt { hardware ethernet 00:30:BF:01:02:D0; fixed-address %IPADDR%; option root-path "%ROOTPATH%"; option host-name "%HOSTNAME%"; next-server %SERVERIP%; filename "%BOOTIMAGE%"; } } </pre> With this configuration, the DHCP server will reply to a request from the target with the ethernet address =00:30:BF:01:02:D0= with the following information: * The target is located in the subnet =%SUBNET%= which uses the netmask =%NETMASK%=. * The target has the hostname =%HOSTNAME%= and the IP address =%IPADDR%=. * The host with the IP address =%SERVERIP%= will provide the boot image for the target and provide NFS server function in cases when the target mounts it's root filesystem over NFS. %BR% %T% The host listed with the =next-server= option can be different from the host that is running the DHCP server. * The host provides the file _%BOOTIMAGE%_ as boot image for the target. * The target can mount the directory _%ROOTPATH%_ on the NFS server as root filesystem. #ConfigureNfs %SECTION1{name=ConfigureNfs}% Configuring a NFS Server For a development environment it is very convenient when the host and the target can share the same files over the network. The easiest way for such a setup is when the host provides NFS server functionality and exports a directory that can be mounted from the target as the root filesystem. Assuming NFS server functionality is already provided by your host, the only configuration that needs to be added is an entry for your target root directory to your _/etc/exports_ file, for instance like this: <pre> %ROOTPATH% %SUBNET%/%NETMASK%(rw,no_root_squash,sync) </pre> This line exports the _%ROOTPATH%_ directory with read and write permissions to all hosts on the =%SUBNET%= subnet. After modifying the _/etc/exports_ file you must make sure the NFS system is notified about the change, for instance by issuing the command: <verbatim> # /sbin/service nfs restart </verbatim>
3.11. Notes for Solaris 2.x Host Environment
1. Abstract
5. Das U-Boot
Prev
Home
Next