/[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.14 Revision 1.24
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.14 2006/03/02 13:32:47 yoswink Exp $ --> 2<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/gentoo-freebsd.xml,v 1.24 2007/04/04 14:22:45 nightmorph 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
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<author title="Author">
21 <mail link="chriswhite@gentoo.org">Chris White</mail>
22</author>
23<author title="Contributor">
24 <mail link="flameeyes@gentoo.org">Diego Pettenò</mail>
25</author>
26<author title="Editor">
27 <mail link="nightmorph@gentoo.org">Joshua Saddler</mail>
28</author>
20 29
21<abstract> 30<abstract>
22This document gives some general information on FreeBSD, as well as 31This document gives some general information on FreeBSD, as well as
23installation instructions for Gentoo/FreeBSD. It also includes some reference 32installation instructions for Gentoo/FreeBSD. It also includes some reference
24for people interested in helping out with development. 33for people interested in helping out with development.
26 35
27<!-- The content of this document is licensed under the CC-BY-SA license --> 36<!-- The content of this document is licensed under the CC-BY-SA license -->
28<!-- See http://creativecommons.org/licenses/by-sa/2.5 --> 37<!-- See http://creativecommons.org/licenses/by-sa/2.5 -->
29<license/> 38<license/>
30 39
31<version>2.1</version> 40<version>2.7</version>
32<date>2006-03-02</date> 41<date>2007-01-02</date>
33 42
34<chapter> 43<chapter>
35<title>Introduction to FreeBSD</title> 44<title>Introduction to FreeBSD</title>
36<section> 45<section>
37<title>What is FreeBSD?</title> 46<title>What is FreeBSD?</title>
41<uri link="http://www.freebsd.org/">FreeBSD</uri> is a free (<uri 50<uri link="http://www.freebsd.org/">FreeBSD</uri> is a free (<uri
42link="http://www.freebsd.org/copyright/freebsd-license.html">license</uri>) 51link="http://www.freebsd.org/copyright/freebsd-license.html">license</uri>)
43Unix-like operating system. Back in 1993 when development of <uri 52Unix-like operating system. Back in 1993 when development of <uri
44link="http://www.386bsd.org/">386BSD</uri> stopped, two projects were born: 53link="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 54<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 55huge number of architectures, and FreeBSD which supports the x86, amd64, ia64,
47platform. FreeBSD is renowned for its stability, performance and security, thus 56sparc64 and alpha platforms. FreeBSD is renowned for its stability, performance
48being used from small to huge companies all over the world. FreeBSD's current 57and security, thus being used from small to huge companies all over the world.
49production release version is 5.4, which is also used as the foundation for the 58</p>
50Gentoo/FreeBSD project. 59
60<p>
61FreeBSD's current production release is version 6.1, although the release of 6.2
62is very near at the time of writing (Release Candidate 2 was released recently).
63Gentoo/FreeBSD development is ongoing on this latter version, while older
64versions are discontinued and no longer supported.
51</p> 65</p>
52 66
53</body> 67</body>
54</section> 68</section>
55<section> 69<section>
56<title>What is Gentoo/FreeBSD?</title> 70<title>What is Gentoo/FreeBSD?</title>
57<body> 71<body>
58 72
59<p> 73<p>
60Gentoo/FreeBSD is an effort to provide a fully-capable FreeBSD operating system 74<uri link="/proj/en/gentoo-alt/bsd/fbsd/">Gentoo/FreeBSD</uri> is a subproject
61with Gentoo's design sensibilities. The long-term goal of the Gentoo/BSD project 75of the <uri link="/proj/en/gentoo-alt/">Gentoo/Alt project</uri>, with the
62is to allow users to choose any combination of *BSD or Linux kernels, *BSD or 76goal of providing a fully-capable FreeBSD operating system featuring design
63GNU libc, and *BSD or GNU userland tools. 77sensibilities taken from Gentoo Linux, such as the init system and the Portage
78package management system.
64</p> 79</p>
65 80
66</body> 81</body>
67</section> 82</section>
68<section> 83<section>
120</chapter> 135</chapter>
121 136
122<chapter> 137<chapter>
123<title>Installing Gentoo/FreeBSD</title> 138<title>Installing Gentoo/FreeBSD</title>
124<section> 139<section>
125<title>Installation instructions</title> 140<title>Booting the CD</title>
126<body> 141<body>
127 142
128<p> 143<p>
129After this short introduction, it's about time to finally install 144After this short introduction, it's about time to finally install
130Gentoo/FreeBSD. Unfortunately, we currently lack our own installation media, so 145Gentoo/FreeBSD. Unfortunately, we currently lack our own installation media, so
131you have to choose between two alternative installation methods. The first 146you have to choose between two alternative installation methods. The first
132would be to use an existing FreeBSD installation to partition your hard drive 147would be to use an existing FreeBSD installation to partition your hard drive
133and use it as a base for installing Gentoo/FreeBSD. Alternatively, you can also 148and use it as a base for installing Gentoo/FreeBSD. This guide will describe how
134use the excellent <uri link="http://www.freesbie.org/">FreeSBIE LiveCD</uri> as 149to use the <uri link="http://www.freesbie.org/">FreeSBIE LiveCD</uri> as
135an installation medium for Gentoo/FreeBSD. 150an installation medium for Gentoo/FreeBSD.
136</p> 151</p>
137 152
138<p> 153<note>
139Before you can begin with the installation, you have to setup a hard disk for 154If you are intending to use FreeSBIE for installing Gentoo/FreeBSD, please make
140use with Gentoo/FreeBSD. This can either be done via <c>sysinstall</c> 155sure to use a version based on FreeBSD 6.x, such as FreeSBIE 2.0 (or one of its
141(available from a current FreeBSD installation as well as from within FreeSBIE) 156release candidates). You can download it from <uri
142or by manually using the commands <c>fdisk</c>, <c>disklabel</c> and 157link="http://torrent.freesbie.org/">FreeSBIE's Bittorrent tracker</uri>.
143<c>newfs</c>. If you have never set up a FreeBSD system before, 158</note>
144<c>sysinstall</c> may be the better option for you. If you face difficulties 159
145while partitioning or formatting your hard disks, have a look at the great
146<uri link="http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/">FreeBSD
147Handbook</uri> or hop onto <c>#gentoo-bsd</c> on the Freenode IRC server.
148</p> 160<p>
149 161First, boot the CD in order to begin the installation process. You'll be
162presented with a login screen. The username is <c>freesbie</c>, and there is
163no password. Next, run <c>sudo su</c> to become root, and optionally setup a
164password. If you want to pass time during the installation process, you can run
165<c>startx</c> to enter into an Xfce environment, suitable for web browsing,
166AIM, and other things. Unlike Linux, FreeBSD bases the name of your interface
167on the driver for the interface. For example, the Intel EtherExpress driver
168(fxp) appears as fxp0 (driver fxp, first network card). To see what your
169interface is, use <c>ifconfig</c>:
150<p> 170</p>
151Once you're done setting up your disks, you have to create a mount point for 171
152your Gentoo/FreeBSD installation and mount all the necessary partitions. 172<pre caption="Finding out the network interface name using ifconfig">
173# <i>ifconfig</i>
174fxp0: flags=8843&lt;UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST&gt; mtu 1500
175 options=8&lt;VLAN_MTU&gt;
176 inet6 fe80::2d0::b7ff:febc:4fe3%fxp0 prefixlen 64 scopeid 0x1
177 inet 192.168.0.106 netmask 0xffffff00 broadcast 192.168.0.255
178 ether 00:d0:b7:bc:4f:e3
179 media: Ethernet autoselect (100baseTX &lt;full-duplex&gt;)
180 status: active
181lo0: flags=8007&lt;LOOPBACK,MULTICAST&gt; mtu 16384
182</pre>
183
153</p> 184<p>
185If the original DHCP request during the CD bootup failed, you can use the
186<c>dhclient</c> command to obtain an IP:
187</p>
154 188
155<pre caption="Creating a mount point and mounting partitions"> 189<pre caption="Obtaining a DHCP address using dhclient">
190# <i>dhclient fxp0</i>
191DHCPDISCOVER on fxp0 to 255.255.255.255 port 67 interval 9
192DHCPOFFER from 192.168.0.1
193DHCPREQUEST on fxp0 to 255.255.255.255 port 67
194DHCPACK from 192.168.0.1
195bound to 192.168.0.106 -- renewal in 302400 seconds
196</pre>
197
198<note>
199The output presented here will differ based on your network.
200</note>
201
202<p>
203Next, create the chroot for your installation:
204</p>
205
206<pre caption="Making the chroot directory">
156# <i>mkdir /mnt/gentoo</i> 207# <i>mkdir /mnt/gentoo</i>
157<comment>(Replace X with the correct numbers for your hard disk.)</comment>
158# <i>mount /dev/adXsXa /mnt/gentoo</i>
159</pre> 208</pre>
160 209
210<note>
211There is a bug in the <uri
212link="http://dev.gentoo.org/~flameeyes/minimal-freesbie-drizzt.iso.bz2">
213minimal Freesbie CD</uri> that prevents the creation of the
214<path>/mnt/gentoo</path> mount point. To avoid this, use <path>/mnt</path>
215instead of <path>/mnt/gentoo</path> in the following sections.
216</note>
217
218</body>
219</section>
220<section>
221<title>Partitioning the Drive</title>
222<body>
223
224<p>
225Now that we have a mount point, it's time to partition the drive. This is done
226with the <c>sysinstall</c> command:
161<p> 227</p>
228
229<pre caption="Running the sysinstall command to fdisk the drive">
230# <i>sysinstall diskPartitionEditor diskPartitionWrite</i>
231</pre>
232
233<p>
234We recommend that you use the default layout. Press enter at the dialog, then
235press <b>a</b> followed by <b>q</b> to accept the default layout. The next
236screen will present you with the option of a bootloader. For this option,
237choose "None" as we'll be installing the bootloader later on. Next comes the
238actual partition sizing and mount points.
239</p>
240
241<p>
242This next step also uses <c>sysinstall</c>, but with different arguments:
243</p>
244
245<pre caption="Running sysinstall to setup partition sizing and mount points">
246# <i>sysinstall diskLabelEditor diskLabelCommit</i>
247</pre>
248
249<p>
250Here, we'll refrain from using the automatic layout, and create one giant root
251partition, followed by a swap partition. Hit <b>c</b> to create a new
252partition. A dialog prompts you to enter a size. Go ahead and do so, using
253MB/GB for setting different sizes, or C for cylinders. For root, choose FS as
254the partition type, and set the mount point as <path>/mnt/gentoo</path>. <e>If
255you do not adjust the mount point, it will overwrite the FreeSBIE
256environment!</e> As <path>/boot</path> is not a separate partition, you'll
257need to disable soft-updates, or your system will not boot! To do so, use the
258arrow keys to navigate to your newly created partition, then hit the <b>s</b>
259key, until "Newfs" contains no <b>+S</b>. Now navigate the arrow keys until
260the "Disk" line is highlighted, and hit <b>c</b> again to create a swap
261partition. Generally, we recommend a swap space that is twice the size of your
262RAM. Choose SWAP as the partition type, and don't worry about soft-updates, as
263it does not apply to swap. Now we're finished, so hit <b>q</b> to finish the
264process.
265</p>
266
267<p>
268When choosing a different mountpoint than <path>/</path> for your partition,
269<c>sysinstall</c> will actually create a 'd' slice, which the bootloader won't
270boot from. To fix this, run the following:
271</p>
272
273<pre caption="Fixing the root partition letter">
274# <i>disklabel ad0s1 | sed 's/^ d:/ a:/g' | disklabel -w ad0s1</i>
275</pre>
276
277<p>
278This will finalize the partitioning process, and format the drive in UFS for
279FreeBSD to utilize. This will also mount the drive for you at the mount point
280specified earlier (<path>/mnt/gentoo</path>). You can verify this worked by
281running <c>mount</c>:
282</p>
283
284<pre caption="Verifying the new disk layout was mounted with mount">
285# <i>mount</i>
286...
287/dev/ad0s1a on /mnt/gentoo (ufs, local)
288</pre>
289
290<p>
162Now that you have mounted the target partition, it is time to fetch and unpack 291Now that you have mounted the target partition, it is time to start on the Gentoo
163a stage3 tarball. 292setup.
293</p>
294
295</body>
296</section>
297<section>
298<title>Gentoo Setup</title>
299<body>
300
301<p>
302First, we need to download a stage3 tarball and unpack it into the chroot.
303Point your browser to
304<uri>http://gentoo.osuosl.org/experimental/x86/freebsd/stages/</uri>, grab the
305latest snapshot, and unpack it into the mountpoint:
164</p> 306</p>
165 307
166<pre caption="Obtaining and unpacking a stage3 tarball"> 308<pre caption="Obtaining and unpacking a stage3 tarball">
167# <i>cd /mnt/gentoo/</i> 309# <i>cd /mnt/gentoo/</i>
168<comment>(Any other Gentoo mirror which includes the experimental/ directory will also work.)</comment> 310<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> 311# <i>wget http://gentoo.osuosl.org/experimental/x86/freebsd/stages/stage3-x86-freebsd-6.2_rc2.tar.bz2</i>
170# <i>tar -jxvpf stage3-x86-fbsd-20051020.tar.bz2</i> 312# <i>tar -jxvpf stage3-x86-freebsd-6.2_rc2.tar.bz2</i>
171<comment>(You can delete the tarball with the following command if you want to.)</comment> 313<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> 314# <i>rm stage3-x86-freebsd-6.2_rc2.tar.bz2</i>
173</pre>
174
175<p>
176Before chrooting into the newly-extracted stage, you first must obtain an
177up-to-date copy of the Gentoo/FreeBSD overlay. The easiest way to achieve this
178is to to get our latest snapshot which you then extract to
179<path>/mnt/gentoo/usr/local/portage</path>.
180</p> 315</pre>
181 316
182<pre caption="Getting the Gentoo/FreeBSD Portage overlay"> 317<note>
183# <i>cd /mnt/gentoo/usr/local/portage</i> 318If you want you can use the transition overlay that contains semi-experimental
184# <i>wget http://gentoo.osuosl.org/experimental/snapshots/portage-alt-overlay-latest.tar.bz2</i> 319ebuilds with patches not yet in the main Portage tree, but does allow a wider
185# <i>tar -xjf portage-alt-overlay-latest.tar.bz2</i> 320range of supported packages, please refer to the <uri
186<comment>(You now can safely delete the snapshot with the following command.)</comment>
187# <i>rm portage-alt-overlay-latest.tar.bz2</i>
188</pre>
189
190<p>
191Alternatively, you can also use Subversion to check out the current version of
192the overlay. If you are interested in this possibility, please refer to the
193<uri
194link="/proj/en/gentoo-alt/contribute/index.xml?part=1&amp;chap=3">Gentoo/ALT 321link="/proj/en/gentoo-alt/contribute/index.xml?part=1&amp;chap=3">Gentoo/ALT
195overlay documentation</uri>. 322overlay documentation</uri>. Please note that the overlay is not critical and
196</p> 323you can easily install and use Gentoo/FreeBSD without it.
324</note>
197 325
198<p> 326<p>
199In order for your install to work, you need to mount the <path>/dev</path> 327In order for your install to work, you need to mount the <path>/dev</path>
200filesystem from the currently running system into the Gentoo/FreeBSD mount 328filesystem from the currently running system into the Gentoo/FreeBSD mount
201point before proceeding with the chroot. 329point before proceeding with the chroot.
203 331
204<pre caption="Mounting the /dev filesystem and chrooting"> 332<pre caption="Mounting the /dev filesystem and chrooting">
205# <i>mount -t devfs none /mnt/gentoo/dev/</i> 333# <i>mount -t devfs none /mnt/gentoo/dev/</i>
206# <i>cp /etc/resolv.conf /mnt/gentoo/etc</i> 334# <i>cp /etc/resolv.conf /mnt/gentoo/etc</i>
207# <i>chroot /mnt/gentoo/ /bin/bash</i> 335# <i>chroot /mnt/gentoo/ /bin/bash</i>
208# <i>source /etc/profile</i> 336# <i>env-update &amp;&amp; source /etc/profile</i>
209</pre> 337</pre>
210 338
211<p> 339<p>
212After you got hold of the Gentoo/FreeBSD overlay, it's time to link 340After you obtain the Gentoo/FreeBSD overlay, it's time to link
213<path>/etc/make.profile</path> to the correct profile and add get your 341<path>/etc/make.profile</path> to the correct profile and get your
214<path>/etc/make.conf</path> ready for Gentoo/FreeBSD. 342<path>/etc/make.conf</path> ready for Gentoo/FreeBSD.
215</p> 343</p>
216
217<pre caption="Setting up the profile and editing /etc/make.conf">
218# <i>ln -sf /usr/local/portage/portage-alt-overlay/profiles/default-bsd/fbsd/5.4/x86/ /etc/make.profile</i>
219<comment>(FreeBSD's standard editor is ee, which is used to edit /etc/make.conf)</comment>
220# <i>ee /etc/make.conf</i>
221<comment>(Please make sure you add at least the following entries:)</comment>
222CHOST="i686-gentoo-freebsd5.4"
223ACCEPT_KEYWORDS="~x86-fbsd ~x86"
224FEATURES="-sandbox collision-protect"
225PORTDIR_OVERLAY="/usr/local/portage/portage-alt-overlay"
226</pre>
227
228<p>
229In order to boot correctly, you will need to create the <path>/proc</path>
230directory.
231</p>
232
233<pre caption="Creating the /proc directory">
234# <i>mkdir /proc</i>
235</pre>
236 344
237<p> 345<p>
238Now, you have to obtain a copy of the main Gentoo Portage tree, which depending 346Now, you have to obtain a copy of the main Gentoo Portage tree, which depending
239on your connection might take quite a while. 347on your connection might take quite a while.
240</p> 348</p>
246# <i>wget http://gentoo.osuosl.org/snapshots/portage-latest.tar.bz2</i> 354# <i>wget http://gentoo.osuosl.org/snapshots/portage-latest.tar.bz2</i>
247# <i>tar -xjf portage-latest.tar.bz2 -C /usr/</i> 355# <i>tar -xjf portage-latest.tar.bz2 -C /usr/</i>
248# <i>emerge --metadata</i> 356# <i>emerge --metadata</i>
249</pre> 357</pre>
250 358
359<pre caption="Setting up the profile and editing /etc/make.conf">
360# <i>ln -sf /usr/portage/profiles/default-bsd/fbsd/6.2/x86/ /etc/make.profile</i>
361# <i>nano /etc/make.conf</i>
362<comment>(Please make sure you add at least the following entries:)</comment>
363CHOST="i486-gentoo-freebsd6.2"
364FEATURES="collision-protect"
365</pre>
366
367<note>
368The <c>~x86-fbsd</c> keyword does not yet fully cover the same tree as
369<c>~x86</c>, but please <e>do not</e> put <c>~x86</c> in ACCEPT_KEYWORDS. Rather
370use <path>/etc/portage/package.keywords</path> to test packages, and report
371working packages on <uri
372link="http://bugs.gentoo.org/enter_bug.cgi?product=Gentoo%2FAlt">Bugzilla</uri>.
373</note>
374
251<p> 375<p>
252If you want, you can now rebuild the system's core packages. 376If you want, you can now rebuild the system's core packages.
253</p> 377</p>
254 378
255<pre caption="Rebuilding the FreeBSD core packages (Optional)"> 379<pre caption="Rebuilding the FreeBSD core packages (optional)">
256# <i>emerge -e system</i> 380# <i>emerge -e system</i>
257</pre> 381</pre>
258 382
383</body>
384</section>
385</chapter>
386<chapter>
387<title>Setting up for Booting</title>
388<section>
389<title>Kernel Installation</title>
390<body>
391
259<p> 392<p>
260When you did <c>emerge -e system</c>, the sources for the FreeBSD kernel got 393If you ran <c>emerge -e system</c>, the sources for the FreeBSD kernel were
261installed to <path>/usr/src/sys</path>. If you skipped this step, you can get 394installed to <path>/usr/src/sys</path>. If you skipped this step, you can get
262them in the following way: 395them in the following way:
263</p> 396</p>
264 397
265<pre caption="Geting the FreeBSD kernel sources"> 398<pre caption="Getting the FreeBSD kernel sources">
266# <i>emerge freebsd-sources</i> 399# <i>emerge freebsd-sources</i>
267</pre> 400</pre>
268 401
269<p> 402<p>
270Configuring and compiling a custom kernel is really different from compiling 403Configuring and compiling a custom kernel is quite different from compiling
271Linux, so if you are not familiar with the process we encourage you to have a 404Linux, so if you are not familiar with the process we encourage you to have a
272look at <uri 405look at <uri
273link="http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig.html"> 406link="http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig.html">
274chapter 8</uri> of the FreeBSD handbook. 407chapter 8</uri> of the FreeBSD handbook. For now, you can do an installation of
275</p> 408the GENERIC kernel, which works on most systems. To begin, enter the source
276 409directory for the kernel:
277<p> 410</p>
411
412<impo>
278Please note that currently only the "Traditional" way of building the kernel is 413Please note that currently only the "Traditional" way of building the kernel is
279supported on Gentoo/FreeBSD! Also note that <c>make install</c> will probably 414supported on Gentoo/FreeBSD!
280ask you for a <path>/boot/device.hints</path> file. A default version can be 415</impo>
281found in the <path>conf</path> subdirectory of the <c>GENERIC</c> configuration 416
282and is called <path>GENERIC.hints</path> 417<pre caption="Entering the kernel source directory">
418# <i>cd /usr/src/sys/</i>
419</pre>
420
283</p> 421<p>
284 422Looking over the layout, you'll see various architectures and subdirectories
423for various parts of the kernel. To begin the installation, we head into the
424<path>i386/conf/</path> directory:
285<p> 425</p>
286Now is the time to do some basic system configuration and settings. First, we 426
287are going to setup the filesystem mounting points in <path>/etc/fstab</path>. 427<pre caption="The kernel configuration directory">
428# <i>cd i386/conf/</i>
429# <i>ls</i>
430.cvsignore GENERIC Makefile PAE
431DEFAULTS GENERIC.hints NOTES SMP
432</pre>
433
434<p>
435The main files to note are <path>GENERIC</path> and <path>GENERIC.hints</path>.
436As it will be needed by the installation of the kernel, go ahead and copy
437<path>GENERIC.hints</path> file to <path>/boot/device.hints</path>:
438</p>
439
440<pre caption="Copying over the GENERIC.hints file">
441# <i>cp GENERIC.hints /boot/device.hints</i>
442</pre>
443
444<p>
445This file is used by the kernel drivers for basic configuration information
446such as IRQ settings. Now it's time to configure the kernel. FreeBSD uses the
447<c>config</c> command to do this. <c>config</c> uses the given file (in this
448instance GENERIC) to copy over the required build files to a
449<path>compile</path> directory in the parent directory. <path>GENERIC</path> is
450similiar to the <path>.config</path> file for the Linux kernel. Run
451<c>config</c> to produce the build directory:
452</p>
453
454<pre caption="Configuring the kernel build">
455# <i>config GENERIC</i>
456Kernel build directory is ../compile/GENERIC
457Don't forget to ''make cleandepend; make depend''
458</pre>
459
460<p>
461<c>config</c> has created a GENERIC build directory for us in the parent
462directory. <c>cd</c> into it, then run the following to do a complete build:
463</p>
464
465<pre caption="Building and installing the kernel">
466# <i>cd ../compile/GENERIC</i>
467# <i>make cleandepend &amp;&amp; make depend &amp;&amp; make &amp;&amp; make install</i>
468</pre>
469
470<p>
471This will give us a complete kernel to work with. Now we'll need to setup the
472bootloader for the kernel to boot. The next chapter will discuss two methods of
473setting up the bootloader: <c>boot0</c> and <c>grub</c>.
474</p>
475
476</body>
477</section>
478<section>
479<title>Setting up the bootloader (boot0)</title>
480<body>
481
482<impo>
483<c>boot0</c> is the FreeBSD bootloader. Previously, it was the only supported
484bootloader until <c>grub</c> was introduced into ports with UFS slice support.
485To install and configure <c>boot0</c>, run the following. Remember to replace
486<c>adXsY</c> with the actual number and slice of your disk.
487</impo>
488
489<pre caption="Installing and setting up boot0">
490# <i>emerge boot0</i>
491<comment>(Leave the chroot environment)</comment>
492# <i>exit</i>
493<comment>(Issued from outside the chroot)</comment>
494# <i>fdisk -B -b /mnt/gentoo/boot/boot0 /dev/adX</i>
495# <i>chroot /mnt/gentoo /bin/bash</i>
496# <i>disklabel -B adXsY</i>
497</pre>
498
499<p>
500If you need additional information on setting up <c>boot0</c>, please consult
501<uri
502link="http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/boot.html">chapter
50312</uri> of the FreeBSD handbook. Now it's time to do some basic system
504configuration and settings.
505</p>
506
507<p>
508The next section will look at using the alternative bootloader, <c>grub</c>.
509</p>
510
511</body>
512</section>
513<section>
514<title>Setting up the bootloader (grub)</title>
515<body>
516
517<p>
518As of grub 0.97-r1, UFS slices are readable to <c>grub</c>. This lets us use
519<c>grub</c> as a bootloader, the prefered method for those coming from a Linux
520background. To begin, emerge <c>grub</c> and setup the label as bootable.
521Remember to replace <c>adXsY</c> with the actual number and slice of your disk.
522</p>
523
524<pre caption="Emerge grub">
525# <i>emerge grub</i>
526# <i>disklabel -B adXsY</i>
527</pre>
528
529<p>
530Now run <c>grub</c> to bring up the command prompt, and set up the partition as
531shown:
532</p>
533
534<pre caption="Setting up grub">
535<comment>(This is done to prevent disk error 29)</comment>
536# <i>sysctl kern.geom.debugflags=16</i>
537# <i>grub</i>
538<comment>(Example using ad0s1d)</comment>
539grub&gt; <i>root (hd0,0,d)</i>
540 Filesystem type is ufs2, partition type 0xa5
541
542grub&gt; <i>setup (hd0)</i>
543 Checking if "/boot/grub/stage1" exists... yes
544 Checking if "/boot/grub/stage2" exists... yes
545 Checking if "/boot/grub/ufs2_stage1_5" exists... yes
546 Running "embed /boot/grub/ufs2_stage1_5 (hd0)"... 14 sectors are embedded.
547succeeded
548 Running "install /boot/grub/stage1 (hd0) (hd0)1+14 p (hd0,0,d)/boot/grub/stage
5492 /boot/grub/menu.lst"... succeeded
550Done.
551
552grub&gt; quit
553</pre>
554
555<p>
556When you first boot, you may not receive a grub menu. If so, run this at the
557prompt:
558</p>
559
560<pre caption="Booting the kernel with no menu">
561grub&gt; <i>find /boot/grub/stage1</i>
562<comment>(The output here is what you'll use in the next command)</comment>
563 (hd0,0,d)
564
565grub&gt; <i>kernel (hd0,0,d)/boot/loader</i>
566 [FreeBSD-a.out, loadaddr=0x200000, text=0x1000, data=0x3a000, bss=0x0, entry=0x200000]
567
568grub&gt; <i>boot</i>
569</pre>
570
571<note>
572For more information on configuring grub, please refer to the <uri
573link="/doc/en/handbook/handbook-x86.xml?part=1&amp;chap=10#doc_chap2">Gentoo
574Linux Handbook</uri>.
575</note>
576
577</body>
578</section>
579<section>
580<title>System configuration</title>
581<body>
582
583<p>
584First, we are going to setup the filesystem mounting points in
585<path>/etc/fstab</path>.
288</p> 586</p>
289 587
290<pre caption="Editing the filesystem in /etc/fstab"> 588<pre caption="Editing the filesystem in /etc/fstab">
291# <i>ee /etc/fstab</i> 589# <i>nano /etc/fstab</i>
292<comment>(This is an example, replace X and Y with the correct numbers for your hard disk.)</comment> 590<comment>(This is an example, replace X and Y with the correct numbers for your hard disk.)</comment>
293#Device Mountpoint Fstype Options Dump Pass 591#Device Mountpoint Fstype Options Dump Pass
294/dev/adXsYb none swap sw 0 0 592/dev/adXsYb none swap sw 0 0
295/dev/adXsYa / ufs rw 1 1 593/dev/adXsYa / ufs rw 1 1
296/dev/adXsYe /usr/home ufs rw 2 2 594/dev/adXsYe /usr/home ufs rw 2 2
298/dev/acdX /cdrom cd9660 ro,noauto 0 0 596/dev/acdX /cdrom cd9660 ro,noauto 0 0
299</pre> 597</pre>
300 598
301<p> 599<p>
302Now would also be a good time to set up your network connection before the final 600Now would also be a good time to set up your network connection before the final
303reboot. 601reboot. You can find all the information necessary to configure your network in
304</p> 602the <uri link="/doc/en/handbook/handbook-x86.xml?part=4&amp;chap=1">Gentoo
305 603Handbook</uri>. To have your network interface activated at boot time, you have
306<pre caption="Setting up your network"> 604to add it to the default runlevel:
307# <i>ee /etc/conf.d/net</i>
308<comment>(This is just an example which you have to adjust for your network.)</comment>
309ifconfig_rl0=("192.168.0.10 netmask 255.255.255.0 broadcast 192.168.0.255")
310routes_rl0=("-net 0.0.0.0 -host 192.168.0.1")
311</pre>
312
313<p>
314To have your network interface activated at boot time, you have to add it to the default runlevel.
315</p> 605</p>
316 606
317<pre caption="Adding your network adapter to the default runlevel"> 607<pre caption="Adding your network adapter to the default runlevel">
318# <i>rc-update add net.rl0 default</i> 608# <i>rc-update add net.fxp0 default</i>
319</pre> 609</pre>
320 610
321<p> 611<p>
322Your system's hostname can be changed in <path>/etc/hostname</path>. 612Your system's hostname can be changed in <path>/etc/conf.d/hostname</path>.
323</p> 613</p>
324 614
325<pre caption="Setting up the machine's hostname"> 615<pre caption="Setting up the machine's hostname">
326# <i>echo "YOUR_HOSTNAME_HERE" > /etc/hostname</i> 616# <i>nano /etc/conf.d/hostname</i>
617<comment>(Set the HOSTNAME variable to your hostname)</comment>
618HOSTNAME="tux"
619</pre>
620
621<p>
622You should also configure your domain name, which is done in the
623<path>/etc/conf.d/domainname</path> file:
327</pre> 624</p>
625
626<pre caption="Setting the domainname">
627# <i>nano /etc/conf.d/domainname</i>
628<comment>(Set the dns_domain variable to your domain name, and lo to your local
629network interface)</comment>
630dns_domain_lo="homenetwork"
631</pre>
632
633<p>
634If you have a NIS domain, you need to define it in the
635<path>/etc/conf.d/domainname</path> file:
636</p>
637
638<pre caption="Setting the NIS domainname">
639# <i>nano /etc/conf.d/domainname</i>
640<comment>(Set the nis_domain variable to your NIS domain name, and lo to your local network interface)</comment>
641nis_domain_lo="my-nisdomain"
642</pre>
643
644<note>
645For more information on domainnames and networking, please refer to the <uri
646link="/doc/en/handbook/handbook-x86.xml?part=1&amp;chap=8#doc_chap2">Gentoo
647Linux Handbook</uri>, and please read the documentation in
648<path>/etc/conf.d/net.example</path>.
649</note>
328 650
329<p> 651<p>
330In case you need to use another keyboard layout for your language, you have to 652In case you need to use another keyboard layout for your language, you have to
331set the correct value in <path>/etc/conf.d/syscons</path>. The following example 653set the correct value in <path>/etc/conf.d/syscons</path>. The following example
332uses the Spanish layout, so you'll have to adjust it to your need if you want to 654uses the Spanish layout, so you'll have to adjust it to your need if you want to
333use another one. 655use another one.
334</p> 656</p>
335 657
336<pre caption="Changing your keyboard layout (Optional)"> 658<pre caption="Changing your keyboard layout (Optional)">
337# <i>ee /etc/conf.d/syscons</i> 659# <i>nano /etc/conf.d/syscons</i>
338KEYMAP="spanish.iso.acc" 660KEYMAP="spanish.iso.acc"
339<comment>(Possible layouts can be found in /usr/share/syscons/keymaps).</comment> 661<comment>(Possible layouts can be found in /usr/share/syscons/keymaps).</comment>
340</pre> 662</pre>
341 663
342<impo>
343Please make absolutely sure you add your new Gentoo/FreeBSD installation to the
344configuration of your bootloader, otherwise you won't be able to boot your newly
345installed system! If you don't have another bootloader installed, you should use
346<c>boot0</c>, as it is currently the only one supported by FreeBSD. In this case
347please don't forget to use your other operating systems to <c>boot0</c>'s
348configuration.
349</impo>
350
351<pre caption="Installing and setting up boot0">
352# <i>emerge boot0</i>
353<comment>(Leave the chroot environment)</comment>
354# <i>exit</i>
355<comment>(Issued from outside the chroot)</comment>
356# <i>fdisk -b -B /mnt/gentoo/boot/boot0 /dev/adX</i>
357# <i>chroot /mnt/gentoo /bin/bash</i>
358# <i>disklabel -B adXsY</i>
359</pre>
360
361<p>
362If you need additonal information on setting up <c>boot0</c>, please consult
363<uri
364link="http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/boot.html">chapter
36512</uri> of the FreeBSD handbook.
366</p>
367
368<p> 664<p>
369Now would be a good time to set a password for the <c>root</c> user and to add 665Now would be a good time to set a password for the <c>root</c> user and to add
370another user account for your day-to-day work. 666another user account for your day-to-day work.
371</p> 667</p>
372 668
373<pre caption="Changing the root password and adding a new user"> 669<pre caption="Changing the root password and adding a new user">
374# <i>passwd</i> 670# <i>passwd</i>
375<comment>(If you need help in adding a user please consult the FreeBSD handbook).</comment>
376# <i>adduser</i> 671# <i>adduser</i>
672Username: <i>fred</i>
673Full Name: <i>Fred Smith</i>
674<comment>(Accepting the default here, just hit Enter.)</comment>
675Uid (Leave empty for default):
676<comment>(OK to accept the default here as well; hit Enter.)</comment>
677Login group [fred]:
678<comment>(Enter your groups here, space separated. They must exist.)</comment>
679Login group is fred. Invite fred into other groups? []: wheel portage
680<comment>(OK to accept the default here, hit Enter)</comment>
681Login class [default]:
682<comment>(Somewhat of a personal preference. Make sure the shell exists in /etc/shells)</comment>
683Shell (sh bash tcsh csh esh ksh zsh sash nologin) [sh] <i>bash</i>
684<comment>(OK to accept the default here, hit Enter for all these)</comment>
685User password-based authentication [yes]
686Use an empty password (yes/no) [no]:
687Use a random password? (yes/no) [no]:
688Enter password: <i>password goes here</i>
689Enter password again: <i>retype it</i>
690<comment>(OK to accept the default here, hit Enter)</comment>
691Lock out the account after creation? [no]:
692Username : fred
693Password : *****
694Full Name : Fred Smith
695<comment>(This will vary)</comment>
696Uid : 1002
697Class :
698Groups : fred wheel portage
699Home : /home/fred
700Shell : /bin/bash
701Locked : no
702<comment>(Confirm the information is correct)</comment>
703OK? (yes/no): <i>yes</i>
704adduser: INFO: Sucessfully added (fred) to the user database
705Add another user? (yes/no): <i>no</i>
706Goodbye!
707#
377</pre> 708</pre>
378 709
379<p> 710<p>
380Congratulations, you have just finished your Gentoo/FreeBSD installation which 711Congratulations, you have just finished your Gentoo/FreeBSD installation which
381you can start exploring after the final reboot. Have fun! 712you can start exploring after the final reboot. Have fun!
400There are many things you could help with, depending on your skill level and 731There are many things you could help with, depending on your skill level and
401spare time: 732spare time:
402</p> 733</p>
403 734
404<ul> 735<ul>
405 <li>
406 We need GCC and binutils hackers who are able to port FreeBSD's patches to
407 the original versions of these tools provided by our main Portage tree.
408 </li>
409 <li> 736 <li>
410 Working on current ebuilds: this means working closely with ebuild 737 Working on current ebuilds: this means working closely with ebuild
411 maintainers in order to create patches or modify ebuilds in a way that can 738 maintainers in order to create patches or modify ebuilds in a way that can
412 be accepted into the main tree. 739 be accepted into the main tree.
413 </li> 740 </li>
427 will be discovered, which helps us improving the quality of the port. If 754 will be discovered, which helps us improving the quality of the port. If
428 you are good at describing bugs or problems, we definitely want to hear 755 you are good at describing bugs or problems, we definitely want to hear
429 from you. 756 from you.
430 </li> 757 </li>
431 <li> 758 <li>
432 Other areas where we need help include: system ebuilds, baselayout, 759 Other areas where we need help include: system ebuilds, creation of
433 creation of installation CDs, documentation, kernel hacking. 760 installation CDs, documentation, kernel hacking.
434 </li> 761 </li>
435</ul> 762</ul>
436 763
437</body> 764</body>
438</section> 765</section>
439<section>
440<title>Building the system and dealing with issues</title>
441<body>
442 766
443<p>
444Although Linux and FreeBSD both are Unix-like operating systems, there are some
445important differences you have to know about if you want to contribute to our
446development effort:
447</p>
448
449<ul>
450 <li>
451 FreeBSD doesn't use the GNU autotools (autoconf, automake, autoheader).
452 Instead, it uses its own implementation of <c>make</c>, putting
453 configuration options in external files and some .mk files that are
454 included with each Makefile. Although a lot of work has been put into
455 those .mk files, it is not hard to find some installations failing due to
456 a missing <c>${INSTALL}&nbsp;-d</c> somewhere. The easy way to deal with
457 this kind of problem is to read the Makefile to find the accompanying .mk
458 file, then open that file and try to figure out which part failed (this is
459 not really hard once you figure out where in the installation process it
460 stopped).
461 </li>
462 <li>
463 Besides, due to the fact that FreeBSD is a complete operating system, you
464 won't find things like a FreeBSD kernel tarball for download on a web site.
465 The system is meant to be concise, thus whenever you start making an ebuild
466 for something that uses system sources, you are very likely to run into
467 problems when it tries to access non-existent files or directories. This
468 generally occurs when a Makefile points to <path>${.CURDIR}/../sys</path>,
469 or when a Makefile has a source dependency on another system package. There
470 is no default rule on dealing with such issues, but generally one of the
471 following procedures helps:
472 <ul>
473 <li>
474 If the ebuild is trying to access kernel sources, patch it to point to
475 <path>/usr/src/sys</path>
476 </li>
477 <li>
478 If it's trying to access some other source that is provided by the
479 system, it's easier to add it to <c>$SRC_URI</c> and unpack it to
480 <c>$WORKDIR</c>
481 </li>
482 </ul>
483 </li>
484 <li>
485 In order to maintain a concise buildsystem, we have several tarballs which
486 are grouped by their functionality. This means that system libraries can be
487 found in the freebsd-lib tarball, which contains the sources you would
488 usually find in /usr/src/lib. On the other hand, freebsd-usrsbin contains
489 <path>/usr/sbin/*</path> tools and consists of sources from
490 <path>/usr/src/usr.sbin</path>.
491 </li>
492</ul>
493
494</body>
495</section>
496<section> 767<section>
497<title>Known issues</title> 768<title>Known issues</title>
498<body> 769<body>
499 770
500<p> 771<p>
504 775
505<ul> 776<ul>
506 <li> 777 <li>
507 Some init scripts depend on the clock service which we don't provide right 778 Some init scripts depend on the clock service which we don't provide right
508 now. You can just remove it from the dependencies of the script and report 779 now. You can just remove it from the dependencies of the script and report
509 that on our <uri link="http://bugs.gentoo.org/">bugzilla</uri>. Please 780 that on our <uri link="http://bugs.gentoo.org/">Bugzilla</uri>. Please
510 remember to use the "Gentoo BSD" product for your submission. 781 remember to use the "Gentoo/Alt" product for your submission.
511 </li> 782 </li>
512 <li>glib and gnome in general need a lot of fixes to be backported.</li>
513</ul> 783</ul>
514 784
515</body> 785</body>
516</section> 786</section>
517</chapter> 787</chapter>

Legend:
Removed from v.1.14  
changed lines
  Added in v.1.24

  ViewVC Help
Powered by ViewVC 1.1.20