-
Notifications
You must be signed in to change notification settings - Fork 1
/
openMosix-RPM-Build.sgml
176 lines (150 loc) · 5.14 KB
/
openMosix-RPM-Build.sgml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
<appendix id="rpm"><title>How to produce openMosix's Kernel RPM files</title>
<sect1>
<title>How to produce openMosix's Kernel RPM files</title>
<para>
A step-by-step guide for the dumb release manager and the adventurous
"do it yourself" RPM packager , by Mirko Caserta
</para>
<orderedlist>
<listitem><para>Install a RedHat 8 (psyche) on your machine. This is so far the
platform used to produce the rpms and it's known to do its job
well
</para></listitem>
<listitem><para>Get an updated copy of the "linux-openmosix" module from oM's CVS
repository - details can be found at
http://sourceforge.net/cvs/?group_id=46729
</para></listitem>
<listitem><para>
Get the tarball for the Linux Kernel sources which we are going to
patch and put it in /usr/src/redhat/SOURCES - supposing we're
talking about a 2.4.20 Kernel, get the linux-2.4.20.tar.bz2 file
from one of the many http://www.kernel.org/ mirrors worldwide
</para></listitem>
<listitem><para>
Unpack the kernel tarball under /usr/src, ie:
<programlisting>
# cd /usr/src
# tar vxjf redhat/SOURCES/linux-2.4.20.tar.bz2
</programlisting>
</para>
</listitem>
<listitem><para>Make a symbolic link to the directory where you've checked out the
linux-openmosix module, for instance:
<programlisting>
# ln -s /home/mcaserta/src/linux-openmosix/linux-openmosix \
/usr/src/linux-openmosix
</programlisting>
</para>
</listitem>
<listitem>
<para>
copy the .spec file and all the .config files which are found in
this directory under /usr/src/redhat/SOURCES, ie:
<programlisting>
# cp /usr/src/linux-openmosix/configs/openmosix-kernel.spec \
/usr/src/redhat/SOURCES
# cp /usr/src/linux-openmosix/configs/*.config \
/usr/src/redhat/SOURCES
</programlisting>
</para>
</listitem>
<listitem>
<para>
Now it's time to check the version numbers before we make the patch
file: make sure the very first lines in
<programlisting>
/usr/src/linux-openmosix/Makefile and
/usr/src/redhat/SOURCES/openmosix-kernel.spec have the correct
</programlisting>
kernel version and openMosix revision number
</para>
</listitem>
<listitem>
<para>
Good, time to make the patch (suppose we're releasing a patch for
the 2.4.20 Linux Kernel and the 3rd release of openMosix):
<programlisting>
# cd /usr/src
# diff -Naur --exclude=CVS --exclude=configs \
linux-2.4.20 linux-openmosix > \
/usr/src/redhat/SOURCES/openMosix-2.4.20-3
# bzip2 /usr/src/redhat/SOURCES/openMosix-2.4.20-3
</programlisting>
</para>
</listitem>
<listitem>
<para>
At this point your /usr/src/redhat/SOURCES directory should look like:
<programlisting>
# ls /usr/src/redhat/SOURCES
kernel-2.4.20-athlon.config kernel-2.4.20-i686-smp.config
kernel-2.4.20-athlon-smp.config linux-2.4.20.tar.bz2
kernel-2.4.20-i386.config openMosix-2.4.20-3.bz2
kernel-2.4.20-i686.config openmosix-kernel.spec
</programlisting>
</para>
</listitem>
<listitem>
<para>
Now you only need to rpmbuild the whole thing - what I usually do is:
<programlisting>
# cd /usr/src/redhat/SOURCES
# rpmbuild -ba --target i386 openmosix-kernel.spec
# rpmbuild -bb --target i686 openmosix-kernel.spec
# rpmbuild -bb --target athlon openmosix-kernel.spec
</programlisting>
but you can easily build all rpms by calling:
<programlisting>
# rpmbuild -ba --target all_x86 openmosix-kernel.spec
</programlisting>
</para>
</listitem>
<listitem>
<para>
After rpmbuild has done its job, you should have the following
files under the /usr/src/redhat directory:
<programlisting>
a) RPMS/i386/openmosix-kernel-2.4.20-openmosix3.i386.rpm
b) RPMS/i686/openmosix-kernel-2.4.20-openmosix3.i686.rpm
c) RPMS/i686/openmosix-kernel-smp-2.4.20-openmosix3.i686.rpm
d) RPMS/athlon/openmosix-kernel-2.4.20-openmosix3.athlon.rpm
e) RPMS/athlon/openmosix-kernel-smp-2.4.20-openmosix3.athlon.rpm
f) RPMS/i386/openmosix-kernel-source-2.4.20-openmosix3.i386.rpm
g) SRPMS/openmosix-kernel-2.4.20-openmosix3.src.rpm
h) SOURCES/openMosix-2.4.20-3.gz
</programlisting>
where:
<programlisting>
a) binary kernel package for i386 UP* machines
b) binary kernel package for i686 UP* machines
c) binary kernel package for i686 SMP** machines
d) binary kernel package for athlon UP* machines
e) binary kernel package for athlon SMP** machines
f) source kernel package for any x86 machine (basically this is
useful if you need to have the openMosix kernel headers)
g) source kernel package (see point 11)
h) kernel patch file compressed with gzip
</programlisting>
</para>
</listitem>
<listitem>
<para>
The magic spell to obtain all the files back from the .src.rpm file is:
# rpm2cpio openmosix-kernel-....src.rpm | cpio -di
</para>
</listitem>
</orderedlist>
<para>
Special thanks to Martin Høy for the help while I was trying to get
the whole thing together.
</para>
<para>
I hope you find this document useful. At least it is for me since I
tend to forget things a few minutes after I've accomplished them :)
</para>
<para>
* UP = UniProcessor (i.e. one CPU)
** SMP = Symmetric Multi Processing (i.e. more than one CPU)
</para>
</sect1>
</appendix>