OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [rtems-20020807/] [scripts/] [README] - Diff between revs 1026 and 1765

Go to most recent revision | Only display areas with differences | Details | Blame | View Log

Rev 1026 Rev 1765
        RPM support for BSPs
        RPM support for BSPs
        ====================
        ====================
Introduction
Introduction
------------
------------
Building an rpm requires to have a tar archive of the sources, and a
Building an rpm requires to have a tar archive of the sources, and a
rpm-spec files specifying the details of building.
rpm-spec files specifying the details of building.
To support per bsp rpms, one rpm-spec is used per BSP.
To support per bsp rpms, one rpm-spec is used per BSP.
Instead of writing one rpm-spec for each BSP, I have written a shell script
Instead of writing one rpm-spec for each BSP, I have written a shell script
(mkspec) which generates one *.spec (rtems--.spec) per BSP
(mkspec) which generates one *.spec (rtems--.spec) per BSP
bsp from an rpm-spec template (rtems.spec.in).
bsp from an rpm-spec template (rtems.spec.in).
A second shell script (mkrpms) is a convienience script which invokes a
A second shell script (mkrpms) is a convienience script which invokes a
sequence of building rpms for several bsps.
sequence of building rpms for several bsps.
mkbinutilspec
mkbinutilspec
-------------
-------------
mkbinutilspec takes two arguments:
mkbinutilspec takes two arguments:
$1 ... the target_alias for binutils RPMs of this toolset
$1 ... the target_alias for binutils RPMs of this toolset
Invoking mkbinutilspec will generate a -binutils.spec either in
Invoking mkbinutilspec will generate a -binutils.spec either in
    /usr/src/packages/SPECS (SuSE convention) or
    /usr/src/packages/SPECS (SuSE convention) or
    /usr/src/redhat/SPECS (Redhat convention) or
    /usr/src/redhat/SPECS (Redhat convention) or
    /usr/src/SPECS
    /usr/src/SPECS
Eg. ./mkbinutilspec sparc-rtems generates
Eg. ./mkbinutilspec sparc-rtems generates
On SuSE-6.2:   /usr/src/packages/SPECS/sparc-rtems-binutils.spec
On SuSE-6.2:   /usr/src/packages/SPECS/sparc-rtems-binutils.spec
On RedHat 6.0: /usr/src/redhat/SPECS/sparc-rtems-binutils.spec
On RedHat 6.0: /usr/src/redhat/SPECS/sparc-rtems-binutils.spec
mkgccnewlibspec
mkgccnewlibspec
---------------
---------------
mkgccnewlibspec takes two arguments:
mkgccnewlibspec takes two arguments:
$1 ... the target_alias for the gcc/newlib RPMs of this toolset
$1 ... the target_alias for the gcc/newlib RPMs of this toolset
Invoking mkgccnewlibspec will generate a -gccnewlibs.spec
Invoking mkgccnewlibspec will generate a -gccnewlibs.spec
either in:
either in:
    /usr/src/packages/SPECS (SuSE convention) or
    /usr/src/packages/SPECS (SuSE convention) or
    /usr/src/redhat/SPECS (Redhat convention) or
    /usr/src/redhat/SPECS (Redhat convention) or
    /usr/src/SPECS
    /usr/src/SPECS
Eg. ./mkgccnewlibspec sparc-rtems generates
Eg. ./mkgccnewlibspec sparc-rtems generates
On SuSE-6.2:   /usr/src/packages/SPECS/sparc-rtems-gcc_newlib.spec
On SuSE-6.2:   /usr/src/packages/SPECS/sparc-rtems-gcc_newlib.spec
On RedHat 6.0: /usr/src/redhat/SPECS/sparc-rtems-gcc_newlib.spec
On RedHat 6.0: /usr/src/redhat/SPECS/sparc-rtems-gcc_newlib.spec
mkgdbspec
mkgdbspec
---------
---------
mkgdbspec takes two arguments:
mkgdbspec takes two arguments:
$1 ... the target_alias for the gdb RPMs of this toolset
$1 ... the target_alias for the gdb RPMs of this toolset
Invoking mkgdbspec will generate a -gdb.spec
Invoking mkgdbspec will generate a -gdb.spec
either in:
either in:
    /usr/src/packages/SPECS (SuSE convention) or
    /usr/src/packages/SPECS (SuSE convention) or
    /usr/src/redhat/SPECS (Redhat convention) or
    /usr/src/redhat/SPECS (Redhat convention) or
    /usr/src/SPECS
    /usr/src/SPECS
Eg. ./mkgdbspec sparc-rtems generates
Eg. ./mkgdbspec sparc-rtems generates
On SuSE-6.2:   /usr/src/packages/SPECS/sparc-rtems-gcc_newlib.spec
On SuSE-6.2:   /usr/src/packages/SPECS/sparc-rtems-gcc_newlib.spec
On RedHat 6.0: /usr/src/redhat/SPECS/sparc-rtems-gcc_newlib.spec
On RedHat 6.0: /usr/src/redhat/SPECS/sparc-rtems-gcc_newlib.spec
# XXX BSPs not tested yet by Joel
# XXX BSPs not tested yet by Joel
#
#
#  mkbspspec
#  mkbspspec
#  ---------
#  ---------
#
#
#  mkbspspec takes two arguments:
#  mkbspspec takes two arguments:
#  $1 ... the target_alias this bsp belongs to
#  $1 ... the target_alias this bsp belongs to
#  $2 ... the bsp to be built
#  $2 ... the bsp to be built
#
#
#  Invoking mkbspspec will generate a rtems--.spec either in
#  Invoking mkbspspec will generate a rtems--.spec either in
#  /usr/src/packages/SPECS (SuSE convention) or
#  /usr/src/packages/SPECS (SuSE convention) or
#  /usr/src/redhat/SPECS (Redhat convention) or
#  /usr/src/redhat/SPECS (Redhat convention) or
#  /usr/src/SPECS
#  /usr/src/SPECS
#
#
#  Eg. ./mkspec gensh1 sh-rtemself generates
#  Eg. ./mkspec gensh1 sh-rtemself generates
#  /usr/src/packages/SPECS/rtems-sh-rtemself-gensh1.spec on SuSE-6.2.
#  /usr/src/packages/SPECS/rtems-sh-rtemself-gensh1.spec on SuSE-6.2.
mkspec
mkspec
---------
---------
mkspec takes two arguments:
mkspec takes two arguments:
$1 ... the target_alias for the RPMs composing this toolset
$1 ... the target_alias for the RPMs composing this toolset
$2 ... the bsp to be built
$2 ... the bsp to be built
Invoking mkspec will generate a set of spec files either in:
Invoking mkspec will generate a set of spec files either in:
    /usr/src/packages/SPECS (SuSE convention) or
    /usr/src/packages/SPECS (SuSE convention) or
    /usr/src/redhat/SPECS (Redhat convention) or
    /usr/src/redhat/SPECS (Redhat convention) or
    /usr/src/SPECS
    /usr/src/SPECS
Eg. ./mkspec sparc-rtems erc32 generates
Eg. ./mkspec sparc-rtems erc32 generates
On SuSE-6.2:   /usr/src/packages/SPECS/sparc-rtems-binutils.spec
On SuSE-6.2:   /usr/src/packages/SPECS/sparc-rtems-binutils.spec
               /usr/src/packages/SPECS/sparc-rtems-gcc_newlib.spec
               /usr/src/packages/SPECS/sparc-rtems-gcc_newlib.spec
               /usr/src/packages/SPECS/sparc-rtems-gdb.spec
               /usr/src/packages/SPECS/sparc-rtems-gdb.spec
On RedHat 6.0: /usr/src/packages/SPECS/sparc-rtems-binutils.spec
On RedHat 6.0: /usr/src/packages/SPECS/sparc-rtems-binutils.spec
               /usr/src/packages/SPECS/sparc-rtems-gcc_newlib.spec
               /usr/src/packages/SPECS/sparc-rtems-gcc_newlib.spec
               /usr/src/packages/SPECS/sparc-rtems-gdb.spec
               /usr/src/packages/SPECS/sparc-rtems-gdb.spec
Building binutils-rpms
Building binutils-rpms
----------------------
----------------------
0. Login as root.
0. Login as root.
1. Install a tarball of the various tool sources (with the
1. Install a tarball of the various tool sources (with the
version number attached!) to /usr/src/[packages|redhat]/SOURCES
version number attached!) to /usr/src/[packages|redhat]/SOURCES
  cd /usr/src/[packages|redhat]/SOURCES
  cd /usr/src/[packages|redhat]/SOURCES
  cp .../binutils-  .
  cp .../binutils-  .
  cp .../binutils--rtems-.diff  .
  cp .../binutils--rtems-.diff  .
2. Generate and install the required rpm-spec file[s]
2. Generate and install the required rpm-spec file[s]
cd rtems-/scripts/
cd rtems-/scripts/
mkbinutilspec 
mkbinutilspec 
where target_alias is of the form sparc-rtems or sh-rtems-elf.
where target_alias is of the form sparc-rtems or sh-rtems-elf.
3. Build the rpms
3. Build the rpms
Building a binary rpm:
Building a binary rpm:
rpm -bb /usr/src/[packages|redhat]/SPECS/rtems--binutils.spec
rpm -bb /usr/src/[packages|redhat]/SPECS/rtems--binutils.spec
Building a source and binary rpm
Building a source and binary rpm
rpm -ba /usr/src/[packages|redhat]/SPECS/rtems--binutils.spec
rpm -ba /usr/src/[packages|redhat]/SPECS/rtems--binutils.spec
XXX Note: a BSP's src.rpm contains its spec-file and the tar-archive of the
XXX Note: a BSP's src.rpm contains its spec-file and the tar-archive of the
sources (approx. 4-5MB per BSP).
sources (approx. 4-5MB per BSP).
Building TOOL-rpms
Building TOOL-rpms
------------------
------------------
0. Login as root.
0. Login as root.
1. Install a tarball of the various tool sources (with the
1. Install a tarball of the various tool sources (with the
version number attached!) to /usr/src/[packages|redhat]/SOURCES
version number attached!) to /usr/src/[packages|redhat]/SOURCES
  cd /usr/src/[packages|redhat]/SOURCES
  cd /usr/src/[packages|redhat]/SOURCES
  cp .../binutils-  .
  cp .../binutils-  .
  cp .../gcc-       .
  cp .../gcc-       .
  cp .../newlib-    .
  cp .../newlib-    .
2. Generate and install the required rpm-spec file[s]
2. Generate and install the required rpm-spec file[s]
cd rtems-/scripts/
cd rtems-/scripts/
mktoolspec 
mktoolspec 
3. Build the rpms
3. Build the rpms
Building a binary rpm:
Building a binary rpm:
rpm -bb /usr/src/[packages|redhat]/SPECS/rtems-.spec
rpm -bb /usr/src/[packages|redhat]/SPECS/rtems-.spec
Building a source and binary rpm
Building a source and binary rpm
rpm -ba /usr/src/[packages|redhat]/SPECS/rtems-.spec
rpm -ba /usr/src/[packages|redhat]/SPECS/rtems-.spec
XXX Note: a BSP's src.rpm contains its spec-file and the tar-archive of the
XXX Note: a BSP's src.rpm contains its spec-file and the tar-archive of the
sources (approx. 4-5MB per BSP).
sources (approx. 4-5MB per BSP).
Building BSP-rpms
Building BSP-rpms
-----------------
-----------------
0. Login as root.
0. Login as root.
1. Install a tarball of RTEMS's sources (with version number attached!) to
1. Install a tarball of RTEMS's sources (with version number attached!) to
/usr/src/[packages|redhat]/SOURCES
/usr/src/[packages|redhat]/SOURCES
Eg.
Eg.
tar czvf /usr/src/packages/SOURCES/rtems-.tar.gz rtems-
tar czvf /usr/src/packages/SOURCES/rtems-.tar.gz rtems-
2. Generate and install the required rpm-spec file[s]
2. Generate and install the required rpm-spec file[s]
cd rtems-/scripts/
cd rtems-/scripts/
mkspec  
mkspec  
3. Build the rpms
3. Build the rpms
Building a binary rpm:
Building a binary rpm:
rpm -bb /usr/src/[packages|redhat]/SPECS/rtems--.spec
rpm -bb /usr/src/[packages|redhat]/SPECS/rtems--.spec
Building a source and binary rpm
Building a source and binary rpm
rpm -ba /usr/src/[packages|redhat]/SPECS/rtems--.spec
rpm -ba /usr/src/[packages|redhat]/SPECS/rtems--.spec
Note: a BSP's src.rpm contains its spec-file and the tar-archive of the
Note: a BSP's src.rpm contains its spec-file and the tar-archive of the
sources (approx. 4-5MB per BSP).
sources (approx. 4-5MB per BSP).
Canadian Cross RPMS
Canadian Cross RPMS
-------------------
-------------------
Normally one uses a GNU/Linux host computer to produce RPMs that are
Normally one uses a GNU/Linux host computer to produce RPMs that are
to be installed and run on another GNU/Linux host computer.  When
to be installed and run on another GNU/Linux host computer.  When
building Canadian Cross RPMs, we build *-rtems tools that are to be
building Canadian Cross RPMs, we build *-rtems tools that are to be
installed on a non-GNU/Linux host.
installed on a non-GNU/Linux host.
To build cygwin-rpms on a GNU/Linux host, you will to have a GNU/Linux ->
To build cygwin-rpms on a GNU/Linux host, you will to have a GNU/Linux ->
i386-cygwin cross-toolset installed and in your PATH before executing the
i386-cygwin cross-toolset installed and in your PATH before executing the
following commands:
following commands:
  cd scripts
  cd scripts
  ./configure --build=`../config.guess` --host=i386-cygwin \
  ./configure --build=`../config.guess` --host=i386-cygwin \
    --target=
    --target=
  make
  make
  rpm --target= -b[b|a] binutils/-....spec
  rpm --target= -b[b|a] binutils/-....spec
Known Bugs/Deficiencies
Known Bugs/Deficiencies
-----------------------
-----------------------
* All files mentioned in here are in its early infancy ;-)
* All files mentioned in here are in its early infancy ;-)
* Building for a single bsp requires an own copy of the source tree inside
* Building for a single bsp requires an own copy of the source tree inside
rpm's build directory.
rpm's build directory.
* Building inside the RTEMS source tree doesn't work.
* Building inside the RTEMS source tree doesn't work.
* Dependencies on toolchain-rpms not yet supported in rtems.spec.in.
* Dependencies on toolchain-rpms not yet supported in rtems.spec.in.
* Installing multiple binary bsp rpms for the same target can cause
* Installing multiple binary bsp rpms for the same target can cause
warnings from rpm, because these bsp-rpms share files.
warnings from rpm, because these bsp-rpms share files.
* rtems.spec.in is prepared for rpm relocation support, but RTEMS is not
* rtems.spec.in is prepared for rpm relocation support, but RTEMS is not
relocatible (yet?)
relocatible (yet?)
* rtems.spec.in deserves to be extended (description, authors etc)
* rtems.spec.in deserves to be extended (description, authors etc)
* The final packaging stage to build a binary rpm takes an awful lot of
* The final packaging stage to build a binary rpm takes an awful lot of
time - deserves to be investigated.
time - deserves to be investigated.
* Some RTEMS's cross executables (eg. hello.exe for sparc-rtems/erc32) cause
* Some RTEMS's cross executables (eg. hello.exe for sparc-rtems/erc32) cause
warnings from rpm and/or objdump. AFAIS, this is a bug in rpm.
warnings from rpm and/or objdump. AFAIS, this is a bug in rpm.
* Probably many more ...
* Probably many more ...
* Last but not least: RTEMS should be split.
* Last but not least: RTEMS should be split.
Remarks
Remarks
-------
-------
* It would make sense to split RTEMS host/cross-tools and files depending on
* It would make sense to split RTEMS host/cross-tools and files depending on
the target only (/make/*.cfg -- Whow, RTEMS really has files
the target only (/make/*.cfg -- Whow, RTEMS really has files
which depend on the target only :) into separate rpms.
which depend on the target only :) into separate rpms.
* Instead of using a single rpm-spec for each bsp, RTEMS could also use a
* Instead of using a single rpm-spec for each bsp, RTEMS could also use a
single rpm-spec for all (or at least a given subset of all) bsps of a target.
single rpm-spec for all (or at least a given subset of all) bsps of a target.
* rpm -b[b|a] leaves its built trees unpacked in
* rpm -b[b|a] leaves its built trees unpacked in
/usr/src/[packages|redhat]/BUILD. Therefore you will rather soon run out of disc
/usr/src/[packages|redhat]/BUILD. Therefore you will rather soon run out of disc
space if not removing them. (Use rpm --clean -b[a|b] for cleaning them up
space if not removing them. (Use rpm --clean -b[a|b] for cleaning them up
automatically after building)
automatically after building)
* The size of binary rpms can differ up to one magnitude depending on the
* The size of binary rpms can differ up to one magnitude depending on the
target/bsp (eg. sh-rtems/gensh1 ~10MB vs. sh-rtemself/gensh1 ~32MB)
target/bsp (eg. sh-rtems/gensh1 ~10MB vs. sh-rtemself/gensh1 ~32MB)
Ralf Corsepius, 1999/10/14
Ralf Corsepius, 1999/10/14
 
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.