Gentoo Archives: gentoo-commits

From: "Christian Faulhammer (fauli)" <fauli@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo commit in xml/htdocs/proj/en/gentoo-alt/prefix: bootstrap-freebsd.xml
Date: Wed, 06 Jan 2010 21:46:27
Message-Id: E1NSdhv-0006jk-Dr@stork.gentoo.org
1 fauli 10/01/06 21:46:23
2
3 Modified: bootstrap-freebsd.xml
4 Log:
5 Bringing guide up to par with FreeBSD 8.0:
6 * copy Solaris guide nearly completely
7 * add bootstrap targets that actually build
8 * add make bootstrap which is needed for grep4
9 * change some little things
10
11 Revision Changes Path
12 1.10 xml/htdocs/proj/en/gentoo-alt/prefix/bootstrap-freebsd.xml
13
14 file : http://sources.gentoo.org/viewcvs.py/gentoo/xml/htdocs/proj/en/gentoo-alt/prefix/bootstrap-freebsd.xml?rev=1.10&view=markup
15 plain: http://sources.gentoo.org/viewcvs.py/gentoo/xml/htdocs/proj/en/gentoo-alt/prefix/bootstrap-freebsd.xml?rev=1.10&content-type=text/plain
16 diff : http://sources.gentoo.org/viewcvs.py/gentoo/xml/htdocs/proj/en/gentoo-alt/prefix/bootstrap-freebsd.xml?r1=1.9&r2=1.10
17
18 Index: bootstrap-freebsd.xml
19 ===================================================================
20 RCS file: /var/cvsroot/gentoo/xml/htdocs/proj/en/gentoo-alt/prefix/bootstrap-freebsd.xml,v
21 retrieving revision 1.9
22 retrieving revision 1.10
23 diff -u -r1.9 -r1.10
24 --- bootstrap-freebsd.xml 18 Mar 2008 21:52:27 -0000 1.9
25 +++ bootstrap-freebsd.xml 6 Jan 2010 21:46:23 -0000 1.10
26 @@ -1,6 +1,6 @@
27 <?xml version="1.0" encoding="UTF-8"?>
28 <!DOCTYPE guide SYSTEM "/dtd/guide.dtd">
29 -<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/proj/en/gentoo-alt/prefix/bootstrap-freebsd.xml,v 1.9 2008/03/18 21:52:27 grobian Exp $ -->
30 +<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/proj/en/gentoo-alt/prefix/bootstrap-freebsd.xml,v 1.10 2010/01/06 21:46:23 fauli Exp $ -->
31
32 <guide link="/proj/en/gentoo-alt/prefix/bootstrap-freebsd.xml" lang="en">
33 <title>Gentoo Prefix Bootstrap Process for FreeBSD</title>
34 @@ -9,6 +9,9 @@
35 <author title="Author">
36 <mail link="grobian@g.o">Fabian Groffen</mail>
37 </author>
38 + <author title="Contributor">
39 + <mail link="fauli@g.o">Christian Faulhammer</mail>
40 + </author>
41
42 <abstract>
43 How to bootstrap Gentoo Prefix on your FreeBSD system
44 @@ -19,8 +22,8 @@
45 <!-- See http://creativecommons.org/licenses/by-sa/2.5 -->
46 <license/>
47
48 - <version>1.1</version>
49 - <date>2008-01-09</date>
50 + <version>2.0</version>
51 + <date>2010-01-07</date>
52
53 <chapter>
54 <title>Bootstrapping on FreeBSD</title>
55 @@ -29,17 +32,19 @@
56 <title>Introduction</title>
57 <body>
58 <p>
59 - An off-the-shelf FreeBSD system is bare. Very bare. Whoever
60 - thought that bootstrapping on Solaris was hard, FreeBSD makes
61 - it even harder. The lack of tools like bash and perl requires
62 - some pre-bootstrapping prior to the actual bootstrapping
63 - process. If you bootstrap on FreeBSD, make sure the
64 - development tools are installed, which include system headers
65 - and a compiler. This bootstrap guide was tested on a
66 - FreeBSD 6.2 i386 system. Other architectures should not
67 - differ too much.
68 - Feel free to try it out on other configurations and post to
69 - the <c>gentoo-alt</c> mailing list for additional help.
70 + An off-the-shelf FreeBSD system is bare. Very bare.
71 + Whoever thought that bootstrapping on Solaris was hard,
72 + FreeBSD makes it even harder. The lack of tools like bash
73 + and perl requires some pre-bootstrapping prior to the actual
74 + bootstrapping process. Alternatively you can install a Bash
75 + through the ports system.
76 + If you bootstrap on FreeBSD, make
77 + sure the development tools are installed, which include
78 + system headers and a compiler. This bootstrap guide was
79 + tested on a FreeBSD 8.0 i386 system. Other architectures
80 + should not differ too much. Feel free to try it out on
81 + other configurations and post to the <c>gentoo-alt</c>
82 + mailing list for additional help.
83 </p>
84 </body>
85 </section><!-- }}} -->
86 @@ -94,32 +99,31 @@
87 $ <i>mkdir $EPREFIX/tmp</i>
88 $ <i>./bootstrap-bash.sh $EPREFIX/tmp</i>
89 $ <i>./bootstrap-prefix.sh $EPREFIX tree</i>
90 +$ <i>./bootstrap-prefix.sh $EPREFIX/tmp make</i>
91 $ <i>./bootstrap-prefix.sh $EPREFIX/tmp wget</i>
92 $ <i>./bootstrap-prefix.sh $EPREFIX/tmp sed</i>
93 $ <i>./bootstrap-prefix.sh $EPREFIX/tmp python</i>
94 -$ <i>./bootstrap-prefix.sh $EPREFIX/tmp coreutils</i>
95 -$ <i>./bootstrap-prefix.sh $EPREFIX/tmp findutils</i>
96 -$ <i>./bootstrap-prefix.sh $EPREFIX/tmp tar</i>
97 +$ <i>./bootstrap-prefix.sh $EPREFIX/tmp coreutils8</i>
98 +$ <i>./bootstrap-prefix.sh $EPREFIX/tmp findutils3</i>
99 +$ <i>./bootstrap-prefix.sh $EPREFIX/tmp tar122</i>
100 $ <i>./bootstrap-prefix.sh $EPREFIX/tmp patch9</i>
101 -$ <i>./bootstrap-prefix.sh $EPREFIX/tmp grep</i>
102 +$ <i>./bootstrap-prefix.sh $EPREFIX/tmp grep4</i>
103 $ <i>./bootstrap-prefix.sh $EPREFIX/tmp gawk</i>
104 -$ <i>env SHELL=/bin/sh ./bootstrap-prefix.sh $EPREFIX portage</i>
105 +$ <i>./bootstrap-prefix.sh $EPREFIX portage</i>
106 </pre>
107 - <note>Please note that <c>python</c>, <c>sed</c>, <c>wget</c>
108 - etc. are installed in <path>$EPREFIX/tmp</path>!
109 - <c>patch9</c> is not a typo, the officially released patch
110 - 2.5.4 doesn't compile out of the box on FreeBSD.</note>
111 + <note>
112 + Please note that <c>python</c>, <c>sed</c>, <c>wget</c>
113 + etc. are installed in <path>$EPREFIX/tmp</path>!
114 + <c>patch9</c> and the like are not typing errors but build
115 + different versions that will compile out of the box on
116 + FreeBSD.
117 + </note>
118 <p>
119 The script will setup the <path>$EPREFIX</path>
120 directory, download a portage tree snapshot, unpack it and
121 download and install portage. Afterwards it will try to setup
122 - some sane defaults. We continue with a little hack necessary
123 - for a successful bootstrap:
124 - </p>
125 - <pre caption="Setup ld directions">
126 -$ <i>export LDFLAGS="-L${EPREFIX}/usr/lib -Wl,-rpath=${EPREFIX}/usr/lib -L${EPREFIX}/lib -Wl,-rpath=${EPREFIX}/lib"</i>
127 -$ <i>export CPPFLAGS="-I${EPREFIX}/usr/include"</i>
128 - </pre>
129 + some sane defaults.
130 + </p>
131 <p>
132 Let your shell take notice of all just installed programs.
133 </p>
134 @@ -130,25 +134,27 @@
135 tcsh users can use the <c>rehash</c> command.
136 </note>
137 <p>
138 - We continue adding some necessary tools which will deal with
139 - many errors and warnings you might see during emerging.
140 + On Linux profiles, the following USE flags will create circular
141 + dependancies, so we disable them until later.
142 </p>
143 - <pre caption="emerge sed">
144 -$ <i>emerge --oneshot "=sys-apps/sed-4.1.4*"</i>
145 + <pre caption="Disable USE flags">
146 +$ <i>export USE="-berkdb -fortran -gdbm -nls -pcre -ssl"</i>
147 </pre>
148 <p>
149 - The <c>make</c> that comes with FreeBSD is a BSD version not
150 - fully compatible with GNU make. Hence we install the latter.
151 + We continue adding some necessary tools which will deal with
152 + many errors and warnings you might see during emerging.
153 </p>
154 - <pre caption="emerge make">
155 -$ <i>emerge --oneshot make</i>
156 + <pre caption="emerge sed">
157 +$ <i>emerge --oneshot sed</i>
158 </pre>
159 <p>
160 - Next, we emerge the <c>bash</c> shell and its dependency
161 - ncurses. <c>bash</c> is used extensively within portage and
162 - other applications.
163 + Next, we emerge the <c>bash</c> shell Portage heavily relies
164 + on. The same holds for <c>wget</c>, the download manager.
165 + Since its dependencies cannot be compiled at this stage,
166 + we ignore those for the moment.
167 </p>
168 - <pre caption="emerge bash">
169 + <pre caption="emerge bash and wget">
170 +$ <i>emerge --oneshot wget</i>
171 $ <i>emerge --oneshot bash</i>
172 </pre>
173 <note>
174 @@ -156,144 +162,106 @@
175 message that appears till the end of the bootstrap process.
176 </note>
177 <p>
178 - Next we start building some development tools, which are
179 - missing or insufficient on FreeBSD.
180 - The packages to emerge include the <c>baselayout</c> package.
181 - Some, if not many, scripts and tools within a Gentoo system
182 - assume the availability of the <c>baselayout</c> package for
183 - all communication using the Gentoo colour scheme.
184 + Now, we will emerge a compiler which will use the GNU
185 + linker. This is a requirement for many packages that follow
186 + in the bootstrap process, in particular Perl. The packages
187 + to emerge include the <c>baselayout</c> package. Some, if
188 + not many, scripts and tools within a Gentoo system assume
189 + the availability of the <c>baselayout</c> package for all
190 + communication using the Gentoo colour scheme.
191 </p>
192 - <pre caption="emerge autotools">
193 -$ <i>emerge --oneshot m4</i>
194 + <pre caption="emerge linker and compiler">
195 $ <i>emerge --oneshot --nodeps baselayout-prefix</i>
196 -$ <i>emerge --oneshot flex</i>
197 -$ <i>emerge --oneshot perl</i>
198 -$ <i>emerge --oneshot --nodeps "=autoconf-2.1*" "=autoconf-2.6*" "autoconf-wrapper"</i>
199 -$ <i>emerge --oneshot --nodeps "=automake-1.4*" "=automake-1.5*" "=automake-1.6*" "=automake-1.7*" "=automake-1.8*" "automake-wrapper"</i>
200 - </pre>
201 - <note><c>>=automake-1.9</c> and <c>libtool</c> are not (yet)
202 - installed at this stage.</note>
203 - <p>
204 - Next, we have to get some tools in order to finalise getting
205 - the autotools in our prefix. Because we installed <c>wget</c>
206 - in a temporary location, let's not forget to install it
207 - properly by emerging it now:
208 - </p>
209 - <pre caption="emerge wget">
210 -$ <i>emerge --oneshot --nodeps wget</i>
211 - </pre>
212 - <p>
213 - After this we can emerge texinfo, which <c>automake-1.9</c>
214 - needs.
215 - </p>
216 - <pre caption="emerge texinfo">
217 -$ <i>emerge --oneshot --nodeps help2man texinfo</i>
218 - </pre>
219 - <p>
220 - Now we can finish installing the autotools:
221 - </p>
222 - <pre caption="finalise emerge autotools">
223 -$ <i>emerge --oneshot --nodeps "=automake-1.9*" "=automake-1.10*"</i>
224 -$ <i>emerge --oneshot --nodeps libtool</i>
225 - </pre>
226 - <p>
227 - Now we have some decent autotooling stuff around, we can get
228 - some decent core utilities in our prefix.
229 - </p>
230 - <pre caption="emerge coreutils">
231 -$ <i>emerge --oneshot --nodeps sys-apps/coreutils</i>
232 - </pre>
233 - <p>
234 - Finally we emerge the last packages that we temporarily
235 - bootstrapped, including some dependencies such that portage
236 - can fully work from inside the prefix.
237 - </p>
238 - <pre caption="emerge remaining packages">
239 -$ <i>emerge --oneshot --nodeps readline</i>
240 -$ <i>emerge --oneshot --nodeps python</i>
241 -$ <i>emerge --oneshot --nodeps findutils</i>
242 -$ <i>emerge --oneshot --nodeps tar</i>
243 -$ <i>emerge --oneshot --nodeps patch</i>
244 +$ <i>emerge --oneshot --nodeps xz-utils</i>
245 +$ <i>emerge --oneshot --nodeps m4</i>
246 +$ <i>emerge --oneshot --nodeps flex</i>
247 +$ <i>emerge --oneshot --nodeps bison</i>
248 +$ <i>emerge --oneshot --nodeps binutils-config</i>
249 +$ <i>emerge --oneshot --nodeps binutils</i>
250 +$ <i>emerge --oneshot --nodeps gcc-config</i>
251 +$ <i>emerge --oneshot --nodeps "=gcc-4.2*"</i>
252 + </pre>
253 + <p>
254 + We continue getting more tools in our Prefix. We no longer
255 + ignore dependencies all the time, so a lot of packages will be
256 + emerged at this stage. Slowly our Prefix gets more robust as
257 + we progress here.
258 + </p>
259 + <pre caption="emerge several tools">
260 +$ <i>emerge --oneshot coreutils</i>
261 +$ <i>emerge --oneshot findutils</i>
262 +$ <i>emerge --oneshot tar</i>
263 +$ <i>emerge --oneshot grep</i>
264 +$ <i>emerge --oneshot patch</i>
265 $ <i>emerge --oneshot gawk</i>
266 +$ <i>emerge --oneshot make</i>
267 +$ <i>emerge --oneshot --nodeps file</i>
268 +$ <i>emerge --oneshot --nodeps eselect</i>
269 +$ <i>emerge --oneshot pax-utils</i>
270 </pre>
271 <p>
272 - Before we continue to emerge all ebuilds from <c>system</c>,
273 - we first install <c>portage</c>. We need to overwrite the
274 - version that was installed by the bootstrap script.
275 - Installing a new portage will make sure it uses the tools
276 - provided by the prefix, and forget about the temporary
277 - installed tools.
278 + Now we have a good bunch of programs that Portage needs, we
279 + can replace the bootstrapped Portage by a properly installed
280 + one, using Portage itself. Also here a few dependencies are
281 + first emerged, such as the language Portage is written in:
282 + <c>python</c>. We need to temporarily tell Portage that the
283 + bootstrapped Portage can be overwritten.
284 </p>
285 <pre caption="emerge portage">
286 -$ <i>env FEATURES="-collision-protect" emerge --oneshot --nodeps portage</i>
287 +$ <i>env FEATURES="-collision-protect" emerge --oneshot portage</i>
288 </pre>
289 <p>
290 - Now we're about to start the big work, we remove the temporary
291 - directory and its use as we got it all in our prefix now.
292 + Now we have emerged everything we bootstrapped before, we
293 + remove the temporary directory and its use as it is no longer
294 + necessary.
295 </p>
296 <pre caption="remove tmp directory">
297 $ <i>rm -Rf $EPREFIX/tmp/*</i>
298 $ <i>hash -r</i>
299 </pre>
300 <p>
301 - Next, we do the real work where all packages get reemerged in
302 - such an order that they make use of packages in the prefix
303 - itself.
304 + Before we do any further merges, we are going to update our
305 + tree. Updating the tree is done using:
306 </p>
307 - <pre caption="emerge system">
308 -$ <i>emerge -e system</i>
309 + <pre caption="Updating the tree">
310 +$ <i>emerge --sync</i>
311 </pre>
312 <p>
313 - This will happily install a lot of stuff and reinstall what
314 - you emerged before. This is necessary to avoid compilation
315 - failures due to dependencies.
316 + Next, we let Portage emerge all packages that complete a
317 + system install that we eventually need to finalise this Prefix
318 + installation.
319 </p>
320 - <p>
321 - We can now update the tree. Since snapshots now are actually
322 - (anonymous) SVN checkouts of the tree, we can immediately use
323 - SVN commands on the tree instead of checking a tree out first.
324 - Because Portage knows how to deal with the SVN tree, and the
325 - bootstrap script has set a correct <c>SYNC</c> variable in
326 - your <path>etc/make.conf</path>, updating the tree is done
327 - using:
328 - </p>
329 - <pre caption="Updating the tree">
330 -$ <i>emerge --sync</i>
331 + <pre caption="emerge system">
332 +$ <i>emerge -u system</i>
333 </pre>
334 <p>
335 - To really do this properly, after emerging <c>system</c>, one
336 - should re-emerge <c>system</c>, because now all packages can
337 - be compiled with all tools from the prefix, instead of based
338 - on tools in the system root. Before you do though, this is
339 - the good time to set your general <c>USE</c>-flags, such as
340 - <c>nls</c> to get localised messages in
341 - <path>$EPREFIX/etc/make.conf</path>. In that file, you
342 - can also set <c>CFLAGS</c> for your compilation. Be
343 - conservative with <c>CFLAGS</c>! Note that the code below is
344 - an example, and is meant for inspiration only.
345 + Now is a good time to set the preferences for our soon to be
346 + Prefix. This includes customisations such as general
347 + <c>USE</c>-flags, <c>CFLAGS</c> and <c>MAKEOPTS</c> in
348 + <path>$EPREFIX/etc/make.conf</path>. Be conservative with
349 + <c>CFLAGS</c>! Note that the code below is an example, and is
350 + meant for inspiration only.
351 </p>
352 - <pre caption="Customising the prefix installation - example">
353 + <pre caption="Customising the Prefix installation - example">
354 $ <i>echo 'USE="unicode nls"' >> $EPREFIX/etc/make.conf</i>
355 $ <i>echo 'CFLAGS="-O2 -pipe"' >> $EPREFIX/etc/make.conf</i>
356 $ <i>echo 'CXXFLAGS="${CFLAGS}"' >> $EPREFIX/etc/make.conf</i>
357 </pre>
358 <p>
359 - Since we're about to rebuild our system for the last time, we
360 - can unset all hacks we made to help the bootstrap process.
361 + Since we have everything in place for a self-catered rebuild,
362 + we can start the final stage to install the Prefix system.
363 + This final stage recompiles everything in the system, but now
364 + all packages can be compiled with tools from the Prefix,
365 + instead of those from the host system.
366 </p>
367 - <pre caption="Unsetting LDFLAGS and CPPFLAGS variables">
368 -$ <i>unset LDFLAGS</i>
369 -$ <i>unset CPPFLAGS</i>
370 + <pre caption="doing the final system installation">
371 +$ <i>unset USE</i>
372 $ <i>emerge -e system</i>
373 </pre>
374 - <note>
375 - tcsh users can use <c>unsetenv LDFLAGS</c> and alike for
376 - <c>CPPFLAGS</c>.
377 - </note>
378 <p>
379 - After <c>system</c> has emerged successfully, your prefix will
380 + After <c>system</c> has emerged successfully, your Prefix will
381 be set up properly, and you can emerge the whichever tools you
382 - choose from the prefix tree.
383 + choose from the Prefix tree.
384 </p>
385 </body>
386 </section><!-- }}} -->