source: rtems/scripts/README @ 8c5e54b

4.104.114.84.95
Last change on this file since 8c5e54b was 8c5e54b, checked in by Joel Sherrill <joel.sherrill@…>, on Oct 18, 1999 at 7:10:03 PM

Working on being able to cut RPMs. It now appears that the process
is working mostly for sparc at least.

There is one major problem -- the current process generates a unique
source file per RPM when in fact all of the source files are nearly
the same -- it is only the spec part of the rpm which differs.
The new file mkbinutils_subpackage_version is an attempt to
address this. It does part of the job right -- one source file
produces multiple binary RPMs. BUT the end user can not produce
the resulting RPMS themselves from SRPMS unless they also
build all targets.

  • Property mode set to 100644
File size: 7.1 KB
Line 
1
2        RPM support for BSPs
3        ====================
4
5Introduction
6------------
7
8Building an rpm requires to have a tar archive of the sources, and a
9rpm-spec files specifying the details of building.
10
11To support per bsp rpms, one rpm-spec is used per BSP.
12Instead of writing one rpm-spec for each BSP, I have written a shell script
13(mkspec) which generates one *.spec (rtems-<target_alias>-<bsp>.spec) per BSP
14bsp from an rpm-spec template (rtems.spec.in).
15
16A second shell script (mkrpms) is a convienience script which invokes a
17sequence of building rpms for several bsps.
18
19
20mkbinutilspec
21-------------
22
23mkbinutilspec takes two arguments:
24
25$1 ... the target_alias for binutils RPMs of this toolset
26
27Invoking mkbinutilspec will generate a <target_alias>-binutils.spec either in
28
29    /usr/src/packages/SPECS (SuSE convention) or
30    /usr/src/redhat/SPECS (Redhat convention) or
31    /usr/src/SPECS
32
33Eg. ./mkbinutilspec sparc-rtems generates
34
35On SuSE-6.2:   /usr/src/packages/SPECS/sparc-rtems-binutils.spec
36On RedHat 6.0: /usr/src/redhat/SPECS/sparc-rtems-binutils.spec
37
38mkgccnewlibspec
39---------------
40
41mkgccnewlibspec takes two arguments:
42
43$1 ... the target_alias for the gcc/newlib RPMs of this toolset
44
45Invoking mkgccnewlibspec will generate a <target_alias>-gccnewlibs.spec
46either in:
47
48    /usr/src/packages/SPECS (SuSE convention) or
49    /usr/src/redhat/SPECS (Redhat convention) or
50    /usr/src/SPECS
51
52Eg. ./mkgccnewlibspec sparc-rtems generates
53
54On SuSE-6.2:   /usr/src/packages/SPECS/sparc-rtems-gcc_newlib.spec
55On RedHat 6.0: /usr/src/redhat/SPECS/sparc-rtems-gcc_newlib.spec
56
57mkgdbspec
58---------
59
60mkgdbspec takes two arguments:
61
62$1 ... the target_alias for the gdb RPMs of this toolset
63
64Invoking mkgdbspec will generate a <target_alias>-gdb.spec
65either in:
66
67    /usr/src/packages/SPECS (SuSE convention) or
68    /usr/src/redhat/SPECS (Redhat convention) or
69    /usr/src/SPECS
70
71Eg. ./mkgdbspec sparc-rtems generates
72
73On SuSE-6.2:   /usr/src/packages/SPECS/sparc-rtems-gcc_newlib.spec
74On RedHat 6.0: /usr/src/redhat/SPECS/sparc-rtems-gcc_newlib.spec
75
76
77# XXX BSPs not tested yet by Joel
78#
79#  mkbspspec
80#  ---------
81
82#  mkbspspec takes two arguments:
83#  $1 ... the target_alias this bsp belongs to
84#  $2 ... the bsp to be built
85
86#  Invoking mkbspspec will generate a rtems-<target_alias>-<bsp>.spec either in
87#  /usr/src/packages/SPECS (SuSE convention) or
88#  /usr/src/redhat/SPECS (Redhat convention) or
89#  /usr/src/SPECS
90
91#  Eg. ./mkspec gensh1 sh-rtemself generates
92#  /usr/src/packages/SPECS/rtems-sh-rtemself-gensh1.spec on SuSE-6.2.
93
94mkspec
95---------
96
97mkspec takes two arguments:
98
99$1 ... the target_alias for the RPMs composing this toolset
100$2 ... the bsp to be built
101
102Invoking mkspec will generate a set of spec files either in:
103
104    /usr/src/packages/SPECS (SuSE convention) or
105    /usr/src/redhat/SPECS (Redhat convention) or
106    /usr/src/SPECS
107
108Eg. ./mkspec sparc-rtems erc32 generates
109
110On SuSE-6.2:   /usr/src/packages/SPECS/sparc-rtems-binutils.spec
111               /usr/src/packages/SPECS/sparc-rtems-gcc_newlib.spec
112               /usr/src/packages/SPECS/sparc-rtems-gdb.spec
113On RedHat 6.0: /usr/src/packages/SPECS/sparc-rtems-binutils.spec
114               /usr/src/packages/SPECS/sparc-rtems-gcc_newlib.spec
115               /usr/src/packages/SPECS/sparc-rtems-gdb.spec
116
117
118Building binutils-rpms
119----------------------
120
1210. Login as root.
122
1231. Install a tarball of the various tool sources (with the
124version number attached!) to /usr/src/[packages|redhat]/SOURCES
125
126  cd /usr/src/[packages|redhat]/SOURCES
127  cp .../binutils-<VERSION>  .
128  cp .../binutils-<VERSION>-rtems-<DATE>.diff  .
129
1302. Generate and install the required rpm-spec file[s]
131
132cd rtems-<VERSION>/scripts/
133mkbinutilspec <target_alias>
134
135where target_alias is of the form sparc-rtems or sh-rtems-elf.
136
1373. Build the rpms
138
139Building a binary rpm:
140
141rpm -bb /usr/src/[packages|redhat]/SPECS/rtems-<target_alias>-binutils.spec
142
143Building a source and binary rpm
144rpm -ba /usr/src/[packages|redhat]/SPECS/rtems-<target_alias>-binutils.spec
145
146XXX Note: a BSP's src.rpm contains its spec-file and the tar-archive of the
147sources (approx. 4-5MB per BSP).
148
149Building TOOL-rpms
150------------------
151
1520. Login as root.
153
1541. Install a tarball of the various tool sources (with the
155version number attached!) to /usr/src/[packages|redhat]/SOURCES
156
157  cd /usr/src/[packages|redhat]/SOURCES
158  cp .../binutils-<VERSION>  .
159  cp .../gcc-<VERSION>       .
160  cp .../newlib-<VERSION>    .
161
1622. Generate and install the required rpm-spec file[s]
163
164cd rtems-<VERSION>/scripts/
165mktoolspec <target_alias>
166
1673. Build the rpms
168
169Building a binary rpm:
170rpm -bb /usr/src/[packages|redhat]/SPECS/rtems-<target_alias>.spec
171
172Building a source and binary rpm
173rpm -ba /usr/src/[packages|redhat]/SPECS/rtems-<target_alias>.spec
174
175XXX Note: a BSP's src.rpm contains its spec-file and the tar-archive of the
176sources (approx. 4-5MB per BSP).
177
178Building BSP-rpms
179-----------------
180
1810. Login as root.
182
1831. Install a tarball of RTEMS's sources (with version number attached!) to
184/usr/src/[packages|redhat]/SOURCES
185Eg.
186tar czvf /usr/src/packages/SOURCES/rtems-<VERSION>.tar.gz rtems-<VERSION>
187
1882. Generate and install the required rpm-spec file[s]
189cd rtems-<VERSION>/scripts/
190mkspec <bsp> <target_alias>
191
1923. Build the rpms
193Building a binary rpm:
194rpm -bb /usr/src/[packages|redhat]/SPECS/rtems-<target_alias>-<bsp>.spec
195
196Building a source and binary rpm
197rpm -ba /usr/src/[packages|redhat]/SPECS/rtems-<target_alias>-<bsp>.spec
198
199Note: a BSP's src.rpm contains its spec-file and the tar-archive of the
200sources (approx. 4-5MB per BSP).
201
202Known Bugs/Deficiencies
203-----------------------
204
205* All files mentioned in here are in its early infancy ;-)
206
207* Building for a single bsp requires an own copy of the source tree inside
208rpm's build directory.
209* Building inside the RTEMS source tree doesn't work.
210* Dependencies on toolchain-rpms not yet supported in rtems.spec.in.
211* Installing multiple binary bsp rpms for the same target can cause
212warnings from rpm, because these bsp-rpms share files.
213* rtems.spec.in is prepared for rpm relocation support, but RTEMS is not
214relocatible (yet?)
215* rtems.spec.in deserves to be extended (description, authors etc)
216* The final packaging stage to build a binary rpm takes an awful lot of
217time - deserves to be investigated.
218* Some RTEMS's cross executables (eg. hello.exe for sparc-rtems/erc32) cause
219warnings from rpm and/or objdump. AFAIS, this is a bug in rpm.
220* Probably many more ...
221
222* Last but not least: RTEMS should be split.
223
224Remarks
225-------
226* It would make sense to split RTEMS host/cross-tools and files depending on
227the target only (<target_alias>/make/*.cfg -- Whow, RTEMS really has files
228which depend on the target only :) into separate rpms.
229* Instead of using a single rpm-spec for each bsp, RTEMS could also use a
230single rpm-spec for all (or at least a given subset of all) bsps of a target.
231* rpm -b[b|a] leaves its built trees unpacked in
232/usr/src/[packages|redhat]/BUILD. Therefore you will rather soon run out of disc
233space if not removing them. (Use rpm --clean -b[a|b] for cleaning them up
234automatically after building)
235* The size of binary rpms can differ up to one magnitude depending on the
236target/bsp (eg. sh-rtems/gensh1 ~10MB vs. sh-rtemself/gensh1 ~32MB)
237
238Ralf Corsepius, 1999/10/14
Note: See TracBrowser for help on using the repository browser.