URL
https://opencores.org/ocsvn/openrisc/openrisc/trunk
Subversion Repositories openrisc
[/] [openrisc/] [trunk/] [rtos/] [rtems/] [scripts/] [README] - Rev 173
Compare with Previous | Blame | View Log
RPM support for BSPs====================Introduction------------Building an rpm requires to have a tar archive of the sources, and arpm-spec files specifying the details of building.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(mkspec) which generates one *.spec (rtems-<target_alias>-<bsp>.spec) per BSPbsp from an rpm-spec template (rtems.spec.in).A second shell script (mkrpms) is a convienience script which invokes asequence of building rpms for several bsps.mkbinutilspec-------------mkbinutilspec takes two arguments:$1 ... the target_alias for binutils RPMs of this toolsetInvoking mkbinutilspec will generate a <target_alias>-binutils.spec either in/usr/src/packages/SPECS (SuSE convention) or/usr/src/redhat/SPECS (Redhat convention) or/usr/src/SPECSEg. ./mkbinutilspec sparc-rtems generatesOn SuSE-6.2: /usr/src/packages/SPECS/sparc-rtems-binutils.specOn RedHat 6.0: /usr/src/redhat/SPECS/sparc-rtems-binutils.specmkgccnewlibspec---------------mkgccnewlibspec takes two arguments:$1 ... the target_alias for the gcc/newlib RPMs of this toolsetInvoking mkgccnewlibspec will generate a <target_alias>-gccnewlibs.speceither in:/usr/src/packages/SPECS (SuSE convention) or/usr/src/redhat/SPECS (Redhat convention) or/usr/src/SPECSEg. ./mkgccnewlibspec sparc-rtems generatesOn SuSE-6.2: /usr/src/packages/SPECS/sparc-rtems-gcc_newlib.specOn RedHat 6.0: /usr/src/redhat/SPECS/sparc-rtems-gcc_newlib.specmkgdbspec---------mkgdbspec takes two arguments:$1 ... the target_alias for the gdb RPMs of this toolsetInvoking mkgdbspec will generate a <target_alias>-gdb.speceither in:/usr/src/packages/SPECS (SuSE convention) or/usr/src/redhat/SPECS (Redhat convention) or/usr/src/SPECSEg. ./mkgdbspec sparc-rtems generatesOn SuSE-6.2: /usr/src/packages/SPECS/sparc-rtems-gcc_newlib.specOn RedHat 6.0: /usr/src/redhat/SPECS/sparc-rtems-gcc_newlib.spec# XXX BSPs not tested yet by Joel## mkbspspec# ---------## mkbspspec takes two arguments:# $1 ... the target_alias this bsp belongs to# $2 ... the bsp to be built## Invoking mkbspspec will generate a rtems-<target_alias>-<bsp>.spec either in# /usr/src/packages/SPECS (SuSE convention) or# /usr/src/redhat/SPECS (Redhat convention) or# /usr/src/SPECS## Eg. ./mkspec gensh1 sh-rtemself generates# /usr/src/packages/SPECS/rtems-sh-rtemself-gensh1.spec on SuSE-6.2.mkspec---------mkspec takes two arguments:$1 ... the target_alias for the RPMs composing this toolset$2 ... the bsp to be builtInvoking mkspec will generate a set of spec files either in:/usr/src/packages/SPECS (SuSE convention) or/usr/src/redhat/SPECS (Redhat convention) or/usr/src/SPECSEg. ./mkspec sparc-rtems erc32 generatesOn 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-gdb.specOn 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-gdb.specBuilding binutils-rpms----------------------0. Login as root.1. Install a tarball of the various tool sources (with theversion number attached!) to /usr/src/[packages|redhat]/SOURCEScd /usr/src/[packages|redhat]/SOURCEScp .../binutils-<VERSION> .cp .../binutils-<VERSION>-rtems-<DATE>.diff .2. Generate and install the required rpm-spec file[s]cd rtems-<VERSION>/scripts/mkbinutilspec <target_alias>where target_alias is of the form sparc-rtems or sh-rtems-elf.3. Build the rpmsBuilding a binary rpm:rpm -bb /usr/src/[packages|redhat]/SPECS/rtems-<target_alias>-binutils.specBuilding a source and binary rpmrpm -ba /usr/src/[packages|redhat]/SPECS/rtems-<target_alias>-binutils.specXXX Note: a BSP's src.rpm contains its spec-file and the tar-archive of thesources (approx. 4-5MB per BSP).Building TOOL-rpms------------------0. Login as root.1. Install a tarball of the various tool sources (with theversion number attached!) to /usr/src/[packages|redhat]/SOURCEScd /usr/src/[packages|redhat]/SOURCEScp .../binutils-<VERSION> .cp .../gcc-<VERSION> .cp .../newlib-<VERSION> .2. Generate and install the required rpm-spec file[s]cd rtems-<VERSION>/scripts/mktoolspec <target_alias>3. Build the rpmsBuilding a binary rpm:rpm -bb /usr/src/[packages|redhat]/SPECS/rtems-<target_alias>.specBuilding a source and binary rpmrpm -ba /usr/src/[packages|redhat]/SPECS/rtems-<target_alias>.specXXX Note: a BSP's src.rpm contains its spec-file and the tar-archive of thesources (approx. 4-5MB per BSP).Building BSP-rpms-----------------0. Login as root.1. Install a tarball of RTEMS's sources (with version number attached!) to/usr/src/[packages|redhat]/SOURCESEg.tar czvf /usr/src/packages/SOURCES/rtems-<VERSION>.tar.gz rtems-<VERSION>2. Generate and install the required rpm-spec file[s]cd rtems-<VERSION>/scripts/mkspec <bsp> <target_alias>3. Build the rpmsBuilding a binary rpm:rpm -bb /usr/src/[packages|redhat]/SPECS/rtems-<target_alias>-<bsp>.specBuilding a source and binary rpmrpm -ba /usr/src/[packages|redhat]/SPECS/rtems-<target_alias>-<bsp>.specNote: a BSP's src.rpm contains its spec-file and the tar-archive of thesources (approx. 4-5MB per BSP).Known Bugs/Deficiencies-----------------------* All files mentioned in here are in its early infancy ;-)* Building for a single bsp requires an own copy of the source tree insiderpm's build directory.* Building inside the RTEMS source tree doesn't work.* Dependencies on toolchain-rpms not yet supported in rtems.spec.in.* Installing multiple binary bsp rpms for the same target can causewarnings from rpm, because these bsp-rpms share files.* rtems.spec.in is prepared for rpm relocation support, but RTEMS is notrelocatible (yet?)* rtems.spec.in deserves to be extended (description, authors etc)* The final packaging stage to build a binary rpm takes an awful lot oftime - deserves to be investigated.* Some RTEMS's cross executables (eg. hello.exe for sparc-rtems/erc32) causewarnings from rpm and/or objdump. AFAIS, this is a bug in rpm.* Probably many more ...* Last but not least: RTEMS should be split.Remarks-------* It would make sense to split RTEMS host/cross-tools and files depending onthe target only (<target_alias>/make/*.cfg -- Whow, RTEMS really has fileswhich depend on the target only :) into separate rpms.* Instead of using a single rpm-spec for each bsp, RTEMS could also use asingle 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/usr/src/[packages|redhat]/BUILD. Therefore you will rather soon run out of discspace if not removing them. (Use rpm --clean -b[a|b] for cleaning them upautomatically after building)* The size of binary rpms can differ up to one magnitude depending on thetarget/bsp (eg. sh-rtems/gensh1 ~10MB vs. sh-rtemself/gensh1 ~32MB)Ralf Corsepius, 1999/10/14
