1 |
1026 |
ivang |
|
2 |
|
|
RPM support for BSPs
|
3 |
|
|
====================
|
4 |
|
|
|
5 |
|
|
Introduction
|
6 |
|
|
------------
|
7 |
|
|
|
8 |
|
|
Building an rpm requires to have a tar archive of the sources, and a
|
9 |
|
|
rpm-spec files specifying the details of building.
|
10 |
|
|
|
11 |
|
|
To support per bsp rpms, one rpm-spec is used per BSP.
|
12 |
|
|
Instead of writing one rpm-spec for each BSP, I have written a shell script
|
13 |
|
|
(mkspec) which generates one *.spec (rtems--.spec) per BSP
|
14 |
|
|
bsp from an rpm-spec template (rtems.spec.in).
|
15 |
|
|
|
16 |
|
|
A second shell script (mkrpms) is a convienience script which invokes a
|
17 |
|
|
sequence of building rpms for several bsps.
|
18 |
|
|
|
19 |
|
|
|
20 |
|
|
mkbinutilspec
|
21 |
|
|
-------------
|
22 |
|
|
|
23 |
|
|
mkbinutilspec takes two arguments:
|
24 |
|
|
|
25 |
|
|
$1 ... the target_alias for binutils RPMs of this toolset
|
26 |
|
|
|
27 |
|
|
Invoking mkbinutilspec will generate a -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 |
|
|
|
33 |
|
|
Eg. ./mkbinutilspec sparc-rtems generates
|
34 |
|
|
|
35 |
|
|
On SuSE-6.2: /usr/src/packages/SPECS/sparc-rtems-binutils.spec
|
36 |
|
|
On RedHat 6.0: /usr/src/redhat/SPECS/sparc-rtems-binutils.spec
|
37 |
|
|
|
38 |
|
|
mkgccnewlibspec
|
39 |
|
|
---------------
|
40 |
|
|
|
41 |
|
|
mkgccnewlibspec takes two arguments:
|
42 |
|
|
|
43 |
|
|
$1 ... the target_alias for the gcc/newlib RPMs of this toolset
|
44 |
|
|
|
45 |
|
|
Invoking mkgccnewlibspec will generate a -gccnewlibs.spec
|
46 |
|
|
either in:
|
47 |
|
|
|
48 |
|
|
/usr/src/packages/SPECS (SuSE convention) or
|
49 |
|
|
/usr/src/redhat/SPECS (Redhat convention) or
|
50 |
|
|
/usr/src/SPECS
|
51 |
|
|
|
52 |
|
|
Eg. ./mkgccnewlibspec sparc-rtems generates
|
53 |
|
|
|
54 |
|
|
On SuSE-6.2: /usr/src/packages/SPECS/sparc-rtems-gcc_newlib.spec
|
55 |
|
|
On RedHat 6.0: /usr/src/redhat/SPECS/sparc-rtems-gcc_newlib.spec
|
56 |
|
|
|
57 |
|
|
mkgdbspec
|
58 |
|
|
---------
|
59 |
|
|
|
60 |
|
|
mkgdbspec takes two arguments:
|
61 |
|
|
|
62 |
|
|
$1 ... the target_alias for the gdb RPMs of this toolset
|
63 |
|
|
|
64 |
|
|
Invoking mkgdbspec will generate a -gdb.spec
|
65 |
|
|
either in:
|
66 |
|
|
|
67 |
|
|
/usr/src/packages/SPECS (SuSE convention) or
|
68 |
|
|
/usr/src/redhat/SPECS (Redhat convention) or
|
69 |
|
|
/usr/src/SPECS
|
70 |
|
|
|
71 |
|
|
Eg. ./mkgdbspec sparc-rtems generates
|
72 |
|
|
|
73 |
|
|
On SuSE-6.2: /usr/src/packages/SPECS/sparc-rtems-gcc_newlib.spec
|
74 |
|
|
On 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--.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 |
|
|
|
94 |
|
|
mkspec
|
95 |
|
|
---------
|
96 |
|
|
|
97 |
|
|
mkspec takes two arguments:
|
98 |
|
|
|
99 |
|
|
$1 ... the target_alias for the RPMs composing this toolset
|
100 |
|
|
$2 ... the bsp to be built
|
101 |
|
|
|
102 |
|
|
Invoking 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 |
|
|
|
108 |
|
|
Eg. ./mkspec sparc-rtems erc32 generates
|
109 |
|
|
|
110 |
|
|
On 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
|
113 |
|
|
On 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 |
|
|
|
118 |
|
|
Building binutils-rpms
|
119 |
|
|
----------------------
|
120 |
|
|
|
121 |
|
|
0. Login as root.
|
122 |
|
|
|
123 |
|
|
1. Install a tarball of the various tool sources (with the
|
124 |
|
|
version number attached!) to /usr/src/[packages|redhat]/SOURCES
|
125 |
|
|
|
126 |
|
|
cd /usr/src/[packages|redhat]/SOURCES
|
127 |
|
|
cp .../binutils- .
|
128 |
|
|
cp .../binutils--rtems-.diff .
|
129 |
|
|
|
130 |
|
|
2. Generate and install the required rpm-spec file[s]
|
131 |
|
|
|
132 |
|
|
cd rtems-/scripts/
|
133 |
|
|
mkbinutilspec
|
134 |
|
|
|
135 |
|
|
where target_alias is of the form sparc-rtems or sh-rtems-elf.
|
136 |
|
|
|
137 |
|
|
3. Build the rpms
|
138 |
|
|
|
139 |
|
|
Building a binary rpm:
|
140 |
|
|
|
141 |
|
|
rpm -bb /usr/src/[packages|redhat]/SPECS/rtems--binutils.spec
|
142 |
|
|
|
143 |
|
|
Building a source and binary rpm
|
144 |
|
|
rpm -ba /usr/src/[packages|redhat]/SPECS/rtems--binutils.spec
|
145 |
|
|
|
146 |
|
|
XXX Note: a BSP's src.rpm contains its spec-file and the tar-archive of the
|
147 |
|
|
sources (approx. 4-5MB per BSP).
|
148 |
|
|
|
149 |
|
|
Building TOOL-rpms
|
150 |
|
|
------------------
|
151 |
|
|
|
152 |
|
|
0. Login as root.
|
153 |
|
|
|
154 |
|
|
1. Install a tarball of the various tool sources (with the
|
155 |
|
|
version number attached!) to /usr/src/[packages|redhat]/SOURCES
|
156 |
|
|
|
157 |
|
|
cd /usr/src/[packages|redhat]/SOURCES
|
158 |
|
|
cp .../binutils- .
|
159 |
|
|
cp .../gcc- .
|
160 |
|
|
cp .../newlib- .
|
161 |
|
|
|
162 |
|
|
2. Generate and install the required rpm-spec file[s]
|
163 |
|
|
|
164 |
|
|
cd rtems-/scripts/
|
165 |
|
|
mktoolspec
|
166 |
|
|
|
167 |
|
|
3. Build the rpms
|
168 |
|
|
|
169 |
|
|
Building a binary rpm:
|
170 |
|
|
rpm -bb /usr/src/[packages|redhat]/SPECS/rtems-.spec
|
171 |
|
|
|
172 |
|
|
Building a source and binary rpm
|
173 |
|
|
rpm -ba /usr/src/[packages|redhat]/SPECS/rtems-.spec
|
174 |
|
|
|
175 |
|
|
XXX Note: a BSP's src.rpm contains its spec-file and the tar-archive of the
|
176 |
|
|
sources (approx. 4-5MB per BSP).
|
177 |
|
|
|
178 |
|
|
Building BSP-rpms
|
179 |
|
|
-----------------
|
180 |
|
|
|
181 |
|
|
0. Login as root.
|
182 |
|
|
|
183 |
|
|
1. Install a tarball of RTEMS's sources (with version number attached!) to
|
184 |
|
|
/usr/src/[packages|redhat]/SOURCES
|
185 |
|
|
Eg.
|
186 |
|
|
tar czvf /usr/src/packages/SOURCES/rtems-.tar.gz rtems-
|
187 |
|
|
|
188 |
|
|
2. Generate and install the required rpm-spec file[s]
|
189 |
|
|
cd rtems-/scripts/
|
190 |
|
|
mkspec
|
191 |
|
|
|
192 |
|
|
3. Build the rpms
|
193 |
|
|
Building a binary rpm:
|
194 |
|
|
rpm -bb /usr/src/[packages|redhat]/SPECS/rtems--.spec
|
195 |
|
|
|
196 |
|
|
Building a source and binary rpm
|
197 |
|
|
rpm -ba /usr/src/[packages|redhat]/SPECS/rtems--.spec
|
198 |
|
|
|
199 |
|
|
Note: a BSP's src.rpm contains its spec-file and the tar-archive of the
|
200 |
|
|
sources (approx. 4-5MB per BSP).
|
201 |
|
|
|
202 |
|
|
Canadian Cross RPMS
|
203 |
|
|
-------------------
|
204 |
|
|
Normally one uses a GNU/Linux host computer to produce RPMs that are
|
205 |
|
|
to be installed and run on another GNU/Linux host computer. When
|
206 |
|
|
building Canadian Cross RPMs, we build *-rtems tools that are to be
|
207 |
|
|
installed on a non-GNU/Linux host.
|
208 |
|
|
|
209 |
|
|
To build cygwin-rpms on a GNU/Linux host, you will to have a GNU/Linux ->
|
210 |
|
|
i386-cygwin cross-toolset installed and in your PATH before executing the
|
211 |
|
|
following commands:
|
212 |
|
|
|
213 |
|
|
cd scripts
|
214 |
|
|
./configure --build=`../config.guess` --host=i386-cygwin \
|
215 |
|
|
--target=
|
216 |
|
|
make
|
217 |
|
|
rpm --target= -b[b|a] binutils/-....spec
|
218 |
|
|
|
219 |
|
|
Known Bugs/Deficiencies
|
220 |
|
|
-----------------------
|
221 |
|
|
|
222 |
|
|
* All files mentioned in here are in its early infancy ;-)
|
223 |
|
|
|
224 |
|
|
* Building for a single bsp requires an own copy of the source tree inside
|
225 |
|
|
rpm's build directory.
|
226 |
|
|
* Building inside the RTEMS source tree doesn't work.
|
227 |
|
|
* Dependencies on toolchain-rpms not yet supported in rtems.spec.in.
|
228 |
|
|
* Installing multiple binary bsp rpms for the same target can cause
|
229 |
|
|
warnings from rpm, because these bsp-rpms share files.
|
230 |
|
|
* rtems.spec.in is prepared for rpm relocation support, but RTEMS is not
|
231 |
|
|
relocatible (yet?)
|
232 |
|
|
* rtems.spec.in deserves to be extended (description, authors etc)
|
233 |
|
|
* The final packaging stage to build a binary rpm takes an awful lot of
|
234 |
|
|
time - deserves to be investigated.
|
235 |
|
|
* Some RTEMS's cross executables (eg. hello.exe for sparc-rtems/erc32) cause
|
236 |
|
|
warnings from rpm and/or objdump. AFAIS, this is a bug in rpm.
|
237 |
|
|
* Probably many more ...
|
238 |
|
|
|
239 |
|
|
* Last but not least: RTEMS should be split.
|
240 |
|
|
|
241 |
|
|
Remarks
|
242 |
|
|
-------
|
243 |
|
|
* It would make sense to split RTEMS host/cross-tools and files depending on
|
244 |
|
|
the target only (/make/*.cfg -- Whow, RTEMS really has files
|
245 |
|
|
which depend on the target only :) into separate rpms.
|
246 |
|
|
* Instead of using a single rpm-spec for each bsp, RTEMS could also use a
|
247 |
|
|
single rpm-spec for all (or at least a given subset of all) bsps of a target.
|
248 |
|
|
* rpm -b[b|a] leaves its built trees unpacked in
|
249 |
|
|
/usr/src/[packages|redhat]/BUILD. Therefore you will rather soon run out of disc
|
250 |
|
|
space if not removing them. (Use rpm --clean -b[a|b] for cleaning them up
|
251 |
|
|
automatically after building)
|
252 |
|
|
* The size of binary rpms can differ up to one magnitude depending on the
|
253 |
|
|
target/bsp (eg. sh-rtems/gensh1 ~10MB vs. sh-rtemself/gensh1 ~32MB)
|
254 |
|
|
|
255 |
|
|
Ralf Corsepius, 1999/10/14
|