| 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.25 2007/04/08 21:55:42 nightmorph Exp $ --> |
2 | <!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/gentoo-freebsd.xml,v 1.26 2007/05/10 22:00:51 cam 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 | |
| … | |
… | |
| 24 | <mail link="flameeyes@gentoo.org">Diego Pettenò</mail> |
24 | <mail link="flameeyes@gentoo.org">Diego Pettenò</mail> |
| 25 | </author> |
25 | </author> |
| 26 | <author title="Editor"> |
26 | <author title="Editor"> |
| 27 | <mail link="nightmorph@gentoo.org">Joshua Saddler</mail> |
27 | <mail link="nightmorph@gentoo.org">Joshua Saddler</mail> |
| 28 | </author> |
28 | </author> |
|
|
29 | <author title="Editor"> |
|
|
30 | <mail link="cam@gentoo.org">Camille Huot</mail> |
|
|
31 | </author> |
| 29 | |
32 | |
| 30 | <abstract> |
33 | <abstract> |
| 31 | This document gives some general information on FreeBSD, as well as |
34 | This document gives some general information on FreeBSD, as well as |
| 32 | installation instructions for Gentoo/FreeBSD. It also includes some reference |
35 | installation instructions for Gentoo/FreeBSD. It also includes some reference |
| 33 | for people interested in helping out with development. |
36 | for people interested in helping out with development. |
| … | |
… | |
| 35 | |
38 | |
| 36 | <!-- The content of this document is licensed under the CC-BY-SA license --> |
39 | <!-- The content of this document is licensed under the CC-BY-SA license --> |
| 37 | <!-- See http://creativecommons.org/licenses/by-sa/2.5 --> |
40 | <!-- See http://creativecommons.org/licenses/by-sa/2.5 --> |
| 38 | <license/> |
41 | <license/> |
| 39 | |
42 | |
| 40 | <version>2.8</version> |
43 | <version>2.9</version> |
| 41 | <date>2007-04-08</date> |
44 | <date>2007-05-10</date> |
| 42 | |
45 | |
| 43 | <chapter> |
46 | <chapter> |
| 44 | <title>Introduction to FreeBSD</title> |
47 | <title>Introduction to FreeBSD</title> |
| 45 | <section> |
48 | <section> |
| 46 | <title>What is FreeBSD?</title> |
49 | <title>What is FreeBSD?</title> |
| … | |
… | |
| 197 | |
200 | |
| 198 | <note> |
201 | <note> |
| 199 | The output presented here will differ based on your network. |
202 | The output presented here will differ based on your network. |
| 200 | </note> |
203 | </note> |
| 201 | |
204 | |
| 202 | <p> |
|
|
| 203 | Next, create the chroot for your installation: |
|
|
| 204 | </p> |
|
|
| 205 | |
|
|
| 206 | <pre caption="Making the chroot directory"> |
|
|
| 207 | # <i>mkdir /mnt/gentoo</i> |
|
|
| 208 | </pre> |
|
|
| 209 | |
|
|
| 210 | <note> |
|
|
| 211 | There is a bug in the <uri |
|
|
| 212 | link="http://dev.gentoo.org/~flameeyes/minimal-freesbie-drizzt.iso.bz2"> |
|
|
| 213 | minimal Freesbie CD</uri> that prevents the creation of the |
|
|
| 214 | <path>/mnt/gentoo</path> mount point. To avoid this, use <path>/mnt</path> |
|
|
| 215 | instead of <path>/mnt/gentoo</path> in the following sections. |
|
|
| 216 | </note> |
|
|
| 217 | |
|
|
| 218 | </body> |
205 | </body> |
| 219 | </section> |
206 | </section> |
| 220 | <section> |
207 | <section> |
| 221 | <title>Partitioning the Drive</title> |
208 | <title>Partitioning the Drive</title> |
| 222 | <body> |
209 | <body> |
| … | |
… | |
| 249 | <p> |
236 | <p> |
| 250 | Here, we'll refrain from using the automatic layout, and create one giant root |
237 | Here, we'll refrain from using the automatic layout, and create one giant root |
| 251 | partition, followed by a swap partition. Hit <b>c</b> to create a new |
238 | partition, followed by a swap partition. Hit <b>c</b> to create a new |
| 252 | partition. A dialog prompts you to enter a size. Go ahead and do so, using |
239 | partition. A dialog prompts you to enter a size. Go ahead and do so, using |
| 253 | MB/GB for setting different sizes, or C for cylinders. For root, choose FS as |
240 | MB/GB for setting different sizes, or C for cylinders. For root, choose FS as |
| 254 | the partition type, and set the mount point as <path>/mnt/gentoo</path>. <e>If |
241 | the partition type, and set the mount point as <path>/mnt/</path>. <e>If |
| 255 | you do not adjust the mount point, it will overwrite the FreeSBIE |
242 | you do not adjust the mount point, it will overwrite the FreeSBIE |
| 256 | environment!</e> As <path>/boot</path> is not a separate partition, you'll |
243 | environment!</e> As <path>/boot</path> is not a separate partition, you'll |
| 257 | need to disable soft-updates, or your system will not boot! To do so, use the |
244 | need to disable soft-updates, or your system will not boot! To do so, use the |
| 258 | arrow keys to navigate to your newly created partition, then hit the <b>s</b> |
245 | arrow keys to navigate to your newly created partition, then hit the <b>s</b> |
| 259 | key, until "Newfs" contains no <b>+S</b>. Now navigate the arrow keys until |
246 | key, until "Newfs" contains no <b>+S</b>. Now navigate the arrow keys until |
| … | |
… | |
| 269 | <c>sysinstall</c> will actually create a 'd' slice, which the bootloader won't |
256 | <c>sysinstall</c> will actually create a 'd' slice, which the bootloader won't |
| 270 | boot from. To fix this, run the following: |
257 | boot from. To fix this, run the following: |
| 271 | </p> |
258 | </p> |
| 272 | |
259 | |
| 273 | <pre caption="Fixing the root partition letter"> |
260 | <pre caption="Fixing the root partition letter"> |
| 274 | # <i>disklabel ad0s1 | sed 's/^ d:/ a:/g' | disklabel -w ad0s1</i> |
261 | # <i>disklabel ad0s1 | sed 's/^ d:/ a:/' > label</i> |
|
|
262 | # <i>disklabel -R ad0s1 label</i> |
| 275 | </pre> |
263 | </pre> |
| 276 | |
264 | |
| 277 | <p> |
265 | <p> |
| 278 | This will finalize the partitioning process, and format the drive in UFS for |
266 | This will finalize the partitioning process, and format the drive in UFS for |
| 279 | FreeBSD to utilize. This will also mount the drive for you at the mount point |
267 | FreeBSD to utilize. This will also mount the drive for you at the mount point |
| 280 | specified earlier (<path>/mnt/gentoo</path>). You can verify this worked by |
268 | specified earlier (<path>/mnt/</path>). You can verify this worked by |
| 281 | running <c>mount</c>: |
269 | running <c>mount</c>: |
| 282 | </p> |
270 | </p> |
| 283 | |
271 | |
| 284 | <pre caption="Verifying the new disk layout was mounted with mount"> |
272 | <pre caption="Verifying the new disk layout was mounted with mount"> |
| 285 | # <i>mount</i> |
273 | # <i>mount</i> |
| 286 | ... |
274 | ... |
| 287 | /dev/ad0s1a on /mnt/gentoo (ufs, local) |
275 | /dev/ad0s1a on /mnt (ufs, local) |
| 288 | </pre> |
276 | </pre> |
| 289 | |
277 | |
| 290 | <p> |
278 | <p> |
| 291 | Now that you have mounted the target partition, it is time to start on the Gentoo |
279 | Now that you have mounted the target partition, it is time to start on the Gentoo |
| 292 | setup. |
280 | setup. |
| … | |
… | |
| 304 | <uri>http://gentoo.osuosl.org/experimental/x86/freebsd/stages/</uri>, grab the |
292 | <uri>http://gentoo.osuosl.org/experimental/x86/freebsd/stages/</uri>, grab the |
| 305 | latest snapshot, and unpack it into the mountpoint: |
293 | latest snapshot, and unpack it into the mountpoint: |
| 306 | </p> |
294 | </p> |
| 307 | |
295 | |
| 308 | <pre caption="Obtaining and unpacking a stage3 tarball"> |
296 | <pre caption="Obtaining and unpacking a stage3 tarball"> |
| 309 | # <i>cd /mnt/gentoo/</i> |
297 | # <i>cd /mnt/</i> |
| 310 | <comment>(Any other Gentoo mirror which includes the experimental/ directory will also work.)</comment> |
298 | <comment>(Any other Gentoo mirror which includes the experimental/ directory will also work.)</comment> |
| 311 | # <i>wget http://gentoo.osuosl.org/experimental/x86/freebsd/stages/stage3-x86-freebsd-6.2.tar.bz2</i> |
299 | # <i>wget http://gentoo.osuosl.org/experimental/x86/freebsd/stages/stage3-x86-freebsd-6.2.tar.bz2</i> |
| 312 | # <i>tar -jxvpf stage3-x86-freebsd-6.2.tar.bz2</i> |
300 | # <i>tar -jxvpf stage3-x86-freebsd-6.2.tar.bz2</i> |
| 313 | <comment>(You can delete the tarball with the following command if you want to.)</comment> |
301 | <comment>(You can delete the tarball with the following command if you want to.)</comment> |
| 314 | # <i>rm stage3-x86-freebsd-6.2.tar.bz2</i> |
302 | # <i>rm stage3-x86-freebsd-6.2.tar.bz2</i> |
| … | |
… | |
| 328 | filesystem from the currently running system into the Gentoo/FreeBSD mount |
316 | filesystem from the currently running system into the Gentoo/FreeBSD mount |
| 329 | point before proceeding with the chroot. |
317 | point before proceeding with the chroot. |
| 330 | </p> |
318 | </p> |
| 331 | |
319 | |
| 332 | <pre caption="Mounting the /dev filesystem and chrooting"> |
320 | <pre caption="Mounting the /dev filesystem and chrooting"> |
| 333 | # <i>mount -t devfs none /mnt/gentoo/dev/</i> |
321 | # <i>mount -t devfs none /mnt/dev/</i> |
| 334 | # <i>cp /etc/resolv.conf /mnt/gentoo/etc</i> |
322 | # <i>cp /etc/resolv.conf /mnt/etc/</i> |
| 335 | # <i>chroot /mnt/gentoo/ /bin/bash</i> |
323 | # <i>chroot /mnt/ /bin/bash</i> |
| 336 | # <i>env-update && source /etc/profile</i> |
324 | # <i>env-update && source /etc/profile</i> |
| 337 | </pre> |
325 | </pre> |
| 338 | |
326 | |
| 339 | <p> |
327 | <p> |
| 340 | After you obtain the Gentoo/FreeBSD overlay, it's time to link |
328 | After you obtain the Gentoo/FreeBSD overlay, it's time to link |
| … | |
… | |
| 384 | </section> |
372 | </section> |
| 385 | </chapter> |
373 | </chapter> |
| 386 | <chapter> |
374 | <chapter> |
| 387 | <title>Setting up for Booting</title> |
375 | <title>Setting up for Booting</title> |
| 388 | <section> |
376 | <section> |
|
|
377 | <title>Set your time zone</title> |
|
|
378 | <body> |
|
|
379 | |
|
|
380 | <p> |
|
|
381 | First make sure your date and time is set correctly using <c>date |
|
|
382 | yyyymmddHHMM</c>. Use UTC time. |
|
|
383 | </p> |
|
|
384 | |
|
|
385 | <pre caption="Set the date and UTC time"> |
|
|
386 | <comment>(Check the clock)</comment> |
|
|
387 | # <i>date</i> |
|
|
388 | Mon Mar 6 00:14:13 UTC 2006 |
|
|
389 | |
|
|
390 | <comment>(Set the current date and time if required)</comment> |
|
|
391 | # <i>date 200603060016</i> <comment>(Format is yyyymmddHHMM)</comment> |
|
|
392 | Mon Mar 6 00:16:00 UTC 2006 |
|
|
393 | </pre> |
|
|
394 | |
|
|
395 | <p> |
|
|
396 | Next, set your time zone information by using the correct listing in |
|
|
397 | <path>/usr/share/zoneinfo</path>. |
|
|
398 | </p> |
|
|
399 | |
|
|
400 | <pre caption="Setting your timezone"> |
|
|
401 | # <i>ls /usr/share/zoneinfo</i> |
|
|
402 | <comment>(Using Brussels as an example)</comment> |
|
|
403 | # <i>cp /usr/share/zoneinfo/Europe/Brussels /etc/localtime</i> |
|
|
404 | |
|
|
405 | # <i>date</i> |
|
|
406 | Wed Mar 8 00:46:05 CET 2006 |
|
|
407 | </pre> |
|
|
408 | |
|
|
409 | <p> |
|
|
410 | Edit <path>/etc/conf.d/clock</path> to define the time zone you used |
|
|
411 | previously. |
|
|
412 | </p> |
|
|
413 | |
|
|
414 | <pre caption="Edit /etc/conf.d/clock"> |
|
|
415 | # <i>nano -w /etc/conf.d/clock</i> |
|
|
416 | TIMEZONE="Europe/Brussels" |
|
|
417 | </pre> |
|
|
418 | |
|
|
419 | </body> |
|
|
420 | </section> |
|
|
421 | <section> |
| 389 | <title>Kernel Installation</title> |
422 | <title>Kernel Installation</title> |
| 390 | <body> |
423 | <body> |
| 391 | |
424 | |
| 392 | <p> |
425 | <p> |
| 393 | If you ran <c>emerge -e system</c>, the sources for the FreeBSD kernel were |
426 | If you ran <c>emerge -e system</c>, the sources for the FreeBSD kernel were |
| … | |
… | |
| 489 | <pre caption="Installing and setting up boot0"> |
522 | <pre caption="Installing and setting up boot0"> |
| 490 | # <i>emerge boot0</i> |
523 | # <i>emerge boot0</i> |
| 491 | <comment>(Leave the chroot environment)</comment> |
524 | <comment>(Leave the chroot environment)</comment> |
| 492 | # <i>exit</i> |
525 | # <i>exit</i> |
| 493 | <comment>(Issued from outside the chroot)</comment> |
526 | <comment>(Issued from outside the chroot)</comment> |
| 494 | # <i>fdisk -B -b /mnt/gentoo/boot/boot0 /dev/adX</i> |
527 | # <i>fdisk -B -b /mnt/boot/boot0 /dev/adX</i> |
| 495 | # <i>chroot /mnt/gentoo /bin/bash</i> |
528 | # <i>chroot /mnt/ /bin/bash</i> |
| 496 | # <i>disklabel -B adXsY</i> |
529 | # <i>disklabel -B adXsY</i> |
| 497 | </pre> |
530 | </pre> |
| 498 | |
531 | |
| 499 | <p> |
532 | <p> |
| 500 | If you need additional information on setting up <c>boot0</c>, please consult |
533 | If you need additional information on setting up <c>boot0</c>, please consult |
| … | |
… | |
| 551 | |
584 | |
| 552 | grub> quit |
585 | grub> quit |
| 553 | </pre> |
586 | </pre> |
| 554 | |
587 | |
| 555 | <p> |
588 | <p> |
|
|
589 | To make the loader find the kernel on a specific slice (the default is 'a'), |
|
|
590 | add a <c>vfs.root.mountfrom</c> line to the <path>/boot/loader.conf</path> |
|
|
591 | file: |
|
|
592 | </p> |
|
|
593 | |
|
|
594 | <pre caption="Tell the loader where to look for the kernel"> |
|
|
595 | # <i>echo 'vfs.root.mountfrom="ufs:ad0s1d"' >> /boot/loader.conf</i> |
|
|
596 | </pre> |
|
|
597 | |
|
|
598 | <p> |
| 556 | When you first boot, you may not receive a grub menu. If so, run this at the |
599 | When you first boot, you may not receive a grub menu. If so, run this at the |
| 557 | prompt: |
600 | prompt: |
| 558 | </p> |
601 | </p> |
| 559 | |
602 | |
| 560 | <pre caption="Booting the kernel with no menu"> |
603 | <pre caption="Booting the kernel with no menu"> |
| … | |
… | |
| 571 | <note> |
614 | <note> |
| 572 | For more information on configuring grub, please refer to the <uri |
615 | For more information on configuring grub, please refer to the <uri |
| 573 | link="/doc/en/handbook/handbook-x86.xml?part=1&chap=10#doc_chap2">Gentoo |
616 | link="/doc/en/handbook/handbook-x86.xml?part=1&chap=10#doc_chap2">Gentoo |
| 574 | Linux Handbook</uri>. |
617 | Linux Handbook</uri>. |
| 575 | </note> |
618 | </note> |
|
|
619 | |
|
|
620 | <warn> |
|
|
621 | Grub doesn't follow UFS symlinks so be sure to delete the |
|
|
622 | <path>/boot/grub/menu.lst</path> symlink and to use <path>menu.lst</path> to |
|
|
623 | setup Grub (<path>grub.conf</path> isn't used). |
|
|
624 | </warn> |
| 576 | |
625 | |
| 577 | </body> |
626 | </body> |
| 578 | </section> |
627 | </section> |
| 579 | <section> |
628 | <section> |
| 580 | <title>System configuration</title> |
629 | <title>System configuration</title> |