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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.30 - (hide annotations) (download) (as text)
Tue May 20 18:38:54 2008 UTC (6 years, 2 months ago) by swift
Branch: MAIN
Changes since 1.29: +3 -3 lines
File MIME type: application/xml
Coding style

1 cam 1.4 <?xml version="1.0" encoding="UTF-8"?>
2 swift 1.30 <!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/gentoo-freebsd.xml,v 1.29 2007/05/17 15:50:28 cam Exp $ -->
3 neysx 1.1 <!DOCTYPE guide SYSTEM "/dtd/guide.dtd">
4    
5     <guide link="/doc/en/gentoo-freebsd.xml">
6     <title>A short guide to Gentoo/FreeBSD</title>
7    
8     <author title="Author">
9     <mail link="ignacio.arquelatour@gmail.com">Ignacio Arque-Latour</mail>
10     </author>
11     <author title="Author">
12     <mail link="citizen428@gentoo.org">Michael Kohl</mail>
13     </author>
14     <author title="Author">
15 rane 1.8 <mail link="angusyoung@gentoo.org">Otavio R. Piske</mail>
16 neysx 1.1 </author>
17     <author title="Author">
18     <mail link="ka0ttic@gentoo.org">Aaron Walker</mail>
19     </author>
20 nightmorph 1.21 <author title="Author">
21     <mail link="chriswhite@gentoo.org">Chris White</mail>
22     </author>
23 nightmorph 1.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>
29 cam 1.26 <author title="Editor">
30     <mail link="cam@gentoo.org">Camille Huot</mail>
31     </author>
32 neysx 1.1
33     <abstract>
34     This document gives some general information on FreeBSD, as well as
35     installation instructions for Gentoo/FreeBSD. It also includes some reference
36     for people interested in helping out with development.
37     </abstract>
38    
39     <!-- The content of this document is licensed under the CC-BY-SA license -->
40     <!-- See http://creativecommons.org/licenses/by-sa/2.5 -->
41     <license/>
42    
43 cam 1.29 <version>2.11</version>
44     <date>2007-05-17</date>
45 neysx 1.1
46     <chapter>
47     <title>Introduction to FreeBSD</title>
48     <section>
49     <title>What is FreeBSD?</title>
50     <body>
51    
52     <p>
53     <uri link="http://www.freebsd.org/">FreeBSD</uri> is a free (<uri
54     link="http://www.freebsd.org/copyright/freebsd-license.html">license</uri>)
55     Unix-like operating system. Back in 1993 when development of <uri
56     link="http://www.386bsd.org/">386BSD</uri> stopped, two projects were born:
57     <uri link="http://www.netbsd.org/">NetBSD</uri>, commonly known to run on a
58 nightmorph 1.19 huge number of architectures, and FreeBSD which supports the x86, amd64, ia64,
59 nightmorph 1.23 sparc64 and alpha platforms. FreeBSD is renowned for its stability, performance
60 nightmorph 1.19 and security, thus being used from small to huge companies all over the world.
61 nightmorph 1.23 </p>
62    
63     <p>
64 cam 1.27 FreeBSD's current production release is version 6.2. Gentoo/FreeBSD is based on
65     this version and older versions of Gentoo/FreeBSD are discontinued and no
66     longer supported.
67 neysx 1.1 </p>
68    
69     </body>
70     </section>
71     <section>
72     <title>What is Gentoo/FreeBSD?</title>
73     <body>
74    
75     <p>
76 nightmorph 1.20 <uri link="/proj/en/gentoo-alt/bsd/fbsd/">Gentoo/FreeBSD</uri> is a subproject
77     of the <uri link="/proj/en/gentoo-alt/">Gentoo/Alt project</uri>, with the
78     goal of providing a fully-capable FreeBSD operating system featuring design
79     sensibilities taken from Gentoo Linux, such as the init system and the Portage
80     package management system.
81 neysx 1.1 </p>
82    
83     </body>
84     </section>
85     <section>
86     <title>FreeBSD and Linux</title>
87     <body>
88    
89     <p>
90     Users migrating from Linux to FreeBSD commonly consider the two operating
91     systems "almost the same". In fact, FreeBSD really shares a lot of similarities
92     with Linux distributions in general. Nevertheless, it has some key differences
93     that are worth noting:
94     </p>
95    
96     <ul>
97     <li>
98     Contrary to Linux, which actually only refers to the kernel, FreeBSD is a
99     complete operating system, consisting of a C library, userland tools and
100     much more. This development approach makes the overall system very
101 cam 1.4 consistent.
102 neysx 1.1 </li>
103     <li>
104     Contrary to the Linux kernel, FreeBSD development is not led by one person,
105     but instead managed by a small group of people called the <uri
106     link="http://www.freebsd.org/doc/en_US.ISO8859-1/articles/contributors/staff-core.html">Core
107     Team</uri>.
108     </li>
109     </ul>
110    
111     <p>
112     Besides, FreeBSD also has some technical differences which set it apart
113     from Linux. Some of them are very important to know, even if you don't plan on
114     joining the Gentoo/FreeBSD development effort:
115     </p>
116    
117     <ul>
118     <li>
119 cam 1.4 To get run-time dynamic linking functions like <c>dlopen()</c>, programs do
120 neysx 1.1 not need to be linked against libdl like on GNU/Linux. Instead they are
121 cam 1.4 linked against libc.
122 neysx 1.1 </li>
123     <li>
124     FreeBSD doesn't have an official tool for kernel compilation, thus you'll
125 cam 1.4 have to resolve feature dependencies on your own.
126 neysx 1.1 </li>
127     <li>
128     FreeBSD uses UFS/UFS-2 as its filesystems and has no official support for
129     e.g. ReiserFS or XFS. However, there are projects for adding read-only
130 cam 1.4 support for these filesystems. Accessing ext2/ext3 partitions is already
131     possible, but you cannot install your system on them.
132 neysx 1.1 </li>
133     </ul>
134    
135     </body>
136     </section>
137     </chapter>
138    
139     <chapter>
140     <title>Installing Gentoo/FreeBSD</title>
141     <section>
142 nightmorph 1.21 <title>Booting the CD</title>
143 neysx 1.1 <body>
144    
145     <p>
146     After this short introduction, it's about time to finally install
147     Gentoo/FreeBSD. Unfortunately, we currently lack our own installation media, so
148     you have to choose between two alternative installation methods. The first
149     would be to use an existing FreeBSD installation to partition your hard drive
150 nightmorph 1.21 and use it as a base for installing Gentoo/FreeBSD. This guide will describe how
151     to use the <uri link="http://www.freesbie.org/">FreeSBIE LiveCD</uri> as
152 neysx 1.1 an installation medium for Gentoo/FreeBSD.
153     </p>
154    
155 neysx 1.15 <note>
156     If you are intending to use FreeSBIE for installing Gentoo/FreeBSD, please make
157 nightmorph 1.23 sure to use a version based on FreeBSD 6.x, such as FreeSBIE 2.0 (or one of its
158     release candidates). You can download it from <uri
159     link="http://torrent.freesbie.org/">FreeSBIE's Bittorrent tracker</uri>.
160 neysx 1.15 </note>
161    
162 nightmorph 1.21 <p>
163     First, boot the CD in order to begin the installation process. You'll be
164     presented with a login screen. The username is <c>freesbie</c>, and there is
165     no password. Next, run <c>sudo su</c> to become root, and optionally setup a
166     password. If you want to pass time during the installation process, you can run
167     <c>startx</c> to enter into an Xfce environment, suitable for web browsing,
168     AIM, and other things. Unlike Linux, FreeBSD bases the name of your interface
169     on the driver for the interface. For example, the Intel EtherExpress driver
170     (fxp) appears as fxp0 (driver fxp, first network card). To see what your
171     interface is, use <c>ifconfig</c>:
172     </p>
173    
174     <pre caption="Finding out the network interface name using ifconfig">
175     # <i>ifconfig</i>
176     fxp0: flags=8843&lt;UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST&gt; mtu 1500
177     options=8&lt;VLAN_MTU&gt;
178     inet6 fe80::2d0::b7ff:febc:4fe3%fxp0 prefixlen 64 scopeid 0x1
179     inet 192.168.0.106 netmask 0xffffff00 broadcast 192.168.0.255
180     ether 00:d0:b7:bc:4f:e3
181     media: Ethernet autoselect (100baseTX &lt;full-duplex&gt;)
182     status: active
183     lo0: flags=8007&lt;LOOPBACK,MULTICAST&gt; mtu 16384
184     </pre>
185    
186     <p>
187     If the original DHCP request during the CD bootup failed, you can use the
188     <c>dhclient</c> command to obtain an IP:
189     </p>
190    
191     <pre caption="Obtaining a DHCP address using dhclient">
192     # <i>dhclient fxp0</i>
193     DHCPDISCOVER on fxp0 to 255.255.255.255 port 67 interval 9
194     DHCPOFFER from 192.168.0.1
195     DHCPREQUEST on fxp0 to 255.255.255.255 port 67
196     DHCPACK from 192.168.0.1
197     bound to 192.168.0.106 -- renewal in 302400 seconds
198     </pre>
199    
200     <note>
201     The output presented here will differ based on your network.
202     </note>
203    
204     </body>
205     </section>
206     <section>
207     <title>Partitioning the Drive</title>
208     <body>
209    
210 neysx 1.1 <p>
211 nightmorph 1.21 Now that we have a mount point, it's time to partition the drive. This is done
212     with the <c>sysinstall</c> command:
213 neysx 1.15 </p>
214    
215 nightmorph 1.21 <pre caption="Running the sysinstall command to fdisk the drive">
216     # <i>sysinstall diskPartitionEditor diskPartitionWrite</i>
217 neysx 1.15 </pre>
218    
219     <p>
220 nightmorph 1.21 We recommend that you use the default layout. Press enter at the dialog, then
221     press <b>a</b> followed by <b>q</b> to accept the default layout. The next
222     screen will present you with the option of a bootloader. For this option,
223     choose "None" as we'll be installing the bootloader later on. Next comes the
224     actual partition sizing and mount points.
225 neysx 1.1 </p>
226    
227     <p>
228 nightmorph 1.21 This next step also uses <c>sysinstall</c>, but with different arguments:
229 neysx 1.1 </p>
230    
231 nightmorph 1.21 <pre caption="Running sysinstall to setup partition sizing and mount points">
232     # <i>sysinstall diskLabelEditor diskLabelCommit</i>
233 neysx 1.1 </pre>
234    
235     <p>
236 nightmorph 1.21 Here, we'll refrain from using the automatic layout, and create one giant root
237     partition, followed by a swap partition. Hit <b>c</b> to create a new
238     partition. A dialog prompts you to enter a size. Go ahead and do so, using
239     MB/GB for setting different sizes, or C for cylinders. For root, choose FS as
240 cam 1.26 the partition type, and set the mount point as <path>/mnt/</path>. <e>If
241 nightmorph 1.21 you do not adjust the mount point, it will overwrite the FreeSBIE
242 nightmorph 1.22 environment!</e> As <path>/boot</path> is not a separate partition, you'll
243 nightmorph 1.21 need to disable soft-updates, or your system will not boot! To do so, use the
244     arrow keys to navigate to your newly created partition, then hit the <b>s</b>
245     key, until "Newfs" contains no <b>+S</b>. Now navigate the arrow keys until
246     the "Disk" line is highlighted, and hit <b>c</b> again to create a swap
247     partition. Generally, we recommend a swap space that is twice the size of your
248     RAM. Choose SWAP as the partition type, and don't worry about soft-updates, as
249     it does not apply to swap. Now we're finished, so hit <b>q</b> to finish the
250     process.
251     </p>
252    
253     <p>
254 nightmorph 1.23 When choosing a different mountpoint than <path>/</path> for your partition,
255     <c>sysinstall</c> will actually create a 'd' slice, which the bootloader won't
256     boot from. To fix this, run the following:
257     </p>
258    
259     <pre caption="Fixing the root partition letter">
260 cam 1.29 # <i>disklabel ad0s1 | sed 's/^ d:/ a:/' | disklabel -R ad0s1 /dev/stdin</i>
261 nightmorph 1.23 </pre>
262    
263     <p>
264 nightmorph 1.21 This will finalize the partitioning process, and format the drive in UFS for
265     FreeBSD to utilize. This will also mount the drive for you at the mount point
266 cam 1.26 specified earlier (<path>/mnt/</path>). You can verify this worked by
267 nightmorph 1.21 running <c>mount</c>:
268 neysx 1.15 </p>
269    
270 nightmorph 1.21 <pre caption="Verifying the new disk layout was mounted with mount">
271     # <i>mount</i>
272     ...
273 cam 1.26 /dev/ad0s1a on /mnt (ufs, local)
274 neysx 1.15 </pre>
275    
276     <p>
277 swift 1.30 Now that you have mounted the target partition, it is time to start on the
278     Gentoo setup.
279 nightmorph 1.21 </p>
280    
281     </body>
282     </section>
283     <section>
284     <title>Gentoo Setup</title>
285     <body>
286    
287     <p>
288     First, we need to download a stage3 tarball and unpack it into the chroot.
289     Point your browser to
290     <uri>http://gentoo.osuosl.org/experimental/x86/freebsd/stages/</uri>, grab the
291     latest snapshot, and unpack it into the mountpoint:
292 neysx 1.1 </p>
293    
294     <pre caption="Obtaining and unpacking a stage3 tarball">
295 cam 1.26 # <i>cd /mnt/</i>
296 neysx 1.1 <comment>(Any other Gentoo mirror which includes the experimental/ directory will also work.)</comment>
297 nightmorph 1.25 # <i>wget http://gentoo.osuosl.org/experimental/x86/freebsd/stages/stage3-x86-freebsd-6.2.tar.bz2</i>
298     # <i>tar -jxvpf stage3-x86-freebsd-6.2.tar.bz2</i>
299 neysx 1.1 <comment>(You can delete the tarball with the following command if you want to.)</comment>
300 nightmorph 1.25 # <i>rm stage3-x86-freebsd-6.2.tar.bz2</i>
301 rane 1.3 </pre>
302    
303 nightmorph 1.23 <note>
304     If you want you can use the transition overlay that contains semi-experimental
305     ebuilds with patches not yet in the main Portage tree, but does allow a wider
306     range of supported packages, please refer to the <uri
307 nightmorph 1.21 link="/proj/en/gentoo-alt/contribute/index.xml?part=1&amp;chap=3">Gentoo/ALT
308 nightmorph 1.23 overlay documentation</uri>. Please note that the overlay is not critical and
309     you can easily install and use Gentoo/FreeBSD without it.
310     </note>
311 jkt 1.7
312     <p>
313 neysx 1.1 In order for your install to work, you need to mount the <path>/dev</path>
314     filesystem from the currently running system into the Gentoo/FreeBSD mount
315     point before proceeding with the chroot.
316     </p>
317    
318     <pre caption="Mounting the /dev filesystem and chrooting">
319 cam 1.26 # <i>mount -t devfs none /mnt/dev/</i>
320     # <i>cp /etc/resolv.conf /mnt/etc/</i>
321     # <i>chroot /mnt/ /bin/bash</i>
322 nightmorph 1.21 # <i>env-update &amp;&amp; source /etc/profile</i>
323 neysx 1.1 </pre>
324    
325     <p>
326 nightmorph 1.24 After you obtain the Gentoo/FreeBSD overlay, it's time to link
327     <path>/etc/make.profile</path> to the correct profile and get your
328 neysx 1.1 <path>/etc/make.conf</path> ready for Gentoo/FreeBSD.
329     </p>
330    
331 rane 1.17 <p>
332     Now, you have to obtain a copy of the main Gentoo Portage tree, which depending
333     on your connection might take quite a while.
334     </p>
335    
336     <pre caption="Obtaining the Portage tree">
337     # <i>emerge --sync</i>
338     <comment>(It's also possible to retrieve the Portage tree in another way:)</comment>
339     # <i>cd /</i>
340     # <i>wget http://gentoo.osuosl.org/snapshots/portage-latest.tar.bz2</i>
341     # <i>tar -xjf portage-latest.tar.bz2 -C /usr/</i>
342     # <i>emerge --metadata</i>
343     </pre>
344    
345 neysx 1.1 <pre caption="Setting up the profile and editing /etc/make.conf">
346 nightmorph 1.23 # <i>ln -sf /usr/portage/profiles/default-bsd/fbsd/6.2/x86/ /etc/make.profile</i>
347 nightmorph 1.21 # <i>nano /etc/make.conf</i>
348 neysx 1.1 <comment>(Please make sure you add at least the following entries:)</comment>
349 cam 1.29 CHOST="i686-gentoo-freebsd6.2"
350 nightmorph 1.23 FEATURES="collision-protect"
351 neysx 1.1 </pre>
352    
353 neysx 1.15 <note>
354 nightmorph 1.23 The <c>~x86-fbsd</c> keyword does not yet fully cover the same tree as
355     <c>~x86</c>, but please <e>do not</e> put <c>~x86</c> in ACCEPT_KEYWORDS. Rather
356     use <path>/etc/portage/package.keywords</path> to test packages, and report
357     working packages on <uri
358     link="http://bugs.gentoo.org/enter_bug.cgi?product=Gentoo%2FAlt">Bugzilla</uri>.
359 neysx 1.15 </note>
360    
361 neysx 1.1 <p>
362 jkt 1.11 If you want, you can now rebuild the system's core packages.
363 neysx 1.1 </p>
364    
365 nightmorph 1.20 <pre caption="Rebuilding the FreeBSD core packages (optional)">
366 neysx 1.1 # <i>emerge -e system</i>
367     </pre>
368    
369 nightmorph 1.21 </body>
370     </section>
371     </chapter>
372     <chapter>
373     <title>Setting up for Booting</title>
374     <section>
375 cam 1.26 <title>Set your time zone</title>
376     <body>
377    
378     <p>
379     First make sure your date and time is set correctly using <c>date
380     yyyymmddHHMM</c>. Use UTC time.
381     </p>
382    
383     <pre caption="Set the date and UTC time">
384     <comment>(Check the clock)</comment>
385     # <i>date</i>
386     Mon Mar 6 00:14:13 UTC 2006
387    
388     <comment>(Set the current date and time if required)</comment>
389     # <i>date 200603060016</i> <comment>(Format is yyyymmddHHMM)</comment>
390     Mon Mar 6 00:16:00 UTC 2006
391     </pre>
392    
393     <p>
394     Next, set your time zone information by using the correct listing in
395     <path>/usr/share/zoneinfo</path>.
396     </p>
397    
398     <pre caption="Setting your timezone">
399     # <i>ls /usr/share/zoneinfo</i>
400     <comment>(Using Brussels as an example)</comment>
401     # <i>cp /usr/share/zoneinfo/Europe/Brussels /etc/localtime</i>
402    
403     # <i>date</i>
404     Wed Mar 8 00:46:05 CET 2006
405     </pre>
406    
407     <p>
408     Edit <path>/etc/conf.d/clock</path> to define the time zone you used
409     previously.
410     </p>
411    
412     <pre caption="Edit /etc/conf.d/clock">
413     # <i>nano -w /etc/conf.d/clock</i>
414     TIMEZONE="Europe/Brussels"
415     </pre>
416    
417     </body>
418     </section>
419     <section>
420 nightmorph 1.21 <title>Kernel Installation</title>
421     <body>
422    
423 jkt 1.11 <p>
424 nightmorph 1.21 If you ran <c>emerge -e system</c>, the sources for the FreeBSD kernel were
425 cam 1.12 installed to <path>/usr/src/sys</path>. If you skipped this step, you can get
426 jkt 1.11 them in the following way:
427     </p>
428    
429 nightmorph 1.20 <pre caption="Getting the FreeBSD kernel sources">
430 jkt 1.11 # <i>emerge freebsd-sources</i>
431     </pre>
432    
433     <p>
434 nightmorph 1.21 Configuring and compiling a custom kernel is quite different from compiling
435 cam 1.12 Linux, so if you are not familiar with the process we encourage you to have a
436     look at <uri
437     link="http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig.html">
438 nightmorph 1.21 chapter 8</uri> of the FreeBSD handbook. For now, you can do an installation of
439     the GENERIC kernel, which works on most systems. To begin, enter the source
440     directory for the kernel:
441     </p>
442    
443     <impo>
444     Please note that currently only the "Traditional" way of building the kernel is
445     supported on Gentoo/FreeBSD!
446     </impo>
447    
448     <pre caption="Entering the kernel source directory">
449     # <i>cd /usr/src/sys/</i>
450     </pre>
451    
452     <p>
453     Looking over the layout, you'll see various architectures and subdirectories
454     for various parts of the kernel. To begin the installation, we head into the
455     <path>i386/conf/</path> directory:
456     </p>
457    
458     <pre caption="The kernel configuration directory">
459     # <i>cd i386/conf/</i>
460     # <i>ls</i>
461     .cvsignore GENERIC Makefile PAE
462     DEFAULTS GENERIC.hints NOTES SMP
463     </pre>
464    
465     <p>
466     The main files to note are <path>GENERIC</path> and <path>GENERIC.hints</path>.
467     As it will be needed by the installation of the kernel, go ahead and copy
468     <path>GENERIC.hints</path> file to <path>/boot/device.hints</path>:
469     </p>
470    
471     <pre caption="Copying over the GENERIC.hints file">
472     # <i>cp GENERIC.hints /boot/device.hints</i>
473     </pre>
474    
475     <p>
476     This file is used by the kernel drivers for basic configuration information
477     such as IRQ settings. Now it's time to configure the kernel. FreeBSD uses the
478     <c>config</c> command to do this. <c>config</c> uses the given file (in this
479     instance GENERIC) to copy over the required build files to a
480     <path>compile</path> directory in the parent directory. <path>GENERIC</path> is
481     similiar to the <path>.config</path> file for the Linux kernel. Run
482     <c>config</c> to produce the build directory:
483     </p>
484    
485     <pre caption="Configuring the kernel build">
486     # <i>config GENERIC</i>
487     Kernel build directory is ../compile/GENERIC
488     Don't forget to ''make cleandepend; make depend''
489     </pre>
490    
491     <p>
492     <c>config</c> has created a GENERIC build directory for us in the parent
493     directory. <c>cd</c> into it, then run the following to do a complete build:
494 jkt 1.11 </p>
495    
496 nightmorph 1.21 <pre caption="Building and installing the kernel">
497     # <i>cd ../compile/GENERIC</i>
498     # <i>make cleandepend &amp;&amp; make depend &amp;&amp; make &amp;&amp; make install</i>
499     </pre>
500    
501 jkt 1.11 <p>
502 nightmorph 1.21 This will give us a complete kernel to work with. Now we'll need to setup the
503     bootloader for the kernel to boot. The next chapter will discuss two methods of
504 nightmorph 1.23 setting up the bootloader: <c>boot0</c> and <c>grub</c>.
505     </p>
506    
507     </body>
508     </section>
509     <section>
510     <title>Setting up the bootloader (boot0)</title>
511     <body>
512    
513     <impo>
514     <c>boot0</c> is the FreeBSD bootloader. Previously, it was the only supported
515     bootloader until <c>grub</c> was introduced into ports with UFS slice support.
516     To install and configure <c>boot0</c>, run the following. Remember to replace
517     <c>adXsY</c> with the actual number and slice of your disk.
518     </impo>
519    
520     <pre caption="Installing and setting up boot0">
521     # <i>emerge boot0</i>
522     <comment>(Leave the chroot environment)</comment>
523     # <i>exit</i>
524     <comment>(Issued from outside the chroot)</comment>
525 cam 1.26 # <i>fdisk -B -b /mnt/boot/boot0 /dev/adX</i>
526     # <i>chroot /mnt/ /bin/bash</i>
527 nightmorph 1.23 # <i>disklabel -B adXsY</i>
528     </pre>
529    
530     <p>
531     If you need additional information on setting up <c>boot0</c>, please consult
532     <uri
533     link="http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/boot.html">chapter
534     12</uri> of the FreeBSD handbook. Now it's time to do some basic system
535     configuration and settings.
536     </p>
537    
538     <p>
539     The next section will look at using the alternative bootloader, <c>grub</c>.
540 nightmorph 1.21 </p>
541    
542     </body>
543     </section>
544     <section>
545     <title>Setting up the bootloader (grub)</title>
546     <body>
547    
548     <p>
549     As of grub 0.97-r1, UFS slices are readable to <c>grub</c>. This lets us use
550     <c>grub</c> as a bootloader, the prefered method for those coming from a Linux
551     background. To begin, emerge <c>grub</c> and setup the label as bootable.
552     Remember to replace <c>adXsY</c> with the actual number and slice of your disk.
553     </p>
554    
555     <pre caption="Emerge grub">
556     # <i>emerge grub</i>
557     # <i>disklabel -B adXsY</i>
558     </pre>
559    
560     <p>
561     Now run <c>grub</c> to bring up the command prompt, and set up the partition as
562     shown:
563     </p>
564    
565     <pre caption="Setting up grub">
566     <comment>(This is done to prevent disk error 29)</comment>
567     # <i>sysctl kern.geom.debugflags=16</i>
568     # <i>grub</i>
569     <comment>(Example using ad0s1d)</comment>
570     grub&gt; <i>root (hd0,0,d)</i>
571     Filesystem type is ufs2, partition type 0xa5
572    
573     grub&gt; <i>setup (hd0)</i>
574     Checking if "/boot/grub/stage1" exists... yes
575     Checking if "/boot/grub/stage2" exists... yes
576     Checking if "/boot/grub/ufs2_stage1_5" exists... yes
577     Running "embed /boot/grub/ufs2_stage1_5 (hd0)"... 14 sectors are embedded.
578     succeeded
579     Running "install /boot/grub/stage1 (hd0) (hd0)1+14 p (hd0,0,d)/boot/grub/stage
580     2 /boot/grub/menu.lst"... succeeded
581     Done.
582    
583     grub&gt; quit
584     </pre>
585    
586     <p>
587 cam 1.26 To make the loader find the kernel on a specific slice (the default is 'a'),
588     add a <c>vfs.root.mountfrom</c> line to the <path>/boot/loader.conf</path>
589     file:
590     </p>
591    
592     <pre caption="Tell the loader where to look for the kernel">
593     # <i>echo 'vfs.root.mountfrom="ufs:ad0s1d"' >> /boot/loader.conf</i>
594     </pre>
595    
596     <p>
597 nightmorph 1.21 When you first boot, you may not receive a grub menu. If so, run this at the
598     prompt:
599     </p>
600    
601     <pre caption="Booting the kernel with no menu">
602     grub&gt; <i>find /boot/grub/stage1</i>
603     <comment>(The output here is what you'll use in the next command)</comment>
604     (hd0,0,d)
605    
606     grub&gt; <i>kernel (hd0,0,d)/boot/loader</i>
607     [FreeBSD-a.out, loadaddr=0x200000, text=0x1000, data=0x3a000, bss=0x0, entry=0x200000]
608    
609     grub&gt; <i>boot</i>
610     </pre>
611    
612 nightmorph 1.23 <note>
613     For more information on configuring grub, please refer to the <uri
614     link="/doc/en/handbook/handbook-x86.xml?part=1&amp;chap=10#doc_chap2">Gentoo
615     Linux Handbook</uri>.
616     </note>
617 jkt 1.11
618 cam 1.26 <warn>
619     Grub doesn't follow UFS symlinks so be sure to delete the
620     <path>/boot/grub/menu.lst</path> symlink and to use <path>menu.lst</path> to
621     setup Grub (<path>grub.conf</path> isn't used).
622     </warn>
623    
624 nightmorph 1.21 </body>
625     </section>
626     <section>
627     <title>System configuration</title>
628     <body>
629    
630 jkt 1.11 <p>
631 nightmorph 1.21 First, we are going to setup the filesystem mounting points in
632     <path>/etc/fstab</path>.
633 jkt 1.11 </p>
634    
635     <pre caption="Editing the filesystem in /etc/fstab">
636 nightmorph 1.21 # <i>nano /etc/fstab</i>
637 jkt 1.11 <comment>(This is an example, replace X and Y with the correct numbers for your hard disk.)</comment>
638     #Device Mountpoint Fstype Options Dump Pass
639     /dev/adXsYb none swap sw 0 0
640     /dev/adXsYa / ufs rw 1 1
641     /dev/adXsYe /usr/home ufs rw 2 2
642     /dev/adXsYd /tmp ufs rw 2 2
643     /dev/acdX /cdrom cd9660 ro,noauto 0 0
644     </pre>
645    
646     <p>
647     Now would also be a good time to set up your network connection before the final
648 nightmorph 1.21 reboot. You can find all the information necessary to configure your network in
649     the <uri link="/doc/en/handbook/handbook-x86.xml?part=4&amp;chap=1">Gentoo
650     Handbook</uri>. To have your network interface activated at boot time, you have
651     to add it to the default runlevel:
652 vanquirius 1.13 </p>
653    
654     <pre caption="Adding your network adapter to the default runlevel">
655 nightmorph 1.21 # <i>rc-update add net.fxp0 default</i>
656 vanquirius 1.13 </pre>
657    
658     <p>
659 rane 1.18 Your system's hostname can be changed in <path>/etc/conf.d/hostname</path>.
660 jkt 1.11 </p>
661    
662     <pre caption="Setting up the machine's hostname">
663 nightmorph 1.21 # <i>nano /etc/conf.d/hostname</i>
664 rane 1.17 <comment>(Set the HOSTNAME variable to your hostname)</comment>
665     HOSTNAME="tux"
666     </pre>
667    
668     <p>
669     You should also configure your domain name, which is done in the
670     <path>/etc/conf.d/domainname</path> file:
671     </p>
672    
673     <pre caption="Setting the domainname">
674 nightmorph 1.21 # <i>nano /etc/conf.d/domainname</i>
675 nightmorph 1.23 <comment>(Set the dns_domain variable to your domain name, and lo to your local
676     network interface)</comment>
677     dns_domain_lo="homenetwork"
678 rane 1.17 </pre>
679    
680     <p>
681     If you have a NIS domain, you need to define it in the
682     <path>/etc/conf.d/domainname</path> file:
683     </p>
684    
685     <pre caption="Setting the NIS domainname">
686 nightmorph 1.21 # <i>nano /etc/conf.d/domainname</i>
687 nightmorph 1.23 <comment>(Set the nis_domain variable to your NIS domain name, and lo to your local network interface)</comment>
688     nis_domain_lo="my-nisdomain"
689 jkt 1.11 </pre>
690    
691 nightmorph 1.23 <note>
692     For more information on domainnames and networking, please refer to the <uri
693     link="/doc/en/handbook/handbook-x86.xml?part=1&amp;chap=8#doc_chap2">Gentoo
694     Linux Handbook</uri>, and please read the documentation in
695     <path>/etc/conf.d/net.example</path>.
696     </note>
697    
698 jkt 1.11 <p>
699 cam 1.12 In case you need to use another keyboard layout for your language, you have to
700     set the correct value in <path>/etc/conf.d/syscons</path>. The following example
701     uses the Spanish layout, so you'll have to adjust it to your need if you want to
702     use another one.
703 jkt 1.11 </p>
704    
705     <pre caption="Changing your keyboard layout (Optional)">
706 nightmorph 1.21 # <i>nano /etc/conf.d/syscons</i>
707 jkt 1.11 KEYMAP="spanish.iso.acc"
708     <comment>(Possible layouts can be found in /usr/share/syscons/keymaps).</comment>
709     </pre>
710    
711 fox2mike 1.2 <p>
712 cam 1.12 Now would be a good time to set a password for the <c>root</c> user and to add
713 jkt 1.11 another user account for your day-to-day work.
714 fox2mike 1.2 </p>
715    
716 jkt 1.11 <pre caption="Changing the root password and adding a new user">
717     # <i>passwd</i>
718     # <i>adduser</i>
719 nightmorph 1.21 Username: <i>fred</i>
720     Full Name: <i>Fred Smith</i>
721     <comment>(Accepting the default here, just hit Enter.)</comment>
722     Uid (Leave empty for default):
723     <comment>(OK to accept the default here as well; hit Enter.)</comment>
724     Login group [fred]:
725     <comment>(Enter your groups here, space separated. They must exist.)</comment>
726     Login group is fred. Invite fred into other groups? []: wheel portage
727     <comment>(OK to accept the default here, hit Enter)</comment>
728     Login class [default]:
729     <comment>(Somewhat of a personal preference. Make sure the shell exists in /etc/shells)</comment>
730     Shell (sh bash tcsh csh esh ksh zsh sash nologin) [sh] <i>bash</i>
731     <comment>(OK to accept the default here, hit Enter for all these)</comment>
732     User password-based authentication [yes]
733     Use an empty password (yes/no) [no]:
734     Use a random password? (yes/no) [no]:
735     Enter password: <i>password goes here</i>
736     Enter password again: <i>retype it</i>
737     <comment>(OK to accept the default here, hit Enter)</comment>
738     Lock out the account after creation? [no]:
739     Username : fred
740     Password : *****
741     Full Name : Fred Smith
742     <comment>(This will vary)</comment>
743     Uid : 1002
744     Class :
745     Groups : fred wheel portage
746     Home : /home/fred
747     Shell : /bin/bash
748     Locked : no
749     <comment>(Confirm the information is correct)</comment>
750     OK? (yes/no): <i>yes</i>
751     adduser: INFO: Sucessfully added (fred) to the user database
752     Add another user? (yes/no): <i>no</i>
753     Goodbye!
754     #
755 jkt 1.11 </pre>
756    
757 fox2mike 1.2 <p>
758 cam 1.12 Congratulations, you have just finished your Gentoo/FreeBSD installation which
759     you can start exploring after the final reboot. Have fun!
760 fox2mike 1.2 </p>
761    
762 jkt 1.11 <pre caption="Rebooting the system">
763     # <i>exit</i>
764     # <i>reboot</i>
765     </pre>
766    
767 neysx 1.1 </body>
768     </section>
769     </chapter>
770    
771     <chapter>
772     <title>Developing for Gentoo/FreeBSD</title>
773     <section>
774 cam 1.4 <title>How to help</title>
775 neysx 1.1 <body>
776    
777     <p>
778     There are many things you could help with, depending on your skill level and
779     spare time:
780     </p>
781    
782     <ul>
783     <li>
784 cam 1.12 Working on current ebuilds: this means working closely with ebuild
785     maintainers in order to create patches or modify ebuilds in a way that can
786     be accepted into the main tree.
787 neysx 1.1 </li>
788     <li>
789     Security: if you are into security, we need you! Although security
790     advisories from the FreeBSD project are tracked and fixed, we can always
791 cam 1.4 use help in this area.
792 neysx 1.1 </li>
793     <li>
794     Contacts: we need people who can get in touch with FreeBSD developers to
795     maintain contacts between us and the original project to exchange patches
796     and discuss various problems and their solutions. Note that this should
797 cam 1.4 never involve any kind of spamming of mailing lists or IRC channels.
798 neysx 1.1 </li>
799     <li>
800     Testing: the more people are actively using Gentoo/FreeBSD, the more bugs
801     will be discovered, which helps us improving the quality of the port. If
802     you are good at describing bugs or problems, we definitely want to hear
803 cam 1.4 from you.
804 neysx 1.1 </li>
805     <li>
806 nightmorph 1.23 Other areas where we need help include: system ebuilds, creation of
807     installation CDs, documentation, kernel hacking.
808 neysx 1.1 </li>
809     </ul>
810    
811     </body>
812     </section>
813    
814     <section>
815     <title>Known issues</title>
816     <body>
817    
818     <p>
819     At the moment, there are still quite a lot of known issues. Here are the ones
820     really worth noting:
821     </p>
822    
823     <ul>
824     <li>
825     Some init scripts depend on the clock service which we don't provide right
826     now. You can just remove it from the dependencies of the script and report
827 nightmorph 1.23 that on our <uri link="http://bugs.gentoo.org/">Bugzilla</uri>. Please
828     remember to use the "Gentoo/Alt" product for your submission.
829 neysx 1.15 </li>
830 neysx 1.1 </ul>
831    
832     </body>
833     </section>
834     </chapter>
835    
836     <chapter>
837     <title>Contact</title>
838     <section>
839     <body>
840    
841     <p>
842 cam 1.4 A list of Gentoo/FreeBSD developers can be found at the <uri
843 neysx 1.1 link="/proj/en/gentoo-alt/bsd/fbsd/">project page</uri>. Other ways to contact
844     Gentoo/FreeBSD developers include our IRC Channel <c>#gentoo-bsd</c> on
845 jkt 1.6 Freenode, as well as the <uri link="/main/en/lists.xml">gentoo-bsd mailing
846     list</uri>.
847 neysx 1.1 </p>
848    
849     </body>
850     </section>
851     </chapter>
852     </guide>

  ViewVC Help
Powered by ViewVC 1.1.20