/[gentoo]/xml/htdocs/doc/en/gentoo-freebsd.xml
Gentoo

Diff of /xml/htdocs/doc/en/gentoo-freebsd.xml

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.10 Revision 1.11
1<?xml version="1.0" encoding="UTF-8"?> 1<?xml version="1.0" encoding="UTF-8"?>
2<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/gentoo-freebsd.xml,v 1.10 2005/10/21 10:45:18 neysx Exp $ --> 2<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/gentoo-freebsd.xml,v 1.11 2005/12/06 12:32:46 jkt Exp $ -->
3<!DOCTYPE guide SYSTEM "/dtd/guide.dtd"> 3<!DOCTYPE guide SYSTEM "/dtd/guide.dtd">
4 4
5<guide link="/doc/en/gentoo-freebsd.xml"> 5<guide link="/doc/en/gentoo-freebsd.xml">
6<title>A short guide to Gentoo/FreeBSD</title> 6<title>A short guide to Gentoo/FreeBSD</title>
7 7
8<author title="Author"> 8<author title="Author">
9 <mail link="ignacio.arquelatour@gmail.com">Ignacio Arque-Latour</mail> 9 <mail link="ignacio.arquelatour@gmail.com">Ignacio Arque-Latour</mail>
10</author> 10</author>
11<author title="Author"> 11<author title="Author">
12 <mail link="citizen428@gentoo.org">Michael Kohl</mail> 12 <mail link="citizen428@gentoo.org">Michael Kohl</mail>
13</author> 13</author>
14<author title="Author"> 14<author title="Author">
15 <mail link="angusyoung@gentoo.org">Otavio R. Piske</mail> 15 <mail link="angusyoung@gentoo.org">Otavio R. Piske</mail>
16</author> 16</author>
17<author title="Author"> 17<author title="Author">
18 <mail link="ka0ttic@gentoo.org">Aaron Walker</mail> 18 <mail link="ka0ttic@gentoo.org">Aaron Walker</mail>
19</author> 19</author>
20 20
21<abstract> 21<abstract>
22This document gives some general information on FreeBSD, as well as 22This document gives some general information on FreeBSD, as well as
23installation instructions for Gentoo/FreeBSD. It also includes some reference 23installation instructions for Gentoo/FreeBSD. It also includes some reference
24for people interested in helping out with development. 24for people interested in helping out with development.
25</abstract> 25</abstract>
26 26
27<!-- The content of this document is licensed under the CC-BY-SA license --> 27<!-- The content of this document is licensed under the CC-BY-SA license -->
28<!-- See http://creativecommons.org/licenses/by-sa/2.5 --> 28<!-- See http://creativecommons.org/licenses/by-sa/2.5 -->
29<license/> 29<license/>
30 30
31<version>1.8</version> 31<version>1.9</version>
32<date>2005-10-21</date> 32<date>2005-12-06</date>
33 33
34<chapter> 34<chapter>
35<title>Introduction to FreeBSD</title> 35<title>Introduction to FreeBSD</title>
36<section> 36<section>
37<title>What is FreeBSD?</title> 37<title>What is FreeBSD?</title>
38<body> 38<body>
39 39
40<p> 40<p>
41<uri link="http://www.freebsd.org/">FreeBSD</uri> is a free (<uri 41<uri link="http://www.freebsd.org/">FreeBSD</uri> is a free (<uri
42link="http://www.freebsd.org/copyright/freebsd-license.html">license</uri>) 42link="http://www.freebsd.org/copyright/freebsd-license.html">license</uri>)
43Unix-like operating system. Back in 1993 when development of <uri 43Unix-like operating system. Back in 1993 when development of <uri
44link="http://www.386bsd.org/">386BSD</uri> stopped, two projects were born: 44link="http://www.386bsd.org/">386BSD</uri> stopped, two projects were born:
45<uri link="http://www.netbsd.org/">NetBSD</uri>, commonly known to run on a 45<uri link="http://www.netbsd.org/">NetBSD</uri>, commonly known to run on a
46huge number of architetures, and FreeBSD which focuses mainly on the x86 46huge number of architetures, and FreeBSD which focuses mainly on the x86
47platform. FreeBSD is renowned for its stability, performance and security, thus 47platform. FreeBSD is renowned for its stability, performance and security, thus
163a stage3 tarball. 163a stage3 tarball.
164</p> 164</p>
165 165
166<pre caption="Obtaining and unpacking a stage3 tarball"> 166<pre caption="Obtaining and unpacking a stage3 tarball">
167# <i>cd /mnt/gentoo/</i> 167# <i>cd /mnt/gentoo/</i>
168<comment>(Any other Gentoo mirror which includes the experimental/ directory will also work.)</comment> 168<comment>(Any other Gentoo mirror which includes the experimental/ directory will also work.)</comment>
169# <i>wget http://gentoo.osuosl.org/experimental/x86/freebsd/stages/stage3-x86-fbsd-20051020.tar.bz2</i> 169# <i>wget http://gentoo.osuosl.org/experimental/x86/freebsd/stages/stage3-x86-fbsd-20051020.tar.bz2</i>
170# <i>tar -jxvpf stage3-x86-fbsd-20051020.tar.bz2</i> 170# <i>tar -jxvpf stage3-x86-fbsd-20051020.tar.bz2</i>
171<comment>(You can delete the tarball with the following command if you want to.)</comment> 171<comment>(You can delete the tarball with the following command if you want to.)</comment>
172# <i>rm stage3-x86-fbsd-20051020.tar.bz2</i> 172# <i>rm stage3-x86-fbsd-20051020.tar.bz2</i>
173</pre> 173</pre>
174 174
175<p> 175<p>
176Before chrooting into the newly-extracted stage, you first must obtain an up-to-date 176Before chrooting into the newly-extracted stage, you first must obtain an up-to-date
177copy of the Gentoo/FreeBSD overlay. The easiest way to achieve this is to to get our latest 177copy of the Gentoo/FreeBSD overlay. The easiest way to achieve this is to to get our latest
178snapshot which you than extract to <path>/mnt/gentoo/usr/local/portage</path> 178snapshot which you then extract to <path>/mnt/gentoo/usr/local/portage</path>
179</p> 179</p>
180 180
181<pre caption="Getting the Gentoo/FreeBSD Portage overlay"> 181<pre caption="Getting the Gentoo/FreeBSD Portage overlay">
182# <i>cd /mnt/gentoo/usr/local/portage</i> 182# <i>cd /mnt/gentoo/usr/local/portage</i>
183# <i>wget http://gentoo.osuosl.org/experimental/snapshots/portage-alt-overlay-latest.tar.bz2</i> 183# <i>wget http://gentoo.osuosl.org/experimental/snapshots/portage-alt-overlay-latest.tar.bz2</i>
184# <i>tar -xjf portage-alt-overlay-latest.tar.bz2</i> 184# <i>tar -xjf portage-alt-overlay-latest.tar.bz2</i>
185<comment>(You now can safely delete the snapshot with the following command.)</comment>
186# <i>rm portage-alt-overlay-latest.tar.bz2</i>
185</pre> 187</pre>
186 188
187<p> 189<p>
188Alternatively, you can also use Subversion to check out the current version of 190Alternatively, you can also use Subversion to check out the current version of
189the overlay. If you are interested in this possibility, please refer to the 191the overlay. If you are interested in this possibility, please refer to the
190<uri link="/proj/en/gentoo-alt/overlay.xml">Gentoo/ALT overlay 192<uri link="/proj/en/gentoo-alt/overlay.xml">Gentoo/ALT overlay
191documentation</uri>. 193documentation</uri>.
192</p> 194</p>
193 195
194<p> 196<p>
195In order for your install to work, you need to mount the <path>/dev</path> 197In order for your install to work, you need to mount the <path>/dev</path>
196filesystem from the currently running system into the Gentoo/FreeBSD mount 198filesystem from the currently running system into the Gentoo/FreeBSD mount
197point before proceeding with the chroot. 199point before proceeding with the chroot.
198</p> 200</p>
199 201
210<path>/etc/make.conf</path> ready for Gentoo/FreeBSD. 212<path>/etc/make.conf</path> ready for Gentoo/FreeBSD.
211</p> 213</p>
212 214
213<pre caption="Setting up the profile and editing /etc/make.conf"> 215<pre caption="Setting up the profile and editing /etc/make.conf">
214# <i>ln -sf /usr/local/portage/portage-alt-overlay/profiles/default-bsd/fbsd/5.4/x86/ /etc/make.profile</i> 216# <i>ln -sf /usr/local/portage/portage-alt-overlay/profiles/default-bsd/fbsd/5.4/x86/ /etc/make.profile</i>
215<comment>(FreeBSD's standard editor is ee, which is used to edit /etc/make.conf)</comment> 217<comment>(FreeBSD's standard editor is ee, which is used to edit /etc/make.conf)</comment>
216# <i>ee /etc/make.conf</i> 218# <i>ee /etc/make.conf</i>
217<comment>(Please make sure you add at least the following entries:)</comment> 219<comment>(Please make sure you add at least the following entries:)</comment>
218CHOST="i686-gentoo-freebsd5.4" 220CHOST="i686-gentoo-freebsd5.4"
219ACCEPT_KEYWORDS="~x86-fbsd ~x86" 221ACCEPT_KEYWORDS="~x86-fbsd ~x86"
220FEATURES="-sandbox collision-protect" 222FEATURES="-sandbox collision-protect"
221PORTDIR_OVERLAY="/usr/local/portage/portage-alt-overlay" 223PORTDIR_OVERLAY="/usr/local/portage/portage-alt-overlay"
222</pre> 224</pre>
223 225
224<p> 226<p>
227In order to boot correctly, you will need to create the <path>/proc</path> directory.
228</p>
229
230<pre caption="Creating the /proc directory">
231# <i>mkdir /proc</i>
232</pre>
233
234<p>
225Now, you have to obtain a copy of the main Gentoo Portage tree, which depending 235Now, you have to obtain a copy of the main Gentoo Portage tree, which depending
226on your connection might take quite a while. 236on your connection might take quite a while.
227</p> 237</p>
228 238
229<pre caption="Obtaining the Portage tree"> 239<pre caption="Obtaining the Portage tree">
230# <i>emerge --sync</i> 240# <i>emerge --sync</i>
231<comment>(It's also possible to retrieve the Portage tree in another way:)</comment> 241<comment>(It's also possible to retrieve the Portage tree in another way:)</comment>
232# <i>cd /</i> 242# <i>cd /</i>
233# <i>wget http://gentoo.osuosl.org/snapshots/portage-latest.tar.bz2</i> 243# <i>wget http://gentoo.osuosl.org/snapshots/portage-latest.tar.bz2</i>
234# <i>tar -xjf portage-latest.tar.bz2 -C /usr/</i> 244# <i>tar -xjf portage-latest.tar.bz2 -C /usr/</i>
235# <i>emerge --metadata</i> 245# <i>emerge --metadata</i>
236</pre> 246</pre>
237 247
238<p> 248<p>
239Congratulations, by the time you have reached this step you should have a 249If you want, you can now rebuild the system's core packages.
240running Gentoo/FreeBSD system! If you want, you can now rebuild the system's
241core packages.
242</p> 250</p>
243 251
244<pre caption="Rebuilding the FreeBSD core packages"> 252<pre caption="Rebuilding the FreeBSD core packages (Optional)">
245# <i>emerge -e system</i> 253# <i>emerge -e system</i>
254</pre>
255
256<p>
257When you did <c>emerge -e system</c>, the sources for the FreeBSD kernel got
258installed to <path>/usr/src/sys</path>. If you skipped this step, you can get
259them in the following way:
260</p>
261
262<pre caption="Geting the FreeBSD kernel sources">
263# <i>emerge freebsd-sources</i>
264</pre>
265
266<p>
267Configuring and compiling a custom kernel is really different from compiling Linux,
268so if you are not familiar with the process we encourage you to have a look at
269<uri link="http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig.html">
270chapter 8</uri> of the FreeBSD handbook.
271</p>
272
273<p>
274Please note that currently only the "Traditional" way of building the kernel is
275supported on Gentoo/FreeBSD! Also note that <c>make install</c> will probably
276ask you for a <path>/boot/device.hints</path> file. A default version can be
277found in the <path>conf</path> subdirectory of the <c>GENERIC</c> configuration
278and is called <path>GENERIC.hints</path>
279</p>
280
281<p>
282Now is the time to do some basic system configuration and settings. First, we are
283going to setup the filesystem mounting points in <path>/etc/fstab</path>
284</p>
285
286<pre caption="Editing the filesystem in /etc/fstab">
287# <i>ee /etc/fstab</i>
288<comment>(This is an example, replace X and Y with the correct numbers for your hard disk.)</comment>
289#Device Mountpoint Fstype Options Dump Pass
290/dev/adXsYb none swap sw 0 0
291/dev/adXsYa / ufs rw 1 1
292/dev/adXsYe /usr/home ufs rw 2 2
293/dev/adXsYd /tmp ufs rw 2 2
294/dev/acdX /cdrom cd9660 ro,noauto 0 0
295</pre>
296
297<p>
298Now would also be a good time to set up your network connection before the final
299reboot.
300</p>
301
302<pre caption="Setting up your network">
303# <i>ee /etc/conf.d/net</i>
304<comment>(This is just an example which you have to adjust for your network.)</comment>
305ifconfig_rl0=("192.168.0.10 netmask 255.255.255.0 broadcast 192.168.0.255")
306routes_rl0=("-net 0.0.0.0 -host 192.168.0.1")
307</pre>
308
309<p>
310To change your hostname you have to edit <path>/etc/hostname</path>.
311</p>
312
313<pre caption="Setting up the machine's hostname">
314# <i>echo "YOUR_HOSTNAME_HERE" > /etc/hostname</i>
315</pre>
316
317<p>
318In case you need to use another keyboard layout for your language, you have to set the
319correct value in <path>/etc/conf.d/syscons</path>. The following example uses the Spanish
320layout, so you'll have to adjust it to your need if you want to use another one.
321</p>
322
323<pre caption="Changing your keyboard layout (Optional)">
324# <i>ee /etc/conf.d/syscons</i>
325KEYMAP="spanish.iso.acc"
326<comment>(Possible layouts can be found in /usr/share/syscons/keymaps).</comment>
246</pre> 327</pre>
247 328
248<impo> 329<impo>
249Please make absolutely sure you add your new Gentoo/FreeBSD installation to the 330Please make absolutely sure you add your new Gentoo/FreeBSD installation to the
250configuration of your bootloader, otherwise you won't be able to boot your newly 331configuration of your bootloader, otherwise you won't be able to boot your newly
251installed system! If you don't have another bootloader installed, you should use 332installed system! If you don't have another bootloader installed, you should use
252<c>boot0</c>, as it is currently the only one supported by FreeBSD. 333<c>boot0</c>, as it is currently the only one supported by FreeBSD. In this case
334please don't forget to use your other operating systems to <c>boot0</c>'s
335configuration.
253</impo> 336</impo>
254 337
255<pre caption="Installing and setting up boot0"> 338<pre caption="Installing and setting up boot0">
256# <i>emerge boot0</i> 339# <i>emerge boot0</i>
257<comment>(Leave the chroot environment)</comment> 340<comment>(Leave the chroot environment)</comment>
258# <i>exit</i> 341# <i>exit</i>
259<comment>(Issued from outside the chroot)</comment> 342<comment>(Issued from outside the chroot)</comment>
260# <i>fdisk -b -B /mnt/gentoo/boot/boot0 /dev/adX</i> 343# <i>fdisk -b -B /mnt/gentoo/boot/boot0 /dev/adX</i>
261# <i>chroot /mnt/gentoo /bin/bash</i> 344# <i>chroot /mnt/gentoo /bin/bash</i>
262# <i>disklabel -B adXsY</i> 345# <i>disklabel -B adXsY</i>
263</pre> 346</pre>
264 347
265<p> 348<p>
266If you need additonal information on setting up <c>boot0</c>, please consult 349If you need additonal information on setting up <c>boot0</c>, please consult
267<uri link="http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/boot.html"> 350<uri link="http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/boot.html">
268chapter 12</uri> of the FreeBSD handbook. 351chapter 12</uri> of the FreeBSD handbook.
269</p> 352</p>
270 353
271<p> 354<p>
272When you did <c>emerge system</c>, the sources for the FreeBSD kernel got 355Now would be a good time to set a password for the <c>root</c> user and to add
273installed to <path>/usr/src/sys</path>. Configuring and compiling a custom 356another user account for your day-to-day work.
274kernel is really different from compiling Linux, so if you are not familiar with
275the process we encourage you to have a look at <uri
276link="http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig.html">
277chapter 8</uri> of the FreeBSD handbook.
278</p>
279
280<p> 357</p>
281Please note that currently only the "Traditional" way of building the kernel is 358
282supported on Gentoo/FreeBSD! Also note that <c>make install</c> will probably 359<pre caption="Changing the root password and adding a new user">
283ask you for a <path>/boot/device.hints</path> file. A default version can be 360# <i>passwd</i>
284found in the <path>conf</path> subdirectory of the <c>GENERIC</c> configuration 361<comment>(If you need help in adding a user please consult the FreeBSD handbook).</comment>
285and is called <path>GENERIC.hints</path> 362# <i>adduser</i>
363</pre>
364
286</p> 365<p>
366Congratulations, you have just finished your Gentoo/FreeBSD installation which you
367can start exploring after the final reboot. Have fun!
368</p>
369
370<pre caption="Rebooting the system">
371# <i>exit</i>
372# <i>reboot</i>
373</pre>
287 374
288</body> 375</body>
289</section> 376</section>
290</chapter> 377</chapter>
291 378
292<chapter> 379<chapter>
293<title>Developing for Gentoo/FreeBSD</title> 380<title>Developing for Gentoo/FreeBSD</title>
294<section> 381<section>
295<title>How to help</title> 382<title>How to help</title>
296<body> 383<body>
297 384
298<p> 385<p>
299There are many things you could help with, depending on your skill level and 386There are many things you could help with, depending on your skill level and
300spare time: 387spare time:
301</p> 388</p>

Legend:
Removed from v.1.10  
changed lines
  Added in v.1.11

  ViewVC Help
Powered by ViewVC 1.1.20