/[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.27 - (hide annotations) (download) (as text)
Thu May 10 23:59:40 2007 UTC (7 years, 7 months ago) by cam
Branch: MAIN
Changes since 1.26: +4 -5 lines
File MIME type: application/xml
Fixed notice about 6.2 release

1 cam 1.4 <?xml version="1.0" encoding="UTF-8"?>
2 cam 1.27 <!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/gentoo-freebsd.xml,v 1.26 2007/05/10 22:00:51 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.26 <version>2.9</version>
44     <date>2007-05-10</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.26 # <i>disklabel ad0s1 | sed 's/^ d:/ a:/' > label</i>
261     # <i>disklabel -R ad0s1 label</i>
262 nightmorph 1.23 </pre>
263    
264     <p>
265 nightmorph 1.21 This will finalize the partitioning process, and format the drive in UFS for
266     FreeBSD to utilize. This will also mount the drive for you at the mount point
267 cam 1.26 specified earlier (<path>/mnt/</path>). You can verify this worked by
268 nightmorph 1.21 running <c>mount</c>:
269 neysx 1.15 </p>
270    
271 nightmorph 1.21 <pre caption="Verifying the new disk layout was mounted with mount">
272     # <i>mount</i>
273     ...
274 cam 1.26 /dev/ad0s1a on /mnt (ufs, local)
275 neysx 1.15 </pre>
276    
277     <p>
278 nightmorph 1.21 Now that you have mounted the target partition, it is time to start on the Gentoo
279     setup.
280     </p>
281    
282     </body>
283     </section>
284     <section>
285     <title>Gentoo Setup</title>
286     <body>
287    
288     <p>
289     First, we need to download a stage3 tarball and unpack it into the chroot.
290     Point your browser to
291     <uri>http://gentoo.osuosl.org/experimental/x86/freebsd/stages/</uri>, grab the
292     latest snapshot, and unpack it into the mountpoint:
293 neysx 1.1 </p>
294    
295     <pre caption="Obtaining and unpacking a stage3 tarball">
296 cam 1.26 # <i>cd /mnt/</i>
297 neysx 1.1 <comment>(Any other Gentoo mirror which includes the experimental/ directory will also work.)</comment>
298 nightmorph 1.25 # <i>wget http://gentoo.osuosl.org/experimental/x86/freebsd/stages/stage3-x86-freebsd-6.2.tar.bz2</i>
299     # <i>tar -jxvpf stage3-x86-freebsd-6.2.tar.bz2</i>
300 neysx 1.1 <comment>(You can delete the tarball with the following command if you want to.)</comment>
301 nightmorph 1.25 # <i>rm stage3-x86-freebsd-6.2.tar.bz2</i>
302 rane 1.3 </pre>
303    
304 nightmorph 1.23 <note>
305     If you want you can use the transition overlay that contains semi-experimental
306     ebuilds with patches not yet in the main Portage tree, but does allow a wider
307     range of supported packages, please refer to the <uri
308 nightmorph 1.21 link="/proj/en/gentoo-alt/contribute/index.xml?part=1&amp;chap=3">Gentoo/ALT
309 nightmorph 1.23 overlay documentation</uri>. Please note that the overlay is not critical and
310     you can easily install and use Gentoo/FreeBSD without it.
311     </note>
312 jkt 1.7
313     <p>
314 neysx 1.1 In order for your install to work, you need to mount the <path>/dev</path>
315     filesystem from the currently running system into the Gentoo/FreeBSD mount
316     point before proceeding with the chroot.
317     </p>
318    
319     <pre caption="Mounting the /dev filesystem and chrooting">
320 cam 1.26 # <i>mount -t devfs none /mnt/dev/</i>
321     # <i>cp /etc/resolv.conf /mnt/etc/</i>
322     # <i>chroot /mnt/ /bin/bash</i>
323 nightmorph 1.21 # <i>env-update &amp;&amp; source /etc/profile</i>
324 neysx 1.1 </pre>
325    
326     <p>
327 nightmorph 1.24 After you obtain the Gentoo/FreeBSD overlay, it's time to link
328     <path>/etc/make.profile</path> to the correct profile and get your
329 neysx 1.1 <path>/etc/make.conf</path> ready for Gentoo/FreeBSD.
330     </p>
331    
332 rane 1.17 <p>
333     Now, you have to obtain a copy of the main Gentoo Portage tree, which depending
334     on your connection might take quite a while.
335     </p>
336    
337     <pre caption="Obtaining the Portage tree">
338     # <i>emerge --sync</i>
339     <comment>(It's also possible to retrieve the Portage tree in another way:)</comment>
340     # <i>cd /</i>
341     # <i>wget http://gentoo.osuosl.org/snapshots/portage-latest.tar.bz2</i>
342     # <i>tar -xjf portage-latest.tar.bz2 -C /usr/</i>
343     # <i>emerge --metadata</i>
344     </pre>
345    
346 neysx 1.1 <pre caption="Setting up the profile and editing /etc/make.conf">
347 nightmorph 1.23 # <i>ln -sf /usr/portage/profiles/default-bsd/fbsd/6.2/x86/ /etc/make.profile</i>
348 nightmorph 1.21 # <i>nano /etc/make.conf</i>
349 neysx 1.1 <comment>(Please make sure you add at least the following entries:)</comment>
350 nightmorph 1.23 CHOST="i486-gentoo-freebsd6.2"
351     FEATURES="collision-protect"
352 neysx 1.1 </pre>
353    
354 neysx 1.15 <note>
355 nightmorph 1.23 The <c>~x86-fbsd</c> keyword does not yet fully cover the same tree as
356     <c>~x86</c>, but please <e>do not</e> put <c>~x86</c> in ACCEPT_KEYWORDS. Rather
357     use <path>/etc/portage/package.keywords</path> to test packages, and report
358     working packages on <uri
359     link="http://bugs.gentoo.org/enter_bug.cgi?product=Gentoo%2FAlt">Bugzilla</uri>.
360 neysx 1.15 </note>
361    
362 neysx 1.1 <p>
363 jkt 1.11 If you want, you can now rebuild the system's core packages.
364 neysx 1.1 </p>
365    
366 nightmorph 1.20 <pre caption="Rebuilding the FreeBSD core packages (optional)">
367 neysx 1.1 # <i>emerge -e system</i>
368     </pre>
369    
370 nightmorph 1.21 </body>
371     </section>
372     </chapter>
373     <chapter>
374     <title>Setting up for Booting</title>
375     <section>
376 cam 1.26 <title>Set your time zone</title>
377     <body>
378    
379     <p>
380     First make sure your date and time is set correctly using <c>date
381     yyyymmddHHMM</c>. Use UTC time.
382     </p>
383    
384     <pre caption="Set the date and UTC time">
385     <comment>(Check the clock)</comment>
386     # <i>date</i>
387     Mon Mar 6 00:14:13 UTC 2006
388    
389     <comment>(Set the current date and time if required)</comment>
390     # <i>date 200603060016</i> <comment>(Format is yyyymmddHHMM)</comment>
391     Mon Mar 6 00:16:00 UTC 2006
392     </pre>
393    
394     <p>
395     Next, set your time zone information by using the correct listing in
396     <path>/usr/share/zoneinfo</path>.
397     </p>
398    
399     <pre caption="Setting your timezone">
400     # <i>ls /usr/share/zoneinfo</i>
401     <comment>(Using Brussels as an example)</comment>
402     # <i>cp /usr/share/zoneinfo/Europe/Brussels /etc/localtime</i>
403    
404     # <i>date</i>
405     Wed Mar 8 00:46:05 CET 2006
406     </pre>
407    
408     <p>
409     Edit <path>/etc/conf.d/clock</path> to define the time zone you used
410     previously.
411     </p>
412    
413     <pre caption="Edit /etc/conf.d/clock">
414     # <i>nano -w /etc/conf.d/clock</i>
415     TIMEZONE="Europe/Brussels"
416     </pre>
417    
418     </body>
419     </section>
420     <section>
421 nightmorph 1.21 <title>Kernel Installation</title>
422     <body>
423    
424 jkt 1.11 <p>
425 nightmorph 1.21 If you ran <c>emerge -e system</c>, the sources for the FreeBSD kernel were
426 cam 1.12 installed to <path>/usr/src/sys</path>. If you skipped this step, you can get
427 jkt 1.11 them in the following way:
428     </p>
429    
430 nightmorph 1.20 <pre caption="Getting the FreeBSD kernel sources">
431 jkt 1.11 # <i>emerge freebsd-sources</i>
432     </pre>
433    
434     <p>
435 nightmorph 1.21 Configuring and compiling a custom kernel is quite different from compiling
436 cam 1.12 Linux, so if you are not familiar with the process we encourage you to have a
437     look at <uri
438     link="http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig.html">
439 nightmorph 1.21 chapter 8</uri> of the FreeBSD handbook. For now, you can do an installation of
440     the GENERIC kernel, which works on most systems. To begin, enter the source
441     directory for the kernel:
442     </p>
443    
444     <impo>
445     Please note that currently only the "Traditional" way of building the kernel is
446     supported on Gentoo/FreeBSD!
447     </impo>
448    
449     <pre caption="Entering the kernel source directory">
450     # <i>cd /usr/src/sys/</i>
451     </pre>
452    
453     <p>
454     Looking over the layout, you'll see various architectures and subdirectories
455     for various parts of the kernel. To begin the installation, we head into the
456     <path>i386/conf/</path> directory:
457     </p>
458    
459     <pre caption="The kernel configuration directory">
460     # <i>cd i386/conf/</i>
461     # <i>ls</i>
462     .cvsignore GENERIC Makefile PAE
463     DEFAULTS GENERIC.hints NOTES SMP
464     </pre>
465    
466     <p>
467     The main files to note are <path>GENERIC</path> and <path>GENERIC.hints</path>.
468     As it will be needed by the installation of the kernel, go ahead and copy
469     <path>GENERIC.hints</path> file to <path>/boot/device.hints</path>:
470     </p>
471    
472     <pre caption="Copying over the GENERIC.hints file">
473     # <i>cp GENERIC.hints /boot/device.hints</i>
474     </pre>
475    
476     <p>
477     This file is used by the kernel drivers for basic configuration information
478     such as IRQ settings. Now it's time to configure the kernel. FreeBSD uses the
479     <c>config</c> command to do this. <c>config</c> uses the given file (in this
480     instance GENERIC) to copy over the required build files to a
481     <path>compile</path> directory in the parent directory. <path>GENERIC</path> is
482     similiar to the <path>.config</path> file for the Linux kernel. Run
483     <c>config</c> to produce the build directory:
484     </p>
485    
486     <pre caption="Configuring the kernel build">
487     # <i>config GENERIC</i>
488     Kernel build directory is ../compile/GENERIC
489     Don't forget to ''make cleandepend; make depend''
490     </pre>
491    
492     <p>
493     <c>config</c> has created a GENERIC build directory for us in the parent
494     directory. <c>cd</c> into it, then run the following to do a complete build:
495 jkt 1.11 </p>
496    
497 nightmorph 1.21 <pre caption="Building and installing the kernel">
498     # <i>cd ../compile/GENERIC</i>
499     # <i>make cleandepend &amp;&amp; make depend &amp;&amp; make &amp;&amp; make install</i>
500     </pre>
501    
502 jkt 1.11 <p>
503 nightmorph 1.21 This will give us a complete kernel to work with. Now we'll need to setup the
504     bootloader for the kernel to boot. The next chapter will discuss two methods of
505 nightmorph 1.23 setting up the bootloader: <c>boot0</c> and <c>grub</c>.
506     </p>
507    
508     </body>
509     </section>
510     <section>
511     <title>Setting up the bootloader (boot0)</title>
512     <body>
513    
514     <impo>
515     <c>boot0</c> is the FreeBSD bootloader. Previously, it was the only supported
516     bootloader until <c>grub</c> was introduced into ports with UFS slice support.
517     To install and configure <c>boot0</c>, run the following. Remember to replace
518     <c>adXsY</c> with the actual number and slice of your disk.
519     </impo>
520    
521     <pre caption="Installing and setting up boot0">
522     # <i>emerge boot0</i>
523     <comment>(Leave the chroot environment)</comment>
524     # <i>exit</i>
525     <comment>(Issued from outside the chroot)</comment>
526 cam 1.26 # <i>fdisk -B -b /mnt/boot/boot0 /dev/adX</i>
527     # <i>chroot /mnt/ /bin/bash</i>
528 nightmorph 1.23 # <i>disklabel -B adXsY</i>
529     </pre>
530    
531     <p>
532     If you need additional information on setting up <c>boot0</c>, please consult
533     <uri
534     link="http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/boot.html">chapter
535     12</uri> of the FreeBSD handbook. Now it's time to do some basic system
536     configuration and settings.
537     </p>
538    
539     <p>
540     The next section will look at using the alternative bootloader, <c>grub</c>.
541 nightmorph 1.21 </p>
542    
543     </body>
544     </section>
545     <section>
546     <title>Setting up the bootloader (grub)</title>
547     <body>
548    
549     <p>
550     As of grub 0.97-r1, UFS slices are readable to <c>grub</c>. This lets us use
551     <c>grub</c> as a bootloader, the prefered method for those coming from a Linux
552     background. To begin, emerge <c>grub</c> and setup the label as bootable.
553     Remember to replace <c>adXsY</c> with the actual number and slice of your disk.
554     </p>
555    
556     <pre caption="Emerge grub">
557     # <i>emerge grub</i>
558     # <i>disklabel -B adXsY</i>
559     </pre>
560    
561     <p>
562     Now run <c>grub</c> to bring up the command prompt, and set up the partition as
563     shown:
564     </p>
565    
566     <pre caption="Setting up grub">
567     <comment>(This is done to prevent disk error 29)</comment>
568     # <i>sysctl kern.geom.debugflags=16</i>
569     # <i>grub</i>
570     <comment>(Example using ad0s1d)</comment>
571     grub&gt; <i>root (hd0,0,d)</i>
572     Filesystem type is ufs2, partition type 0xa5
573    
574     grub&gt; <i>setup (hd0)</i>
575     Checking if "/boot/grub/stage1" exists... yes
576     Checking if "/boot/grub/stage2" exists... yes
577     Checking if "/boot/grub/ufs2_stage1_5" exists... yes
578     Running "embed /boot/grub/ufs2_stage1_5 (hd0)"... 14 sectors are embedded.
579     succeeded
580     Running "install /boot/grub/stage1 (hd0) (hd0)1+14 p (hd0,0,d)/boot/grub/stage
581     2 /boot/grub/menu.lst"... succeeded
582     Done.
583    
584     grub&gt; quit
585     </pre>
586    
587     <p>
588 cam 1.26 To make the loader find the kernel on a specific slice (the default is 'a'),
589     add a <c>vfs.root.mountfrom</c> line to the <path>/boot/loader.conf</path>
590     file:
591     </p>
592    
593     <pre caption="Tell the loader where to look for the kernel">
594     # <i>echo 'vfs.root.mountfrom="ufs:ad0s1d"' >> /boot/loader.conf</i>
595     </pre>
596    
597     <p>
598 nightmorph 1.21 When you first boot, you may not receive a grub menu. If so, run this at the
599     prompt:
600     </p>
601    
602     <pre caption="Booting the kernel with no menu">
603     grub&gt; <i>find /boot/grub/stage1</i>
604     <comment>(The output here is what you'll use in the next command)</comment>
605     (hd0,0,d)
606    
607     grub&gt; <i>kernel (hd0,0,d)/boot/loader</i>
608     [FreeBSD-a.out, loadaddr=0x200000, text=0x1000, data=0x3a000, bss=0x0, entry=0x200000]
609    
610     grub&gt; <i>boot</i>
611     </pre>
612    
613 nightmorph 1.23 <note>
614     For more information on configuring grub, please refer to the <uri
615     link="/doc/en/handbook/handbook-x86.xml?part=1&amp;chap=10#doc_chap2">Gentoo
616     Linux Handbook</uri>.
617     </note>
618 jkt 1.11
619 cam 1.26 <warn>
620     Grub doesn't follow UFS symlinks so be sure to delete the
621     <path>/boot/grub/menu.lst</path> symlink and to use <path>menu.lst</path> to
622     setup Grub (<path>grub.conf</path> isn't used).
623     </warn>
624    
625 nightmorph 1.21 </body>
626     </section>
627     <section>
628     <title>System configuration</title>
629     <body>
630    
631 jkt 1.11 <p>
632 nightmorph 1.21 First, we are going to setup the filesystem mounting points in
633     <path>/etc/fstab</path>.
634 jkt 1.11 </p>
635    
636     <pre caption="Editing the filesystem in /etc/fstab">
637 nightmorph 1.21 # <i>nano /etc/fstab</i>
638 jkt 1.11 <comment>(This is an example, replace X and Y with the correct numbers for your hard disk.)</comment>
639     #Device Mountpoint Fstype Options Dump Pass
640     /dev/adXsYb none swap sw 0 0
641     /dev/adXsYa / ufs rw 1 1
642     /dev/adXsYe /usr/home ufs rw 2 2
643     /dev/adXsYd /tmp ufs rw 2 2
644     /dev/acdX /cdrom cd9660 ro,noauto 0 0
645     </pre>
646    
647     <p>
648     Now would also be a good time to set up your network connection before the final
649 nightmorph 1.21 reboot. You can find all the information necessary to configure your network in
650     the <uri link="/doc/en/handbook/handbook-x86.xml?part=4&amp;chap=1">Gentoo
651     Handbook</uri>. To have your network interface activated at boot time, you have
652     to add it to the default runlevel:
653 vanquirius 1.13 </p>
654    
655     <pre caption="Adding your network adapter to the default runlevel">
656 nightmorph 1.21 # <i>rc-update add net.fxp0 default</i>
657 vanquirius 1.13 </pre>
658    
659     <p>
660 rane 1.18 Your system's hostname can be changed in <path>/etc/conf.d/hostname</path>.
661 jkt 1.11 </p>
662    
663     <pre caption="Setting up the machine's hostname">
664 nightmorph 1.21 # <i>nano /etc/conf.d/hostname</i>
665 rane 1.17 <comment>(Set the HOSTNAME variable to your hostname)</comment>
666     HOSTNAME="tux"
667     </pre>
668    
669     <p>
670     You should also configure your domain name, which is done in the
671     <path>/etc/conf.d/domainname</path> file:
672     </p>
673    
674     <pre caption="Setting the domainname">
675 nightmorph 1.21 # <i>nano /etc/conf.d/domainname</i>
676 nightmorph 1.23 <comment>(Set the dns_domain variable to your domain name, and lo to your local
677     network interface)</comment>
678     dns_domain_lo="homenetwork"
679 rane 1.17 </pre>
680    
681     <p>
682     If you have a NIS domain, you need to define it in the
683     <path>/etc/conf.d/domainname</path> file:
684     </p>
685    
686     <pre caption="Setting the NIS domainname">
687 nightmorph 1.21 # <i>nano /etc/conf.d/domainname</i>
688 nightmorph 1.23 <comment>(Set the nis_domain variable to your NIS domain name, and lo to your local network interface)</comment>
689     nis_domain_lo="my-nisdomain"
690 jkt 1.11 </pre>
691    
692 nightmorph 1.23 <note>
693     For more information on domainnames and networking, please refer to the <uri
694     link="/doc/en/handbook/handbook-x86.xml?part=1&amp;chap=8#doc_chap2">Gentoo
695     Linux Handbook</uri>, and please read the documentation in
696     <path>/etc/conf.d/net.example</path>.
697     </note>
698    
699 jkt 1.11 <p>
700 cam 1.12 In case you need to use another keyboard layout for your language, you have to
701     set the correct value in <path>/etc/conf.d/syscons</path>. The following example
702     uses the Spanish layout, so you'll have to adjust it to your need if you want to
703     use another one.
704 jkt 1.11 </p>
705    
706     <pre caption="Changing your keyboard layout (Optional)">
707 nightmorph 1.21 # <i>nano /etc/conf.d/syscons</i>
708 jkt 1.11 KEYMAP="spanish.iso.acc"
709     <comment>(Possible layouts can be found in /usr/share/syscons/keymaps).</comment>
710     </pre>
711    
712 fox2mike 1.2 <p>
713 cam 1.12 Now would be a good time to set a password for the <c>root</c> user and to add
714 jkt 1.11 another user account for your day-to-day work.
715 fox2mike 1.2 </p>
716    
717 jkt 1.11 <pre caption="Changing the root password and adding a new user">
718     # <i>passwd</i>
719     # <i>adduser</i>
720 nightmorph 1.21 Username: <i>fred</i>
721     Full Name: <i>Fred Smith</i>
722     <comment>(Accepting the default here, just hit Enter.)</comment>
723     Uid (Leave empty for default):
724     <comment>(OK to accept the default here as well; hit Enter.)</comment>
725     Login group [fred]:
726     <comment>(Enter your groups here, space separated. They must exist.)</comment>
727     Login group is fred. Invite fred into other groups? []: wheel portage
728     <comment>(OK to accept the default here, hit Enter)</comment>
729     Login class [default]:
730     <comment>(Somewhat of a personal preference. Make sure the shell exists in /etc/shells)</comment>
731     Shell (sh bash tcsh csh esh ksh zsh sash nologin) [sh] <i>bash</i>
732     <comment>(OK to accept the default here, hit Enter for all these)</comment>
733     User password-based authentication [yes]
734     Use an empty password (yes/no) [no]:
735     Use a random password? (yes/no) [no]:
736     Enter password: <i>password goes here</i>
737     Enter password again: <i>retype it</i>
738     <comment>(OK to accept the default here, hit Enter)</comment>
739     Lock out the account after creation? [no]:
740     Username : fred
741     Password : *****
742     Full Name : Fred Smith
743     <comment>(This will vary)</comment>
744     Uid : 1002
745     Class :
746     Groups : fred wheel portage
747     Home : /home/fred
748     Shell : /bin/bash
749     Locked : no
750     <comment>(Confirm the information is correct)</comment>
751     OK? (yes/no): <i>yes</i>
752     adduser: INFO: Sucessfully added (fred) to the user database
753     Add another user? (yes/no): <i>no</i>
754     Goodbye!
755     #
756 jkt 1.11 </pre>
757    
758 fox2mike 1.2 <p>
759 cam 1.12 Congratulations, you have just finished your Gentoo/FreeBSD installation which
760     you can start exploring after the final reboot. Have fun!
761 fox2mike 1.2 </p>
762    
763 jkt 1.11 <pre caption="Rebooting the system">
764     # <i>exit</i>
765     # <i>reboot</i>
766     </pre>
767    
768 neysx 1.1 </body>
769     </section>
770     </chapter>
771    
772     <chapter>
773     <title>Developing for Gentoo/FreeBSD</title>
774     <section>
775 cam 1.4 <title>How to help</title>
776 neysx 1.1 <body>
777    
778     <p>
779     There are many things you could help with, depending on your skill level and
780     spare time:
781     </p>
782    
783     <ul>
784     <li>
785 cam 1.12 Working on current ebuilds: this means working closely with ebuild
786     maintainers in order to create patches or modify ebuilds in a way that can
787     be accepted into the main tree.
788 neysx 1.1 </li>
789     <li>
790     Security: if you are into security, we need you! Although security
791     advisories from the FreeBSD project are tracked and fixed, we can always
792 cam 1.4 use help in this area.
793 neysx 1.1 </li>
794     <li>
795     Contacts: we need people who can get in touch with FreeBSD developers to
796     maintain contacts between us and the original project to exchange patches
797     and discuss various problems and their solutions. Note that this should
798 cam 1.4 never involve any kind of spamming of mailing lists or IRC channels.
799 neysx 1.1 </li>
800     <li>
801     Testing: the more people are actively using Gentoo/FreeBSD, the more bugs
802     will be discovered, which helps us improving the quality of the port. If
803     you are good at describing bugs or problems, we definitely want to hear
804 cam 1.4 from you.
805 neysx 1.1 </li>
806     <li>
807 nightmorph 1.23 Other areas where we need help include: system ebuilds, creation of
808     installation CDs, documentation, kernel hacking.
809 neysx 1.1 </li>
810     </ul>
811    
812     </body>
813     </section>
814    
815     <section>
816     <title>Known issues</title>
817     <body>
818    
819     <p>
820     At the moment, there are still quite a lot of known issues. Here are the ones
821     really worth noting:
822     </p>
823    
824     <ul>
825     <li>
826     Some init scripts depend on the clock service which we don't provide right
827     now. You can just remove it from the dependencies of the script and report
828 nightmorph 1.23 that on our <uri link="http://bugs.gentoo.org/">Bugzilla</uri>. Please
829     remember to use the "Gentoo/Alt" product for your submission.
830 neysx 1.15 </li>
831 neysx 1.1 </ul>
832    
833     </body>
834     </section>
835     </chapter>
836    
837     <chapter>
838     <title>Contact</title>
839     <section>
840     <body>
841    
842     <p>
843 cam 1.4 A list of Gentoo/FreeBSD developers can be found at the <uri
844 neysx 1.1 link="/proj/en/gentoo-alt/bsd/fbsd/">project page</uri>. Other ways to contact
845     Gentoo/FreeBSD developers include our IRC Channel <c>#gentoo-bsd</c> on
846 jkt 1.6 Freenode, as well as the <uri link="/main/en/lists.xml">gentoo-bsd mailing
847     list</uri>.
848 neysx 1.1 </p>
849    
850     </body>
851     </section>
852     </chapter>
853     </guide>

  ViewVC Help
Powered by ViewVC 1.1.20