| 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.20 2006/05/26 19:29:27 nightmorph Exp $ --> |
2 | <!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/gentoo-freebsd.xml,v 1.21 2006/10/06 21:48:25 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> |
| 20 | |
23 | |
| 21 | <abstract> |
24 | <abstract> |
| 22 | This document gives some general information on FreeBSD, as well as |
25 | This document gives some general information on FreeBSD, as well as |
| 23 | installation instructions for Gentoo/FreeBSD. It also includes some reference |
26 | installation instructions for Gentoo/FreeBSD. It also includes some reference |
| 24 | for people interested in helping out with development. |
27 | for people interested in helping out with development. |
| … | |
… | |
| 26 | |
29 | |
| 27 | <!-- The content of this document is licensed under the CC-BY-SA license --> |
30 | <!-- The content of this document is licensed under the CC-BY-SA license --> |
| 28 | <!-- See http://creativecommons.org/licenses/by-sa/2.5 --> |
31 | <!-- See http://creativecommons.org/licenses/by-sa/2.5 --> |
| 29 | <license/> |
32 | <license/> |
| 30 | |
33 | |
| 31 | <version>2.5</version> |
34 | <version>2.6</version> |
| 32 | <date>2006-05-26</date> |
35 | <date>2006-10-06</date> |
| 33 | |
36 | |
| 34 | <chapter> |
37 | <chapter> |
| 35 | <title>Introduction to FreeBSD</title> |
38 | <title>Introduction to FreeBSD</title> |
| 36 | <section> |
39 | <section> |
| 37 | <title>What is FreeBSD?</title> |
40 | <title>What is FreeBSD?</title> |
| … | |
… | |
| 123 | </chapter> |
126 | </chapter> |
| 124 | |
127 | |
| 125 | <chapter> |
128 | <chapter> |
| 126 | <title>Installing Gentoo/FreeBSD</title> |
129 | <title>Installing Gentoo/FreeBSD</title> |
| 127 | <section> |
130 | <section> |
| 128 | <title>Installation instructions</title> |
131 | <title>Booting the CD</title> |
| 129 | <body> |
132 | <body> |
| 130 | |
133 | |
| 131 | <p> |
134 | <p> |
| 132 | After this short introduction, it's about time to finally install |
135 | After this short introduction, it's about time to finally install |
| 133 | Gentoo/FreeBSD. Unfortunately, we currently lack our own installation media, so |
136 | Gentoo/FreeBSD. Unfortunately, we currently lack our own installation media, so |
| 134 | you have to choose between two alternative installation methods. The first |
137 | you have to choose between two alternative installation methods. The first |
| 135 | would be to use an existing FreeBSD installation to partition your hard drive |
138 | would be to use an existing FreeBSD installation to partition your hard drive |
| 136 | and use it as a base for installing Gentoo/FreeBSD. Alternatively, you can also |
139 | and use it as a base for installing Gentoo/FreeBSD. This guide will describe how |
| 137 | use the excellent <uri link="http://www.freesbie.org/">FreeSBIE LiveCD</uri> as |
140 | to use the <uri link="http://www.freesbie.org/">FreeSBIE LiveCD</uri> as |
| 138 | an installation medium for Gentoo/FreeBSD. |
141 | an installation medium for Gentoo/FreeBSD. |
| 139 | </p> |
142 | </p> |
| 140 | |
143 | |
| 141 | <note> |
144 | <note> |
| 142 | If you are intending to use FreeSBIE for installing Gentoo/FreeBSD, please make |
145 | If you are intending to use FreeSBIE for installing Gentoo/FreeBSD, please make |
| 143 | sure to use a version based on FreeBSD 6.0! Experimental versions can be downloaded |
146 | sure to use a version based on FreeBSD 6.0! Experimental versions can be downloaded |
| 144 | from <uri link="http://torrent.freesbie.org/">FreeSBIE's Bittorrent tracker</uri> and |
147 | from <uri link="http://torrent.freesbie.org/">FreeSBIE's Bittorrent tracker</uri> and |
| 145 | version 20060118 has been tested to work for the purposes described in this document. |
148 | version 20060118 has been tested to work for the purposes described in this document. |
| 146 | </note> |
149 | </note> |
| 147 | |
150 | |
|
|
151 | <p> |
|
|
152 | First, boot the CD in order to begin the installation process. You'll be |
|
|
153 | presented with a login screen. The username is <c>freesbie</c>, and there is |
|
|
154 | no password. Next, run <c>sudo su</c> to become root, and optionally setup a |
|
|
155 | password. If you want to pass time during the installation process, you can run |
|
|
156 | <c>startx</c> to enter into an Xfce environment, suitable for web browsing, |
|
|
157 | AIM, and other things. Unlike Linux, FreeBSD bases the name of your interface |
|
|
158 | on the driver for the interface. For example, the Intel EtherExpress driver |
|
|
159 | (fxp) appears as fxp0 (driver fxp, first network card). To see what your |
|
|
160 | interface is, use <c>ifconfig</c>: |
|
|
161 | </p> |
|
|
162 | |
|
|
163 | <pre caption="Finding out the network interface name using ifconfig"> |
|
|
164 | # <i>ifconfig</i> |
|
|
165 | fxp0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500 |
|
|
166 | options=8<VLAN_MTU> |
|
|
167 | inet6 fe80::2d0::b7ff:febc:4fe3%fxp0 prefixlen 64 scopeid 0x1 |
|
|
168 | inet 192.168.0.106 netmask 0xffffff00 broadcast 192.168.0.255 |
|
|
169 | ether 00:d0:b7:bc:4f:e3 |
|
|
170 | media: Ethernet autoselect (100baseTX <full-duplex>) |
|
|
171 | status: active |
|
|
172 | lo0: flags=8007<LOOPBACK,MULTICAST> mtu 16384 |
|
|
173 | </pre> |
|
|
174 | |
|
|
175 | <p> |
|
|
176 | If the original DHCP request during the CD bootup failed, you can use the |
|
|
177 | <c>dhclient</c> command to obtain an IP: |
|
|
178 | </p> |
|
|
179 | |
|
|
180 | <pre caption="Obtaining a DHCP address using dhclient"> |
|
|
181 | # <i>dhclient fxp0</i> |
|
|
182 | DHCPDISCOVER on fxp0 to 255.255.255.255 port 67 interval 9 |
|
|
183 | DHCPOFFER from 192.168.0.1 |
|
|
184 | DHCPREQUEST on fxp0 to 255.255.255.255 port 67 |
|
|
185 | DHCPACK from 192.168.0.1 |
|
|
186 | bound to 192.168.0.106 -- renewal in 302400 seconds |
|
|
187 | </pre> |
|
|
188 | |
| 148 | <note> |
189 | <note> |
| 149 | We use <c>ee</c> as a default editor in this guide but you can choose |
190 | The output presented here will differ based on your network. |
| 150 | <c>vim</c>, <c>nano</c> or any other editor you like to configure your system. |
|
|
| 151 | </note> |
191 | </note> |
| 152 | |
192 | |
| 153 | <p> |
193 | <p> |
| 154 | Before you can begin with the installation, you have to setup a hard disk for |
194 | Next, create the chroot for your installation: |
| 155 | use with Gentoo/FreeBSD. This can either be done via <c>sysinstall</c> |
|
|
| 156 | (available from a current FreeBSD installation as well as from within FreeSBIE) |
|
|
| 157 | or by manually using the commands <c>fdisk</c>, <c>disklabel</c> and <c>newfs</c>. |
|
|
| 158 | If you have never set up a FreeBSD system before, <c>sysinstall</c> may be the |
|
|
| 159 | better option for you. In that case make sure that you don't use the sysinstall |
|
|
| 160 | launched by FreeBSD's or FreeSBIE's installers, but use the following command instead: |
|
|
| 161 | </p> |
|
|
| 162 | |
|
|
| 163 | <pre caption="Partitioning with sysinstall"> |
|
|
| 164 | # <i>sysinstall diskPartitionEditor diskPartitionWrite diskLabelEditor diskLabelCommit</i> |
|
|
| 165 | </pre> |
|
|
| 166 | |
|
|
| 167 | <p> |
195 | </p> |
| 168 | If you face difficulties |
|
|
| 169 | while partitioning or formatting your hard disks, have a look at the great |
|
|
| 170 | <uri link="http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/">FreeBSD |
|
|
| 171 | Handbook</uri> or hop onto <c>#gentoo-bsd</c> on the Freenode IRC server. |
|
|
| 172 | </p> |
|
|
| 173 | |
196 | |
| 174 | <p> |
197 | <pre caption="Making the chroot directory"> |
| 175 | Once you're done setting up your disks, you have to create a mount point for |
|
|
| 176 | your Gentoo/FreeBSD installation and mount all the necessary partitions. |
|
|
| 177 | </p> |
|
|
| 178 | |
|
|
| 179 | <pre caption="Creating a mount point and mounting partitions"> |
|
|
| 180 | # <i>mkdir /mnt/gentoo</i> |
198 | # <i>mkdir /mnt/gentoo</i> |
| 181 | <comment>(Replace X with the correct numbers for your hard disk.)</comment> |
|
|
| 182 | # <i>mount /dev/adXsXa /mnt/gentoo</i> |
|
|
| 183 | </pre> |
199 | </pre> |
| 184 | |
200 | |
| 185 | <p> |
201 | <note> |
| 186 | If you're using the FreeSBIE LiveCD and you already had an UFS partition on |
202 | There is a bug in the <uri |
| 187 | your hard disk, it has already been mounted read-only to <path>/mnt/ufs.1</path>. |
203 | link="http://dev.gentoo.org/~flameeyes/minimal-freesbie-drizzt.iso.bz2"> |
| 188 | If you want to use that location for your installation, you'll have to remount it |
204 | minimal Freesbie CD</uri> that prevents the creation of the |
| 189 | in read-write mode: |
205 | <path>/mnt/gentoo</path> mount point. To avoid this, use <path>/mnt</path> |
|
|
206 | instead of <path>/mnt/gentoo</path> in the following sections. |
|
|
207 | </note> |
|
|
208 | |
|
|
209 | </body> |
|
|
210 | </section> |
|
|
211 | <section> |
|
|
212 | <title>Partitioning the Drive</title> |
|
|
213 | <body> |
|
|
214 | |
| 190 | </p> |
215 | <p> |
| 191 | |
216 | Now that we have a mount point, it's time to partition the drive. This is done |
| 192 | <pre caption="Remounting a partition in read-write mode"> |
217 | with the <c>sysinstall</c> command: |
| 193 | # <i>mount -u -o rw /mnt/ufs.1</i> |
|
|
| 194 | </pre> |
|
|
| 195 | |
|
|
| 196 | <p> |
218 | </p> |
|
|
219 | |
|
|
220 | <pre caption="Running the sysinstall command to fdisk the drive"> |
|
|
221 | # <i>sysinstall diskPartitionEditor diskPartitionWrite</i> |
|
|
222 | </pre> |
|
|
223 | |
|
|
224 | <p> |
|
|
225 | We recommend that you use the default layout. Press enter at the dialog, then |
|
|
226 | press <b>a</b> followed by <b>q</b> to accept the default layout. The next |
|
|
227 | screen will present you with the option of a bootloader. For this option, |
|
|
228 | choose "None" as we'll be installing the bootloader later on. Next comes the |
|
|
229 | actual partition sizing and mount points. |
|
|
230 | </p> |
|
|
231 | |
|
|
232 | <p> |
|
|
233 | This next step also uses <c>sysinstall</c>, but with different arguments: |
|
|
234 | </p> |
|
|
235 | |
|
|
236 | <pre caption="Running sysinstall to setup partition sizing and mount points"> |
|
|
237 | # <i>sysinstall diskLabelEditor diskLabelCommit</i> |
|
|
238 | </pre> |
|
|
239 | |
|
|
240 | <p> |
|
|
241 | Here, we'll refrain from using the automatic layout, and create one giant root |
|
|
242 | partition, followed by a swap partition. Hit <b>c</b> to create a new |
|
|
243 | partition. A dialog prompts you to enter a size. Go ahead and do so, using |
|
|
244 | MB/GB for setting different sizes, or C for cylinders. For root, choose FS as |
|
|
245 | the partition type, and set the mount point as <path>/mnt/gentoo</path>. <e>If |
|
|
246 | you do not adjust the mount point, it will overwrite the FreeSBIE |
|
|
247 | environment!</e>. As <path>/boot</path> is not a separate partition, you'll |
|
|
248 | need to disable soft-updates, or your system will not boot! To do so, use the |
|
|
249 | arrow keys to navigate to your newly created partition, then hit the <b>s</b> |
|
|
250 | key, until "Newfs" contains no <b>+S</b>. Now navigate the arrow keys until |
|
|
251 | the "Disk" line is highlighted, and hit <b>c</b> again to create a swap |
|
|
252 | partition. Generally, we recommend a swap space that is twice the size of your |
|
|
253 | RAM. Choose SWAP as the partition type, and don't worry about soft-updates, as |
|
|
254 | it does not apply to swap. Now we're finished, so hit <b>q</b> to finish the |
|
|
255 | process. |
|
|
256 | </p> |
|
|
257 | |
|
|
258 | <p> |
|
|
259 | This will finalize the partitioning process, and format the drive in UFS for |
|
|
260 | FreeBSD to utilize. This will also mount the drive for you at the mount point |
|
|
261 | specified earlier (<path>/mnt/gentoo</path>). You can verify this worked by |
|
|
262 | running <c>mount</c>: |
|
|
263 | </p> |
|
|
264 | |
|
|
265 | <pre caption="Verifying the new disk layout was mounted with mount"> |
|
|
266 | # <i>mount</i> |
|
|
267 | ... |
|
|
268 | /dev/ad0s1d on /mnt/gentoo (ufs, local) |
|
|
269 | </pre> |
|
|
270 | |
|
|
271 | <p> |
| 197 | Now that you have mounted the target partition, it is time to fetch and unpack |
272 | Now that you have mounted the target partition, it is time to start on the Gentoo |
| 198 | a stage3 tarball. |
273 | setup. |
|
|
274 | </p> |
|
|
275 | |
|
|
276 | </body> |
|
|
277 | </section> |
|
|
278 | <section> |
|
|
279 | <title>Gentoo Setup</title> |
|
|
280 | <body> |
|
|
281 | |
|
|
282 | <p> |
|
|
283 | First, we need to download a stage3 tarball and unpack it into the chroot. |
|
|
284 | Point your browser to |
|
|
285 | <uri>http://gentoo.osuosl.org/experimental/x86/freebsd/stages/</uri>, grab the |
|
|
286 | latest snapshot, and unpack it into the mountpoint: |
| 199 | </p> |
287 | </p> |
| 200 | |
288 | |
| 201 | <pre caption="Obtaining and unpacking a stage3 tarball"> |
289 | <pre caption="Obtaining and unpacking a stage3 tarball"> |
| 202 | # <i>cd /mnt/gentoo/</i> |
290 | # <i>cd /mnt/gentoo/</i> |
| 203 | <comment>(Any other Gentoo mirror which includes the experimental/ directory will also work.)</comment> |
291 | <comment>(Any other Gentoo mirror which includes the experimental/ directory will also work.)</comment> |
| 204 | # <i>wget http://gentoo.osuosl.org/experimental/x86/freebsd/stages/gentoo-freebsd-6.1-stage-20060509.tar.bz2</i> |
292 | # <i>wget http://gentoo.osuosl.org/experimental/x86/freebsd/stages/gentoo-freebsd-6.1-stage-20060802.tar.bz2</i> |
| 205 | # <i>tar -jxvpf gentoo-freebsd-6.1-stage-20060509.tar.bz2</i> |
293 | # <i>tar -jxvpf gentoo-freebsd-6.1-stage-20060802.tar.bz2</i> |
| 206 | <comment>(You can delete the tarball with the following command if you want to.)</comment> |
294 | <comment>(You can delete the tarball with the following command if you want to.)</comment> |
| 207 | # <i>rm gentoo-freebsd-6.1-stage-20060509.tar.bz2</i> |
295 | # <i>rm gentoo-freebsd-6.1-stage-20060802.tar.bz2</i> |
| 208 | </pre> |
296 | </pre> |
| 209 | |
297 | |
| 210 | <p> |
298 | <p> |
| 211 | Before chrooting into the newly-extracted stage, you first must obtain an |
299 | Before chrooting into the newly-extracted stage, you first must obtain an |
| 212 | up-to-date copy of the Gentoo/FreeBSD overlay. The easiest way to achieve this |
300 | up-to-date copy of the Gentoo/FreeBSD overlay. The easiest way to achieve this |
| … | |
… | |
| 221 | <comment>(You now can safely delete the snapshot with the following command.)</comment> |
309 | <comment>(You now can safely delete the snapshot with the following command.)</comment> |
| 222 | # <i>rm portage-alt-overlay-latest.tar.bz2</i> |
310 | # <i>rm portage-alt-overlay-latest.tar.bz2</i> |
| 223 | </pre> |
311 | </pre> |
| 224 | |
312 | |
| 225 | <p> |
313 | <p> |
| 226 | Alternatively, you can also use Subversion to check out the current version of |
314 | Alternatively, you can use Subversion to check out the current version of the |
| 227 | the overlay. If you are interested in this possibility, please refer to the |
315 | overlay. To do this, please refer to the <uri |
| 228 | <uri |
|
|
| 229 | link="/proj/en/gentoo-alt/contribute/index.xml?part=1&chap=3">Gentoo/ALT |
316 | link="/proj/en/gentoo-alt/contribute/index.xml?part=1&chap=3">Gentoo/ALT |
| 230 | overlay documentation</uri>. |
317 | overlay documentation</uri>. |
| 231 | </p> |
318 | </p> |
| 232 | |
319 | |
| 233 | <p> |
320 | <p> |
| 234 | In order for your install to work, you need to mount the <path>/dev</path> |
321 | In order for your install to work, you need to mount the <path>/dev</path> |
| … | |
… | |
| 238 | |
325 | |
| 239 | <pre caption="Mounting the /dev filesystem and chrooting"> |
326 | <pre caption="Mounting the /dev filesystem and chrooting"> |
| 240 | # <i>mount -t devfs none /mnt/gentoo/dev/</i> |
327 | # <i>mount -t devfs none /mnt/gentoo/dev/</i> |
| 241 | # <i>cp /etc/resolv.conf /mnt/gentoo/etc</i> |
328 | # <i>cp /etc/resolv.conf /mnt/gentoo/etc</i> |
| 242 | # <i>chroot /mnt/gentoo/ /bin/bash</i> |
329 | # <i>chroot /mnt/gentoo/ /bin/bash</i> |
| 243 | # <i>source /etc/profile</i> |
330 | # <i>env-update && source /etc/profile</i> |
| 244 | </pre> |
331 | </pre> |
| 245 | |
332 | |
| 246 | <p> |
333 | <p> |
| 247 | After you got hold of the Gentoo/FreeBSD overlay, it's time to link |
334 | After you got hold of the Gentoo/FreeBSD overlay, it's time to link |
| 248 | <path>/etc/make.profile</path> to the correct profile and add get your |
335 | <path>/etc/make.profile</path> to the correct profile and add get your |
| … | |
… | |
| 263 | # <i>emerge --metadata</i> |
350 | # <i>emerge --metadata</i> |
| 264 | </pre> |
351 | </pre> |
| 265 | |
352 | |
| 266 | <pre caption="Setting up the profile and editing /etc/make.conf"> |
353 | <pre caption="Setting up the profile and editing /etc/make.conf"> |
| 267 | # <i>ln -sf /usr/portage/profiles/default-bsd/fbsd/6.1/x86/ /etc/make.profile</i> |
354 | # <i>ln -sf /usr/portage/profiles/default-bsd/fbsd/6.1/x86/ /etc/make.profile</i> |
| 268 | <comment>(FreeBSD's standard editor is ee, which is used to edit /etc/make.conf)</comment> |
|
|
| 269 | # <i>ee /etc/make.conf</i> |
355 | # <i>nano /etc/make.conf</i> |
| 270 | <comment>(Please make sure you add at least the following entries:)</comment> |
356 | <comment>(Please make sure you add at least the following entries:)</comment> |
| 271 | CHOST="i686-gentoo-freebsd6.1" |
357 | CHOST="i686-gentoo-freebsd6.1" |
| 272 | ACCEPT_KEYWORDS="~x86-fbsd" |
358 | ACCEPT_KEYWORDS="~x86-fbsd" |
| 273 | FEATURES="-sandbox collision-protect" |
359 | FEATURES="-sandbox collision-protect" |
| 274 | PORTDIR_OVERLAY="/usr/local/portage/portage-alt-overlay" |
360 | PORTDIR_OVERLAY="/usr/local/portage/portage-alt-overlay" |
| 275 | </pre> |
361 | </pre> |
|
|
362 | |
|
|
363 | <note> |
|
|
364 | Sandbox is disabled as it has not yet been ported to Gentoo/FreeBSD. |
|
|
365 | </note> |
| 276 | |
366 | |
| 277 | <note> |
367 | <note> |
| 278 | You can have a very limited system by using ~x86-fbsd keyword alone; you might |
368 | You can have a very limited system by using ~x86-fbsd keyword alone; you might |
| 279 | want to put ~x86 in your ACCEPT_KEYWORDS if you want access to more packages |
369 | want to put ~x86 in your ACCEPT_KEYWORDS if you want access to more packages |
| 280 | but you might find broken dependencies and non-working packages; please rather |
370 | but you might find broken dependencies and non-working packages; please rather |
| 281 | use package.keywords when testing packages and report working ones on <uri |
371 | use package.keywords when testing packages and report working ones on <uri |
| 282 | link="http://bugs.gentoo.org">Bugzilla</uri> for the product Gentoo/Alt. |
372 | link="http://bugs.gentoo.org">Bugzilla</uri> for the product Gentoo/Alt. |
| 283 | </note> |
373 | </note> |
| 284 | |
374 | |
| 285 | <p> |
375 | <p> |
| 286 | In order to boot correctly, you will need to create the <path>/proc</path> |
|
|
| 287 | directory. |
|
|
| 288 | </p> |
|
|
| 289 | |
|
|
| 290 | <pre caption="Creating the /proc directory"> |
|
|
| 291 | # <i>mkdir /proc</i> |
|
|
| 292 | </pre> |
|
|
| 293 | |
|
|
| 294 | <p> |
|
|
| 295 | If you want, you can now rebuild the system's core packages. |
376 | If you want, you can now rebuild the system's core packages. |
| 296 | </p> |
377 | </p> |
| 297 | |
378 | |
| 298 | <pre caption="Rebuilding the FreeBSD core packages (optional)"> |
379 | <pre caption="Rebuilding the FreeBSD core packages (optional)"> |
| 299 | # <i>emerge -e system</i> |
380 | # <i>emerge -e system</i> |
| 300 | </pre> |
381 | </pre> |
| 301 | |
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 | |
| 302 | <p> |
392 | <p> |
| 303 | When you did <c>emerge -e system</c>, the sources for the FreeBSD kernel got |
393 | If you ran <c>emerge -e system</c>, the sources for the FreeBSD kernel were |
| 304 | installed to <path>/usr/src/sys</path>. If you skipped this step, you can get |
394 | installed to <path>/usr/src/sys</path>. If you skipped this step, you can get |
| 305 | them in the following way: |
395 | them in the following way: |
| 306 | </p> |
396 | </p> |
| 307 | |
397 | |
| 308 | <pre caption="Getting the FreeBSD kernel sources"> |
398 | <pre caption="Getting the FreeBSD kernel sources"> |
| 309 | # <i>emerge freebsd-sources</i> |
399 | # <i>emerge freebsd-sources</i> |
| 310 | </pre> |
400 | </pre> |
| 311 | |
401 | |
| 312 | <p> |
402 | <p> |
| 313 | Configuring and compiling a custom kernel is really different from compiling |
403 | Configuring and compiling a custom kernel is quite different from compiling |
| 314 | Linux, so if you are not familiar with the process we encourage you to have a |
404 | Linux, so if you are not familiar with the process we encourage you to have a |
| 315 | look at <uri |
405 | look at <uri |
| 316 | link="http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig.html"> |
406 | link="http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig.html"> |
| 317 | chapter 8</uri> of the FreeBSD handbook. |
407 | chapter 8</uri> of the FreeBSD handbook. For now, you can do an installation of |
| 318 | </p> |
408 | the GENERIC kernel, which works on most systems. To begin, enter the source |
| 319 | |
409 | directory for the kernel: |
| 320 | <p> |
410 | </p> |
|
|
411 | |
|
|
412 | <impo> |
| 321 | Please note that currently only the "Traditional" way of building the kernel is |
413 | Please note that currently only the "Traditional" way of building the kernel is |
| 322 | supported on Gentoo/FreeBSD! Also note that <c>make install</c> will probably |
414 | supported on Gentoo/FreeBSD! |
| 323 | ask you for a <path>/boot/device.hints</path> file. A default version can be |
415 | </impo> |
| 324 | found in the <path>conf</path> subdirectory of the <c>GENERIC</c> configuration |
416 | |
| 325 | and is called <path>GENERIC.hints</path>. |
417 | <pre caption="Entering the kernel source directory"> |
|
|
418 | # <i>cd /usr/src/sys/</i> |
|
|
419 | </pre> |
|
|
420 | |
| 326 | </p> |
421 | <p> |
| 327 | |
422 | Looking over the layout, you'll see various architectures and subdirectories |
|
|
423 | for various parts of the kernel. To begin the installation, we head into the |
|
|
424 | <path>i386/conf/</path> directory: |
| 328 | <p> |
425 | </p> |
| 329 | Now is the time to do some basic system configuration and settings. First, we |
426 | |
| 330 | are 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 |
|
|
431 | DEFAULTS GENERIC.hints NOTES SMP |
|
|
432 | </pre> |
|
|
433 | |
| 331 | </p> |
434 | <p> |
| 332 | |
435 | The main files to note are <path>GENERIC</path> and <path>GENERIC.hints</path>. |
| 333 | <pre caption="Editing the filesystem in /etc/fstab"> |
436 | As it will be needed by the installation of the kernel, go ahead and copy |
| 334 | # <i>ee /etc/fstab</i> |
437 | <path>GENERIC.hints</path> file to <path>/boot/device.hints</path>: |
| 335 | <comment>(This is an example, replace X and Y with the correct numbers for your hard disk.)</comment> |
|
|
| 336 | #Device Mountpoint Fstype Options Dump Pass |
|
|
| 337 | /dev/adXsYb none swap sw 0 0 |
|
|
| 338 | /dev/adXsYa / ufs rw 1 1 |
|
|
| 339 | /dev/adXsYe /usr/home ufs rw 2 2 |
|
|
| 340 | /dev/adXsYd /tmp ufs rw 2 2 |
|
|
| 341 | /dev/acdX /cdrom cd9660 ro,noauto 0 0 |
|
|
| 342 | </pre> |
|
|
| 343 | |
|
|
| 344 | <p> |
438 | </p> |
| 345 | Now would also be a good time to set up your network connection before the final |
439 | |
| 346 | reboot. |
440 | <pre caption="Copying over the GENERIC.hints file"> |
|
|
441 | # <i>cp GENERIC.hints /boot/device.hints</i> |
|
|
442 | </pre> |
|
|
443 | |
| 347 | </p> |
444 | <p> |
| 348 | |
445 | This file is used by the kernel drivers for basic configuration information |
|
|
446 | such 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 |
|
|
448 | instance GENERIC) to copy over the required build files to a |
|
|
449 | <path>compile</path> directory in the parent directory. <path>GENERIC</path> is |
|
|
450 | similiar to the <path>.config</path> file for the Linux kernel. Run |
|
|
451 | <c>config</c> to produce the build directory: |
| 349 | <p> |
452 | </p> |
| 350 | You can find all the information necessary to configure your network in the |
453 | |
| 351 | <uri link="/doc/en/handbook/handbook-x86.xml?part=4&chap=1">Gentoo |
454 | <pre caption="Configuring the kernel build"> |
| 352 | Handbook</uri>. |
455 | # <i>config GENERIC</i> |
|
|
456 | Kernel build directory is ../compile/GENERIC |
|
|
457 | Don't forget to ''make cleandepend; make depend'' |
|
|
458 | </pre> |
|
|
459 | |
| 353 | </p> |
460 | <p> |
| 354 | |
461 | <c>config</c> has created a GENERIC build directory for us in the parent |
|
|
462 | directory. <c>cd</c> into it, then run the following to do a complete build: |
| 355 | <p> |
463 | </p> |
| 356 | To have your network interface activated at boot time, you have to add it to |
464 | |
| 357 | the default runlevel. |
465 | <pre caption="Building and installing the kernel"> |
|
|
466 | # <i>cd ../compile/GENERIC</i> |
|
|
467 | # <i>make cleandepend && make depend && make && make install</i> |
|
|
468 | </pre> |
|
|
469 | |
| 358 | </p> |
470 | <p> |
| 359 | |
471 | This will give us a complete kernel to work with. Now we'll need to setup the |
| 360 | <pre caption="Adding your network adapter to the default runlevel"> |
472 | bootloader for the kernel to boot. The next chapter will discuss two methods of |
| 361 | # <i>rc-update add net.rl0 default</i> |
473 | setting up the bootloader: <c>grub</c> and <c>boot0</c>. |
| 362 | </pre> |
|
|
| 363 | |
|
|
| 364 | <p> |
474 | </p> |
| 365 | Your system's hostname can be changed in <path>/etc/conf.d/hostname</path>. |
475 | |
|
|
476 | </body> |
|
|
477 | </section> |
|
|
478 | <section> |
|
|
479 | <title>Setting up the bootloader (grub)</title> |
|
|
480 | <body> |
|
|
481 | |
| 366 | </p> |
482 | <p> |
| 367 | |
483 | As of grub 0.97-r1, UFS slices are readable to <c>grub</c>. This lets us use |
| 368 | <pre caption="Setting up the machine's hostname"> |
484 | <c>grub</c> as a bootloader, the prefered method for those coming from a Linux |
| 369 | # <i>ee /etc/conf.d/hostname</i> |
485 | background. To begin, emerge <c>grub</c> and setup the label as bootable. |
| 370 | <comment>(Set the HOSTNAME variable to your hostname)</comment> |
486 | Remember to replace <c>adXsY</c> with the actual number and slice of your disk. |
| 371 | HOSTNAME="tux" |
|
|
| 372 | </pre> |
|
|
| 373 | |
|
|
| 374 | <p> |
487 | </p> |
| 375 | You should also configure your domain name, which is done in the |
488 | |
| 376 | <path>/etc/conf.d/domainname</path> file: |
489 | <pre caption="Emerge grub"> |
|
|
490 | # <i>emerge grub</i> |
|
|
491 | # <i>disklabel -B adXsY</i> |
|
|
492 | </pre> |
|
|
493 | |
| 377 | </p> |
494 | <p> |
| 378 | |
495 | Now run <c>grub</c> to bring up the command prompt, and set up the partition as |
| 379 | <pre caption="Setting the domainname"> |
496 | shown: |
| 380 | # <i>ee /etc/conf.d/domainname</i> |
|
|
| 381 | <comment>(Set the DNSDOMAIN variable to your domain name)</comment> |
|
|
| 382 | DNSDOMAIN="homenetwork" |
|
|
| 383 | </pre> |
|
|
| 384 | |
|
|
| 385 | <p> |
497 | </p> |
| 386 | If you have a NIS domain, you need to define it in the |
498 | |
| 387 | <path>/etc/conf.d/domainname</path> file: |
499 | <pre caption="Setting up grub"> |
|
|
500 | <comment>(This is done to prevent disk error 29)</comment> |
|
|
501 | # <i>sysctl kern.geom.debugflags=16</i> |
|
|
502 | # <i>grub</i> |
|
|
503 | <comment>(Example using ad0s1d)</comment> |
|
|
504 | grub> <i>root (hd0,0,d)</i> |
|
|
505 | Filesystem type is ufs2, partition type 0xa5 |
|
|
506 | |
|
|
507 | grub> <i>setup (hd0)</i> |
|
|
508 | Checking if "/boot/grub/stage1" exists... yes |
|
|
509 | Checking if "/boot/grub/stage2" exists... yes |
|
|
510 | Checking if "/boot/grub/ufs2_stage1_5" exists... yes |
|
|
511 | Running "embed /boot/grub/ufs2_stage1_5 (hd0)"... 14 sectors are embedded. |
|
|
512 | succeeded |
|
|
513 | Running "install /boot/grub/stage1 (hd0) (hd0)1+14 p (hd0,0,d)/boot/grub/stage |
|
|
514 | 2 /boot/grub/menu.lst"... succeeded |
|
|
515 | Done. |
|
|
516 | |
|
|
517 | grub> quit |
|
|
518 | </pre> |
|
|
519 | |
| 388 | </p> |
520 | <p> |
| 389 | |
521 | When you first boot, you may not receive a grub menu. If so, run this at the |
| 390 | <pre caption="Setting the NIS domainname"> |
522 | prompt: |
| 391 | # <i>ee /etc/conf.d/domainname</i> |
|
|
| 392 | <comment>(Set the NISDOMAIN variable to your NIS domain name)</comment> |
|
|
| 393 | NISDOMAIN="my-nisdomain" |
|
|
| 394 | </pre> |
|
|
| 395 | |
|
|
| 396 | <p> |
523 | </p> |
| 397 | In case you need to use another keyboard layout for your language, you have to |
524 | |
| 398 | set the correct value in <path>/etc/conf.d/syscons</path>. The following example |
525 | <pre caption="Booting the kernel with no menu"> |
| 399 | uses the Spanish layout, so you'll have to adjust it to your need if you want to |
526 | grub> <i>find /boot/grub/stage1</i> |
| 400 | use another one. |
527 | <comment>(The output here is what you'll use in the next command)</comment> |
|
|
528 | (hd0,0,d) |
|
|
529 | |
|
|
530 | grub> <i>kernel (hd0,0,d)/boot/loader</i> |
|
|
531 | [FreeBSD-a.out, loadaddr=0x200000, text=0x1000, data=0x3a000, bss=0x0, entry=0x200000] |
|
|
532 | |
|
|
533 | grub> <i>boot</i> |
|
|
534 | </pre> |
|
|
535 | |
| 401 | </p> |
536 | <p> |
| 402 | |
537 | The next section will look at using the alternative bootloader, <c>boot0</c>. |
| 403 | <pre caption="Changing your keyboard layout (Optional)"> |
|
|
| 404 | # <i>ee /etc/conf.d/syscons</i> |
|
|
| 405 | KEYMAP="spanish.iso.acc" |
|
|
| 406 | <comment>(Possible layouts can be found in /usr/share/syscons/keymaps).</comment> |
|
|
| 407 | </pre> |
538 | </p> |
|
|
539 | |
|
|
540 | </body> |
|
|
541 | </section> |
|
|
542 | <section> |
|
|
543 | <title>Setting up the bootloader (boot0)</title> |
|
|
544 | <body> |
| 408 | |
545 | |
| 409 | <impo> |
546 | <impo> |
| 410 | Please make absolutely sure you add your new Gentoo/FreeBSD installation to the |
547 | <c>boot0</c> is the FreeBSD bootloader. Previously, it was the only supported |
| 411 | configuration of your bootloader, otherwise you won't be able to boot your newly |
548 | bootloader until <c>grub</c> was introduced into ports with UFS slice support. |
| 412 | installed system! If you don't have another bootloader installed, you should use |
549 | To install and configure <c>boot0</c>, run the following. Remember to replace |
| 413 | <c>boot0</c>, as it is currently the only one supported by FreeBSD. In this case |
550 | <c>adXsY</c> with the actual number and slice of your disk. |
| 414 | please don't forget to use your other operating systems to <c>boot0</c>'s |
|
|
| 415 | configuration. |
|
|
| 416 | </impo> |
551 | </impo> |
| 417 | |
552 | |
| 418 | <pre caption="Installing and setting up boot0"> |
553 | <pre caption="Installing and setting up boot0"> |
| 419 | # <i>emerge boot0</i> |
554 | # <i>emerge boot0</i> |
| 420 | <comment>(Leave the chroot environment)</comment> |
555 | <comment>(Leave the chroot environment)</comment> |
| … | |
… | |
| 427 | |
562 | |
| 428 | <p> |
563 | <p> |
| 429 | If you need additional information on setting up <c>boot0</c>, please consult |
564 | If you need additional information on setting up <c>boot0</c>, please consult |
| 430 | <uri |
565 | <uri |
| 431 | link="http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/boot.html">chapter |
566 | link="http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/boot.html">chapter |
| 432 | 12</uri> of the FreeBSD handbook. |
567 | 12</uri> of the FreeBSD handbook. Now it's time to do some basic system |
|
|
568 | configuration and settings. |
|
|
569 | </p> |
|
|
570 | |
|
|
571 | </body> |
|
|
572 | </section> |
|
|
573 | <section> |
|
|
574 | <title>System configuration</title> |
|
|
575 | <body> |
|
|
576 | |
| 433 | </p> |
577 | <p> |
|
|
578 | First, we are going to setup the filesystem mounting points in |
|
|
579 | <path>/etc/fstab</path>. |
|
|
580 | </p> |
|
|
581 | |
|
|
582 | <pre caption="Editing the filesystem in /etc/fstab"> |
|
|
583 | # <i>nano /etc/fstab</i> |
|
|
584 | <comment>(This is an example, replace X and Y with the correct numbers for your hard disk.)</comment> |
|
|
585 | #Device Mountpoint Fstype Options Dump Pass |
|
|
586 | /dev/adXsYb none swap sw 0 0 |
|
|
587 | /dev/adXsYa / ufs rw 1 1 |
|
|
588 | /dev/adXsYe /usr/home ufs rw 2 2 |
|
|
589 | /dev/adXsYd /tmp ufs rw 2 2 |
|
|
590 | /dev/acdX /cdrom cd9660 ro,noauto 0 0 |
|
|
591 | </pre> |
|
|
592 | |
|
|
593 | <p> |
|
|
594 | Now would also be a good time to set up your network connection before the final |
|
|
595 | reboot. You can find all the information necessary to configure your network in |
|
|
596 | the <uri link="/doc/en/handbook/handbook-x86.xml?part=4&chap=1">Gentoo |
|
|
597 | Handbook</uri>. To have your network interface activated at boot time, you have |
|
|
598 | to add it to the default runlevel: |
|
|
599 | </p> |
|
|
600 | |
|
|
601 | <pre caption="Adding your network adapter to the default runlevel"> |
|
|
602 | # <i>rc-update add net.fxp0 default</i> |
|
|
603 | </pre> |
|
|
604 | |
|
|
605 | <p> |
|
|
606 | Your system's hostname can be changed in <path>/etc/conf.d/hostname</path>. |
|
|
607 | </p> |
|
|
608 | |
|
|
609 | <pre caption="Setting up the machine's hostname"> |
|
|
610 | # <i>nano /etc/conf.d/hostname</i> |
|
|
611 | <comment>(Set the HOSTNAME variable to your hostname)</comment> |
|
|
612 | HOSTNAME="tux" |
|
|
613 | </pre> |
|
|
614 | |
|
|
615 | <p> |
|
|
616 | You should also configure your domain name, which is done in the |
|
|
617 | <path>/etc/conf.d/domainname</path> file: |
|
|
618 | </p> |
|
|
619 | |
|
|
620 | <pre caption="Setting the domainname"> |
|
|
621 | # <i>nano /etc/conf.d/domainname</i> |
|
|
622 | <comment>(Set the DNSDOMAIN variable to your domain name)</comment> |
|
|
623 | DNSDOMAIN="homenetwork" |
|
|
624 | </pre> |
|
|
625 | |
|
|
626 | <p> |
|
|
627 | If you have a NIS domain, you need to define it in the |
|
|
628 | <path>/etc/conf.d/domainname</path> file: |
|
|
629 | </p> |
|
|
630 | |
|
|
631 | <pre caption="Setting the NIS domainname"> |
|
|
632 | # <i>nano /etc/conf.d/domainname</i> |
|
|
633 | <comment>(Set the NISDOMAIN variable to your NIS domain name)</comment> |
|
|
634 | NISDOMAIN="my-nisdomain" |
|
|
635 | </pre> |
|
|
636 | |
|
|
637 | <p> |
|
|
638 | In case you need to use another keyboard layout for your language, you have to |
|
|
639 | set the correct value in <path>/etc/conf.d/syscons</path>. The following example |
|
|
640 | uses the Spanish layout, so you'll have to adjust it to your need if you want to |
|
|
641 | use another one. |
|
|
642 | </p> |
|
|
643 | |
|
|
644 | <pre caption="Changing your keyboard layout (Optional)"> |
|
|
645 | # <i>nano /etc/conf.d/syscons</i> |
|
|
646 | KEYMAP="spanish.iso.acc" |
|
|
647 | <comment>(Possible layouts can be found in /usr/share/syscons/keymaps).</comment> |
|
|
648 | </pre> |
| 434 | |
649 | |
| 435 | <p> |
650 | <p> |
| 436 | Now would be a good time to set a password for the <c>root</c> user and to add |
651 | Now would be a good time to set a password for the <c>root</c> user and to add |
| 437 | another user account for your day-to-day work. |
652 | another user account for your day-to-day work. |
| 438 | </p> |
653 | </p> |
| 439 | |
654 | |
| 440 | <pre caption="Changing the root password and adding a new user"> |
655 | <pre caption="Changing the root password and adding a new user"> |
| 441 | # <i>passwd</i> |
656 | # <i>passwd</i> |
| 442 | <comment>(If you need help in adding a user please consult the FreeBSD handbook).</comment> |
|
|
| 443 | # <i>adduser</i> |
657 | # <i>adduser</i> |
|
|
658 | Username: <i>fred</i> |
|
|
659 | Full Name: <i>Fred Smith</i> |
|
|
660 | <comment>(Accepting the default here, just hit Enter.)</comment> |
|
|
661 | Uid (Leave empty for default): |
|
|
662 | <comment>(OK to accept the default here as well; hit Enter.)</comment> |
|
|
663 | Login group [fred]: |
|
|
664 | <comment>(Enter your groups here, space separated. They must exist.)</comment> |
|
|
665 | Login group is fred. Invite fred into other groups? []: wheel portage |
|
|
666 | <comment>(OK to accept the default here, hit Enter)</comment> |
|
|
667 | Login class [default]: |
|
|
668 | <comment>(Somewhat of a personal preference. Make sure the shell exists in /etc/shells)</comment> |
|
|
669 | Shell (sh bash tcsh csh esh ksh zsh sash nologin) [sh] <i>bash</i> |
|
|
670 | <comment>(OK to accept the default here, hit Enter for all these)</comment> |
|
|
671 | User password-based authentication [yes] |
|
|
672 | Use an empty password (yes/no) [no]: |
|
|
673 | Use a random password? (yes/no) [no]: |
|
|
674 | Enter password: <i>password goes here</i> |
|
|
675 | Enter password again: <i>retype it</i> |
|
|
676 | <comment>(OK to accept the default here, hit Enter)</comment> |
|
|
677 | Lock out the account after creation? [no]: |
|
|
678 | Username : fred |
|
|
679 | Password : ***** |
|
|
680 | Full Name : Fred Smith |
|
|
681 | <comment>(This will vary)</comment> |
|
|
682 | Uid : 1002 |
|
|
683 | Class : |
|
|
684 | Groups : fred wheel portage |
|
|
685 | Home : /home/fred |
|
|
686 | Shell : /bin/bash |
|
|
687 | Locked : no |
|
|
688 | <comment>(Confirm the information is correct)</comment> |
|
|
689 | OK? (yes/no): <i>yes</i> |
|
|
690 | adduser: INFO: Sucessfully added (fred) to the user database |
|
|
691 | Add another user? (yes/no): <i>no</i> |
|
|
692 | Goodbye! |
|
|
693 | # |
| 444 | </pre> |
694 | </pre> |
| 445 | |
695 | |
| 446 | <p> |
696 | <p> |
| 447 | Congratulations, you have just finished your Gentoo/FreeBSD installation which |
697 | Congratulations, you have just finished your Gentoo/FreeBSD installation which |
| 448 | you can start exploring after the final reboot. Have fun! |
698 | you can start exploring after the final reboot. Have fun! |