|
Hitachi SuperH Linux Packages - Release 0.4
This page announces the 4th release of a set of RPM (RedHat
Package Manager) files for Linux on the Hitachi SH. It describes
the procedure for installing the RPMs, covering both the installation of
the pre-built RPMS, and also the process for building a set of RPMs from
SRPMs (source RPMs). Some familiarity with RPM is assumed.
Acknowledgement
This distribution is based on the MontaVista
Hard Hat Linux distribution. We fully acknowledge all the effort they have
put into generating their PPC-cross distribution, which has served as a
template for this work. Many thanks to all at MontaVista.
Any problems, please don't contact MontaVista. Send an e-mail either to
myself or the mailing list.
General
A typical Linux installation consists
of a set of RPM package files. Each package contains the files (executables,
libraries, headers, man pages, etc) for part of the system. For example,
there are separate packages for the kernel itself, the C compiler, etc.
An RPM package file is built from an SRPM (Source RPM) using the RPM tool.
An SRPM contains all the source files required to build the package (generally
compressed into a small number of .gz or .bz2 files), any patches which
are required, and a special 'spec' file which defines the contents of the
package and how it is built.
The description below assumes that the installation will be performed
on a PC running Linux, with RPM V3.0 or later already installed.
Status of Installation
As mentioned above, this installation is based on the MontaVista
Hard Hat Linux distribution. It follows V1.2 as closely as possible, with
appropriate modifications taken from the SH
SourceForge site and several other sites where necessary. (To see the
precise origin of each set of source files, see the corresponding 'spec'
files in the SRPMs).
This installation contains the RPMs for SH4, and the SRPMS used
to derive them. SH3 RPMs may be generated by following the build instructions
below.
All the most important packages are included in the distribution (see HardHat documentation).
Also included are packages for ncurses, X, uClibc, tinylogin and several other useful packages.
However currently a few minor packages are not yet present. The missing ones are:
apache
bonnie
ddd
gated
lilo
microwindows
perl
pvm
These may be added at a later date.
The toolchain (binutils, gcc, glibc) is based around a gcc V2.97 snapshot as of November 20, 2000.
The build and installation of the toolchain is based on information prepared by Masahiro Abe
(see here).
This version of the compiler still suffers from a number of bugs and its C++ libraries are incomplete.
However, it is currently the best available.
The kernel is basically version 2.4.5, with patches added to support the STMicroelectronics 7750Overdrive board.
Note that at the time of writing, the SH4 installation has not been fully tested,
and the SH3 installation no testing whatsoever. The installation
is a Beta release only, and is likely to have some problems. We have made
this release in order to get this version of SH Linux out into the wider
community as soon as possible. We welcome any constructive feedback on
how to improve the release (mail to [email protected]).
For details of the changes since the previous release, and known problems,
see below.
Location of Files
The files for the installation may be found under ftp://linuxsh.sourceforge.net/pub/linuxsh/shrpm-0.4.
This directory just contains some script files (see below). The SRPMS are
located under directory SRPMS, and the RPMS under RPMS/i386
(host based software) and RPMS/noarch (target based software).
There is also a subdirectory update, containing RPMS and SRPMS updated since the 0.4 release.
Installing the RPMs
Root access is required in order to install the RPMs. The files will
end up being installed under directory /opt/hardhat. Create a
working directory, and create the following directory structure there:
+
|
+-------------+-------------+--------------+-------------+
| | | | |
BUILD RPMS SOURCES SPECS SRPMS
|
+----+-----+
| |
i386 noarch
(Actually, only RPMS and its subdirectories are needed if
you are just installing RPMS; the other directories are need for building
SRPMS, see later).
Then copy the RPMs from the above location onto this structure. The
RPM files will need to be placed under RPMS/i386 (host based software)
and RPMS/noarch (target based software). Note you need only copy
the RPMS which are relevant to your CPU type, e.g. for SH4, files are hhl-sh4-*.rpm,
plus any RPMS which do not have either sh3 or sh4 in
their filename.
If you are using your own version of the kernel, delete the kernel RPMS:
rm RPMS/noarch/*lsp*
rm RPMS/noarch/*kernel*
Next, you need to decide whether you want to install busybox
or not. Basically, busybox contains cut-down versions of many
commands, and is generally only used in an embedded environment with restricted
disk or memory space. If you want the normal versions of commands, simply
delete the busybox package before proceeding to the next stage:
rm RPMS/noarch/*busybox*
Alternatively, if busybox is required, delete the alternative
packages (I think these are binutils-tgt, findutils,
grep,
gzip,
net-tools,
procps,
psmisc,
sed,
sh-utils,
sysvinit,
tar,
textutils,
telnet,
telnetd).
Change default to each of the RPMS subdirectories in turn,
and issue the following command:
rpm -Uhv *.rpm
/opt/hardhat/devkit/sh/<cpu> (where <cpu> is
either sh3 or sh4) will become the root directory for
the installation, with the usual Linux directory structure below that.
Most of the host-based tools are placed under subdirectory bin,
and this will need to be added to your PATH, eg:
PATH=$PATH:/opt/hardhat/devkit/sh/sh4/bin
The GNU toolnames are prefixed sh-linux-gnu-, e.g. to compile
a C program:
sh-linux-gnu-gcc -c file.c
If you are using your own version of the kernel, you will also need to add links to the
kernel header files to /opt/hardhat/devkit/sh/<cpu>/sh-linux-gnu/include:
ln -s <kernelbase>/include/asm
/opt/hardhat/devkit/sh/<cpu>/sh-linux-gnu/include/asm-sh
ln -s <kernelbase>/include/linux /opt/hardhat/devkit/sh/<cpu>/sh-linux-gnu/include/linux
The target-based software is placed under subdirectory target.
This is most conveniently accessed by mounting it via NFS from the target
system.
See the latest HardHat
documentation for further details of the installation and how to use
it.
Building the SRPMs
For those users who wish to build their own RPMs, the procedure is as follows.
Note that you will need 2Gb of free disk space. During the build, certain
packages need to be installed (binutils, gcc, glibc, etc.), and these will
be placed under/opt/hardhat.So if you have an installation already
there you must delete or move it first.
Note also that the procedure assumes the presence of a properly packaged kernel. You may
use either the kernel supplied with the distribution, or a kernel you have packaged yourself
in accordance with HardHat conventions.
Create a suitable clean working directory and subdirectories as described
above.
Copy the SRPMs to subdirectory SRPMS.
Copy the rpmconfig RPM to RPMS/noarch. This package contains
important configuration files which are needed during the build.
Copy the scripts install_srpms and build_srpms to the
working directory.
Change default to the working directory.
Issue the command:
./install_srpms
This will install all the SRPMS, placing the source files under SOURCES
and the RPM spec files under SPECS.
Issue the command:
./build_srpms <cpu>
where <cpu> is sh3 or sh4. This will take several hours to complete.
Logfiles for each package build are placed on the SPECS directory.
It is advisable to check these carefully for errors, as not all error conditions
cause the build process to abort. The RPMs will be placed under the RPMS
directory.
Install the RPMs as described previously, having first cleaned the /opt/hardhat
directory.
Changes Since Release 0.3
Addition of 2.4.5 kernel & LSPs.
New toolchain (gcc, glibc, binutils - see above).
Newer port of gdb (20001217).
Addition of uclibc, an smaller alternative to glibc. Several of the packages (busybox, tinylogin,
inetd-ping and telnetd) have been adapted to build with this as an alternative. (Note this has
required extra macro definitions, which are provided by the new version of rpmconfig).
Addition of packages for console-tools, native gcc, less, libpng, libjpeg, linux-console,
linuxshmkimg, mtd-utils, openssl, rpc, and tinylogin.
New version of busybox (0.52).
Various minor changes to filesystem, fileutils, ftp, inetd-ping, libtermcap, modutils, netperf,
rpmconfig, strace, sysvinit, tcpdump, telnetd, ucd-snmp, util-linux, x.
Known Problems
gdb can't handle stack backtraces across shared library boundaries. There are also some other
occasional errors which have not yet been fully characterized.
As mentioned earlier, the C++ implementation is incomplete, especially the libraries.
Certain C constructs can cause gcc to generate an internal error. These problems have not yet been characterized.
Complicated or lengthy floating point code seems particularly prone to this. If you hit one of these problems,
try changing the optimization level. If this doesn't work, try rearranging the code, e.g. split up large
assignment statements into several smaller parts.
|
|