Gentoo Archives: gentoo-doc-cvs

From: swift <swift@×××××××××××.org>
To: gentoo-doc-cvs@l.g.o
Subject: [gentoo-doc-cvs] cvs commit: bootstrapping-guide.xml
Date: Fri, 06 Jan 2006 19:50:35
Message-Id: 200601061950.k06JoP4h009030@robin.gentoo.org
1 swift 06/01/06 19:50:25
2
3 Modified: xml/htdocs/doc/en/draft bootstrapping-guide.xml
4 Log:
5 Tralalalala, some more text
6
7 Revision Changes Path
8 1.6 +224 -3 xml/htdocs/doc/en/draft/bootstrapping-guide.xml
9
10 file : http://www.gentoo.org/cgi-bin/viewcvs.cgi/xml/htdocs/doc/en/draft/bootstrapping-guide.xml?rev=1.6&content-type=text/x-cvsweb-markup&cvsroot=gentoo
11 plain: http://www.gentoo.org/cgi-bin/viewcvs.cgi/xml/htdocs/doc/en/draft/bootstrapping-guide.xml?rev=1.6&content-type=text/plain&cvsroot=gentoo
12 diff : http://www.gentoo.org/cgi-bin/viewcvs.cgi/xml/htdocs/doc/en/draft/bootstrapping-guide.xml.diff?r1=1.5&r2=1.6&cvsroot=gentoo
13
14 Index: bootstrapping-guide.xml
15 ===================================================================
16 RCS file: /var/cvsroot/gentoo/xml/htdocs/doc/en/draft/bootstrapping-guide.xml,v
17 retrieving revision 1.5
18 retrieving revision 1.6
19 diff -u -r1.5 -r1.6
20 --- bootstrapping-guide.xml 5 Jan 2006 19:09:34 -0000 1.5
21 +++ bootstrapping-guide.xml 6 Jan 2006 19:50:25 -0000 1.6
22 @@ -1,6 +1,6 @@
23 <?xml version='1.0' encoding="UTF-8"?>
24
25 -<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/draft/bootstrapping-guide.xml,v 1.5 2006/01/05 19:09:34 swift Exp $ -->
26 +<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/draft/bootstrapping-guide.xml,v 1.6 2006/01/06 19:50:25 swift Exp $ -->
27
28 <!DOCTYPE guide SYSTEM "/dtd/guide.dtd">
29
30 @@ -52,6 +52,11 @@
31 native environment.
32 </p>
33
34 +<p>
35 +Sounds strange to you? Don't despair, we'll discuss all that in the rest of this
36 +document...
37 +</p>
38 +
39 </body>
40 </section>
41 <section>
42 @@ -87,6 +92,13 @@
43 </li>
44 </ul>
45
46 +<p>
47 +Each of those terms has a certain syntax used by the GNU compiler collection. It
48 +is therefore adviseable to consult the <uri
49 +link="http://gcc.gnu.org/onlinedocs">online GCC documentation</uri> for more
50 +information.
51 +</p>
52 +
53 </body>
54 </section>
55 </chapter>
56 @@ -228,7 +240,7 @@
57 </p>
58
59 <p>
60 -Our first task is to build a Linux kernel.
61 +Our first task is to build a Linux kernel:
62 </p>
63
64 <pre caption="Building the Linux kernel">
65 @@ -237,42 +249,224 @@
66 $ <i>make dep boot CROSS_COMPILE=&lt;target&gt;</i>
67 </pre>
68
69 +<p>
70 +Next, build the core packages required to succesfully boot the system. The set
71 +of packages you'll need are:
72 +</p>
73 +
74 +<dl>
75 + <dt><c>coreutils</c></dt>
76 + <dd>Standard set of (POSIX) commands</dd>
77 + <dt><c>diffutils</c></dt>
78 + <dd>Tools for displaying the differences between files</dd>
79 + <dt><c>grep</c></dt>
80 + <dd>Text pattern searcher</dd>
81 + <dt><c>sed</c></dt>
82 + <dd>Streaming text editor</dd>
83 + <dt><c>make</c></dt>
84 + <dd>Makefile parser</dd>
85 + <dt><c>tar</c></dt>
86 + <dd>Tape Archive tool</dd>
87 + <dt><c>gzip</c></dt>
88 + <dd>Compression tool</dd>
89 + <dt><c>util-linux</c></dt>
90 + <dd>Linux utilities</dd>
91 +</dl>
92 +
93 +<p>
94 +All these tools should be fairly easy to build. Generally, you can set the
95 +following variables to declare your platform; the <c>configure</c> and
96 +<c>make</c> steps will then use those variables to make their platform-dependant
97 +decisions:
98 +</p>
99 +
100 +<pre caption="Setting platform environment variables">
101 +$ <i>export CC=</i><comment>your-platform</comment><i>-gcc</i>
102 +$ <i>export AR=</i><comment>your-platform</comment><i>-ar</i>
103 +$ <i>export RANLIB=</i><comment>your-platform</comment><i>-ranlib</i>
104 +$ <i>export LD=</i><comment>your-platform</comment><i>-ld</i>
105 +$ <i>export BUILD_CC=cc</i>
106 +$ <i>export HOST_CC=cc</i>
107 +$ <i>export CFLAGS=</i><comment>sane cflags</comment><i> -I~/cd/usr/include</i>
108 +</pre>
109 +
110 +<p>
111 +The build steps are then quite simple:
112 +</p>
113 +
114 +<pre caption="Build steps for the core packages">
115 +$ <i>./configure --prefix=/usr</i>
116 +$ <i>make</i>
117 +$ <i>make install prefix=~/cd/final</i>
118 +</pre>
119 +
120 +<p>
121 +The last thing you'll need is a statically linked version of a shell, for
122 +instance, <c>bash</c>:
123 +</p>
124 +
125 +<pre caption="Building a statically-linked bash">
126 +$ <comment>TODO</comment>
127 +</pre>
128 +
129 </body>
130 </section>
131 <section>
132 <title>Bootstrapping the Toolchain</title>
133 <body>
134
135 +<p>
136 +Now that you have build a minimal environment inside <path>~/cd</path>, we'll
137 +rebuild the toolchain so that it not only builds for the target platform (which
138 +it does already) but also builds <e>on</e> the target platform (it currently
139 +only works on the current system).
140 +</p>
141 +
142 +<p>
143 +First, we rebuild the <c>glibc</c> package:
144 +</p>
145 +
146 +<pre caption="Rebuilding glibc">
147 +$ <i>./configure --prefix=/usr --libdir=~/cd/usr/lib --build=${BUILD} \
148 + --host=${TARGET} --with-headers=~/cd/usr/include --without-cvs \
149 + --disable-profile --disable-debug --without-gd --enable-add-ons=nptl \
150 + --with-tls --enable-kernel=2.6 --enable-shared</i>
151 +$ <i>make</i>
152 +$ <i>make install install_root=~/cd/final</i>
153 +</pre>
154 +
155 +<p>
156 +Next, we rebuild the <c>binutils</c> package:
157 +</p>
158 +
159 +<pre caption="Rebuilding binutils">
160 +$ <i>./configure --prefix=/usr --target=${TARGET} --with-sysroot=~/cd/final \
161 + --libdir=~/cd/usr/lib --with-headers=~/cd/usr/include</i>
162 +$ <i>make all</i>
163 +$ <i>make install</i>
164 +</pre>
165 +
166 +<p>
167 +Finally, we rebuild the <c>gcc</c> package:
168 +</p>
169 +
170 +<pre caption="Rebuilding gcc">
171 +$ <i>./configure --prefix=/usr --target=${TARGET} --with-sysroot=~/cd/final \
172 + --with-headers=~/cd/usr/include --enable-threads=posix \
173 + --enable-languages=c,c++</i>
174 +$ <i>make</i>
175 +$ <i>make install</i>
176 +</pre>
177 +
178 +<p>
179 +Now the directory <path>~/cd/final</path> contains everything needed to
180 +continue.
181 +</p>
182 +
183 </body>
184 </section>
185 <section>
186 -<title>Building the Core System Packages</title>
187 +<title>Booting the System</title>
188 <body>
189
190 +<p>
191 +The next step is to try and boot the system. The easiest approach is to
192 +NFS-mount <path>~/cd/final</path> and boot the target platform using the kernel
193 +built at the beginning. Don't forget to set <c>init=/bin/sh</c> since the entire
194 +bootup sequence stuff (like <c>init</c>) isn't available yet.
195 +</p>
196 +
197 +<p>
198 +<brite>TODO</brite> inform how to boot from the CD and use an NFS-mounted root
199 +file system.
200 +</p>
201 +
202 </body>
203 </section>
204 <section>
205 <title>Porting Portage</title>
206 <body>
207
208 +<p>
209 +To be able to use Portage, we need to be able to use Python. Download the
210 +sources in <path>~/cd/final/tmp</path> (so that it is available for the booted
211 +platform) and build it:
212 +</p>
213 +
214 +<pre caption="Building python">
215 +<comment>TODO</comment>
216 +</pre>
217 +
218 +<p>
219 +Next, download a Portage rescue set and install it. As Portage is a set of
220 +Python scripts with bash scripts, this should have no further requirements after
221 +installation:
222 +</p>
223 +
224 +<pre caption="Installing Portage">
225 +<comment>TODO</comment>
226 +</pre>
227 +
228 +<p>
229 +Once installed, try to run <c>emerge</c> and <c>ebuild</c> to find out if they
230 +appear to work:
231 +</p>
232 +
233 +<pre caption="Checking emerge">
234 +$ <i>emerge --info</i>
235 +</pre>
236 +
237 </body>
238 </section>
239 <section>
240 <title>Creating a Stage1 Tarball</title>
241 <body>
242
243 +<p>
244 +Booted in the platform and with a working Portage, you are now ready to create a
245 +stage1 tarball. Create a snapshot of your environment using <c>tar</c>:
246 +</p>
247 +
248 +<pre caption="Creating a stage1 tarball">
249 +<comment>TODO</comment>
250 +Don't forget to talk about unmasking all packages...
251 +</pre>
252 +
253 </body>
254 </section>
255 <section>
256 <title>Creating a Bootable Environment</title>
257 <body>
258
259 +<p>
260 +Next, to make sure that you'll always be able to boot the system (and help
261 +others as well), we'll create a bootable environment for the platform. Assuming
262 +that all platforms have a CD-ROM drive they can boot from, we'll focus on such
263 +environment.
264 +</p>
265 +
266 +<p>
267 +<brite>TODO</brite> talk about creating bootable CD.
268 +</p>
269 +
270 </body>
271 </section>
272 <section>
273 <title>Finishing Off</title>
274 <body>
275
276 +<p>
277 +All set. Right? Nope, but almost :-)
278 +</p>
279 +
280 +<p>
281 +The most important step now is to inform the Gentoo community about what you've
282 +accomplished. Make sure you pay a visit at <c>#gentoo-dev</c> on
283 +<c>irc.freenode.net</c> and use our <uri link="http://forums.gentoo.org">Gentoo
284 +Forums</uri> to tell about the up and downfalls of your expedition. The most
285 +difficult steps are finished!
286 +</p>
287 +
288 </body>
289 </section>
290 </chapter>
291 @@ -347,6 +541,33 @@
292
293 </body>
294 </section>
295 +<section>
296 +<title>Creating a Fully Working Installation CD</title>
297 +<body>
298 +
299 +<p>
300 +If your entire installation has succeeded it is best to try and create an
301 +installation CD for your platform using <c>catalyst</c>. Not only will this
302 +require an additional profile (to support the new platform) but also some help
303 +from the Gentoo developers themselves. On the other hand, if you've succeeded in
304 +following all I've written until this part, you're probably already on your way
305 +to become a developer yourself :)
306 +</p>
307 +
308 +<p>
309 +The major benefit of using <c>catalyst</c> is that Gentoo is then able to create
310 +official support for the platform. Not only will there be a fully functional
311 +profile and keyword setting, but the core packages will be accepted for your
312 +platform, stages will be build and a working installation CD, just like those
313 +for the other architectures, will be available.
314 +</p>
315 +
316 +<p>
317 +<brite>TODO</brite> Talk about using <c>catalyst</c> to create all needed stuff.
318 +</p>
319 +
320 +</body>
321 +</section>
322 </chapter>
323
324 <chapter>
325
326
327
328 --
329 gentoo-doc-cvs@g.o mailing list