/[gentoo]/xml/htdocs/doc/en/handbook/hb-install-x86+amd64-bootloader.xml
Gentoo

Contents of /xml/htdocs/doc/en/handbook/hb-install-x86+amd64-bootloader.xml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.39 - (show annotations) (download) (as text)
Tue Dec 31 20:29:23 2013 UTC (6 months, 4 weeks ago) by swift
Branch: MAIN
CVS Tags: HEAD
Changes since 1.38: +16 -8 lines
File MIME type: application/xml
Fix bug #496558 - make partitioning more consistent, add note about "strange" partitions in example with dualboot

1 <?xml version='1.0' encoding='UTF-8'?>
2 <!DOCTYPE sections SYSTEM "/dtd/book.dtd">
3
4 <!-- The content of this document is licensed under the CC-BY-SA license -->
5 <!-- See http://creativecommons.org/licenses/by-sa/2.5 -->
6
7 <!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/handbook/hb-install-x86+amd64-bootloader.xml,v 1.38 2013/12/18 10:13:54 swift Exp $ -->
8
9 <sections>
10
11 <version>23</version>
12 <date>2013-12-31</date>
13
14 <section>
15 <title>Making your Choice</title>
16 <subsection>
17 <title>Introduction</title>
18 <body>
19
20 <p>
21 Now that your kernel is configured and compiled and the necessary system
22 configuration files are filled in correctly, it is time to install a
23 program that will fire up your kernel when you start the system. Such a
24 program is called a <e>bootloader</e>.
25 </p>
26
27 </body>
28 <body test="contains('AMD64 x86', func:keyval('arch'))">
29 <p>
30 For <keyval id="arch"/>, Gentoo Linux provides <uri
31 link="#grub2">GRUB2</uri>, <uri link="#lilo">LILO</uri> and
32 <uri link="#grub">GRUB Legacy</uri>.
33 </p>
34
35 </body>
36 <body>
37 <p>
38 But before we install the bootloader, we inform you how to configure
39 framebuffer (assuming you want it of course). With framebuffer you can run the
40 Linux command line with (limited) graphical features (such as using the nice
41 bootsplash image Gentoo provides).
42 </p>
43
44 </body>
45 </subsection>
46 <subsection>
47 <title>Optional: Framebuffer</title>
48 <body>
49
50 <p>
51 <e>If</e> you have configured your kernel with framebuffer support (or you used
52 <c>genkernel</c> default kernel configuration), you can activate it by adding a
53 a <c>video</c> statement to your bootloader configuration file.
54 </p>
55
56 <p>
57 First of all, you need to know your framebuffer device. You should have used
58 <c>uvesafb</c> as the <e>VESA driver</e>.
59 </p>
60
61 <p>
62 The <c>video</c> statement controls framebuffer display options. It needs to be
63 given the framebuffer driver followed by the control statements you wish to
64 enable. All variables are listed in
65 <path>/usr/src/linux/Documentation/fb/uvesafb.txt</path>. The most-used options
66 are:
67 </p>
68
69 <table>
70 <tr>
71 <th>Control</th>
72 <th>Description</th>
73 </tr>
74 <tr>
75 <ti>ywrap</ti>
76 <ti>
77 Assume that the graphical card can wrap around its memory (i.e. continue at
78 the beginning when it has approached the end)
79 </ti>
80 </tr>
81 <tr>
82 <ti>mtrr:<c>n</c></ti>
83 <ti>
84 Setup MTRR registers. <c>n</c> can be:<br/>
85 0 - disabled<br/>
86 1 - uncachable<br/>
87 2 - write-back<br/>
88 3 - write-combining<br/>
89 4 - write-through
90 </ti>
91 </tr>
92 <tr>
93 <ti><c>mode</c></ti>
94 <ti>
95 Set up the resolution, color depth and refresh rate. For instance,
96 <c>1024x768-32@85</c> for a resolution of 1024x768, 32 bit color depth and a
97 refresh rate of 85 Hz.
98 </ti>
99 </tr>
100 </table>
101
102 <p>
103 The result could be something like
104 <c>video=uvesafb:mtrr:3,ywrap,1024x768-32@85</c>. Write this setting down; you
105 will need it shortly.
106 </p>
107
108 <p test="func:keyval('arch')='IA64'">
109 Now, you should install the <uri link="#elilo">elilo bootloader</uri>.
110 </p>
111
112 <p test="not(func:keyval('arch')='IA64')">
113 Now continue by installing <uri link="#grub">GRUB</uri>, <uri
114 link="#grub2">GRUB2</uri> <e>or</e> <uri
115 link="#lilo">LILO</uri>.
116 </p>
117
118 </body>
119 </subsection>
120 </section>
121 <section id="grub2" test="contains('AMD64 x86', func:keyval('arch'))">
122 <title>Default: Using GRUB2</title>
123 <subsection>
124 <title>Installing GRUB2</title>
125 <body>
126
127 <p>
128 GRUB2 is provided through the <c>sys-boot/grub</c> package.
129 </p>
130
131 <pre caption="Installing GRUB2">
132 # <i>emerge sys-boot/grub</i>
133 </pre>
134
135 <p>
136 The GRUB2 software is now installed on the system, but not activated yet.
137 </p>
138
139 </body>
140 </subsection>
141 <subsection>
142 <title>Configuring GRUB2</title>
143 <body>
144
145 <p>
146 First, let us install the necessary GRUB2 files in <path>/boot/grub</path>.
147 Assuming the first disk (the one where the system boots from) is
148 <path>/dev/sda</path>, the following command will do this for us:
149 </p>
150
151 <pre caption="Installing the GRUB2 files in /boot/grub">
152 # <i>grub2-install /dev/sda</i>
153 </pre>
154
155 <p>
156 Next, we can generate the GRUB2 configuration based on the user configuration
157 specified in the <path>/etc/default/grub</path> file and
158 <path>/etc/grub.d</path> scripts. In most cases, no configuration is needed
159 by users as GRUB2 will automatically detect which kernel to boot (the highest
160 one available in <path>/boot</path>) and what the root file system is.
161 </p>
162
163 <p>
164 To generate the final GRUB2 configuration, run the <c>grub2-mkconfig</c>
165 command:
166 </p>
167
168 <pre caption="Generating GRUB2 configuration">
169 # <i>grub2-mkconfig -o /boot/grub/grub.cfg</i>
170 Generating grub.cfg ...
171 Found linux image: /boot/<keyval id="kernel-name" />
172 Found initrd image: /boot/<keyval id="genkernel-initrd" />
173 done
174 </pre>
175
176 <p>
177 The output of the command <e>must</e> mention that at least one Linux image is
178 found, as those are needed to boot the system. If you use initramfs or used
179 <c>genkernel</c> to build the kernel, the correct initrd image should be
180 detected as well. If this is not the case, go to <path>/boot</path> and check
181 the contents using the <c>ls</c> command. If the files are indeed missing, go
182 back to the kernel configuration and installation instructions.
183 </p>
184
185 </body>
186 </subsection>
187 </section>
188 <section id="lilo" test="contains('AMD64 x86', func:keyval('arch'))">
189 <title>Alternative: Using LILO</title>
190 <subsection>
191 <title>Installing LILO</title>
192 <body>
193
194 <p>
195 LILO, the LInuxLOader, is the tried and true workhorse of Linux
196 bootloaders. However, it lacks some features that GRUB has (which is
197 also the reason why GRUB is currently gaining popularity). The reason
198 why LILO is still used is that, on some systems, GRUB doesn't work and
199 LILO does. Of course, it is also used because some people know LILO and
200 want to stick with it. Either way, Gentoo supports both, and apparently
201 you have chosen to use LILO.
202 </p>
203
204 <p>
205 Installing LILO is a breeze; just use <c>emerge</c>.
206 </p>
207
208 <pre caption="Installing LILO">
209 # <i>emerge lilo</i>
210 </pre>
211
212 </body>
213 </subsection>
214 <subsection>
215 <title>Configuring LILO</title>
216 <body>
217
218 <p>
219 To configure LILO, you must create <path>/etc/lilo.conf</path>. Fire up
220 your favorite editor (in this handbook we use <c>nano</c> for
221 consistency) and create the file.
222 </p>
223
224 <pre caption="Creating /etc/lilo.conf">
225 # <i>nano -w /etc/lilo.conf</i>
226 </pre>
227
228 <p>
229 Some sections ago we have asked you to remember the kernel-image name
230 you have created. In the next example <path>lilo.conf</path> we use the
231 example partitioning scheme.
232 </p>
233
234 <p>
235 Make sure you use <e>your</e> kernel image filename and, if appropriate,
236 <e>your</e> initrd image filename.
237 </p>
238
239 <note>
240 If your root filesystem is JFS, you <e>must</e> add a <c>append="ro"</c>
241 line after each boot item since JFS needs to replay its log before it allows
242 read-write mounting.
243 </note>
244
245 <pre caption="Example /etc/lilo.conf">
246 boot=/dev/sda <comment># Install LILO in the MBR</comment>
247 prompt <comment># Give the user the chance to select another section</comment>
248 timeout=50 <comment># Wait 5 (five) seconds before booting the default section</comment>
249 default=gentoo <comment># When the timeout has passed, boot the "gentoo" section</comment>
250
251 image=/boot/<keyval id="kernel-name"/>
252 label=gentoo <comment># Name we give to this section</comment>
253 read-only <comment># Start with a read-only root. Do not alter!</comment>
254 root=/dev/sda4 <comment># Location of the root filesystem</comment>
255
256 image=/boot/<keyval id="kernel-name"/>
257 label=gentoo.rescue <comment># Name we give to this section</comment>
258 read-only <comment># Start with a read-only root. Do not alter!</comment>
259 root=/dev/sda4 <comment># Location of the root filesystem</comment>
260 append="init=/bin/bb" <comment># Launch the Gentoo static rescue shell</comment>
261
262 <comment># The next two lines are only if you dualboot with a Windows system.</comment>
263 <comment># In this example, Windows is hosted on /dev/sda6.</comment>
264 other=/dev/sda6
265 label=windows
266 </pre>
267
268 <note>
269 If you use a different partitioning scheme and/or kernel image, adjust
270 accordingly.
271 </note>
272
273 <p>
274 If, while building the Linux kernel, you opted to include an initramfs to boot
275 from, then you will need to change the configuration by referring to this
276 initramfs file and telling the initramfs where your real root device is at:
277 </p>
278
279 <pre caption="LILO snippet for initramfs-enabled kernel builds">
280 image=/boot/<keyval id="kernel-name"/>
281 label=gentoo
282 read-only
283 <i>append="real_root=/dev/sda4"</i>
284 <i>initrd=/boot/<keyval id="genkernel-initrd" /></i>
285 </pre>
286
287 <p>
288 If you need to pass any additional options to the kernel, add an
289 <c>append</c> statement to the section. As an example, we add the
290 <c>video</c> statement to enable framebuffer:
291 </p>
292
293 <pre caption="Using append to add kernel options">
294 image=/boot/<keyval id="kernel-name"/>
295 label=gentoo
296 read-only
297 root=/dev/sda4
298 <i>append="video=uvesafb:mtrr,ywrap,1024x768-32@85"</i>
299 </pre>
300
301 <p>
302 If you're using a 2.6.7 or higher kernel and you jumpered your harddrive
303 because the BIOS can't handle large harddrives you'll need to append
304 <c>sda=stroke</c>. Replace sda with the device that requires this option.
305 </p>
306
307 <p>
308 <c>genkernel</c> users should know that their kernels use the same boot options
309 as is used for the Installation CD. For instance, if you have SCSI devices, you
310 should add <c>doscsi</c> as kernel option.
311 </p>
312
313 <p>
314 Now save the file and exit. To finish up, you have to run <c>/sbin/lilo</c> so
315 LILO can apply the <path>/etc/lilo.conf</path> to your system (i.e. install
316 itself on the disk). Keep in mind that you'll also have to run
317 <c>/sbin/lilo</c> every time you install a new kernel or make any changes to
318 the menu.
319 </p>
320
321 <pre caption="Finishing the LILO installation">
322 # <i>/sbin/lilo</i>
323 </pre>
324
325 <p>
326 If you have more questions regarding LILO, please consult its <uri
327 link="http://en.wikipedia.org/wiki/LILO_(boot_loader)">wikipedia page</uri>.
328 </p>
329
330 <p>
331 You can now continue with <uri link="#reboot">Rebooting the System</uri>.
332 </p>
333
334 </body>
335 </subsection>
336 </section>
337 <section id="grub" test="contains('AMD64 x86',func:keyval('arch'))">
338 <title>Alternative: Using GRUB Legacy</title>
339 <subsection>
340 <title>What is Legacy?</title>
341 <body>
342
343 <p>
344 GRUB has been reworked and a new release dubbed GRUB2 is made available. The new
345 GRUB2 codebase is quite different from the current GRUB, which is why this GRUB
346 version is now dubbed as "GRUB Legacy".
347 </p>
348
349 </body>
350 </subsection>
351 <subsection>
352 <title>Understanding GRUB's terminology</title>
353 <body>
354
355 <p>
356 The most critical part of understanding GRUB is getting comfortable with how
357 GRUB refers to hard drives and partitions. Your Linux partition
358 <path>/dev/sda2</path> will most likely be called <path>(hd0,1)</path> under
359 GRUB. Notice the parentheses around the <path>hd0,1</path> - they are
360 required.
361 </p>
362
363 <p>
364 Hard drives count from zero rather than "a" and partitions start at zero
365 rather than one. Be aware too that with the hd devices, only hard drives are
366 counted, not atapi-ide devices such as cdrom players and burners. Also, the
367 same construct is used with SCSI drives. (Normally they get higher numbers
368 than IDE drives except when the BIOS is configured to boot from SCSI devices.)
369 When you ask the BIOS to boot from a different hard disk (for instance your
370 primary slave), <e>that</e> harddisk is seen as <path>hd0</path>.
371 </p>
372
373 <p>
374 Assuming you have a hard drive on <path>/dev/sda</path> and two more on
375 <path>/dev/sdb</path> and <path>/dev/sdc</path>, <path>/dev/sdb7</path> gets
376 translated to <path>(hd1,6)</path>. It might sound tricky and tricky it is
377 indeed, but as we will see, GRUB offers a tab completion mechanism that comes
378 handy for those of you having a lot of hard drives and partitions and who are a
379 little lost in the GRUB numbering scheme.
380 </p>
381
382 <p>
383 Having gotten the feel for that, it is time to install GRUB.
384 </p>
385
386 </body>
387 </subsection>
388 <subsection>
389 <title>Installing GRUB</title>
390 <body>
391
392 <p>
393 To install GRUB Legacy, let's first emerge it:
394 </p>
395
396 <impo test="func:keyval('arch')='AMD64'">
397 If you are using a non-multilib <uri
398 link="?part=1&amp;chap=6#doc_chap2">profile</uri> and still intend to use the
399 GRUB Legacy (instead of GRUB2), you should <b>not</b> emerge
400 <c>grub:0</c>, but instead you should emerge <c>grub-static</c> (only possible
401 if you have enabled IA-32 emulation).
402 </impo>
403
404 <pre caption="Installing GRUB">
405 # <i>emerge sys-boot/grub:0</i>
406 </pre>
407
408 <p>
409 Although GRUB is now installed, we still need to write up a
410 configuration file for it and place GRUB in our MBR so that GRUB automatically
411 boots your newly created kernel. Create <path>/boot/grub/grub.conf</path> with
412 <c>nano</c> (or, if applicable, another editor):
413 </p>
414
415 <pre caption="Creating /boot/grub/grub.conf">
416 # <i>nano -w /boot/grub/grub.conf</i>
417 </pre>
418
419 <p>
420 Now we are going to write up a <path>grub.conf</path>. Make
421 sure you use <e>your</e> kernel image filename and, if appropriate, <e>your</e>
422 initrd image filename.
423 </p>
424
425 <note>
426 Grub assigns device designations from the BIOS. If you change your BIOS
427 settings, your device letters and numbers may change, too. For example, if you
428 change your device boot order, you may need to change your grub configuration.
429 </note>
430
431 <note>
432 If your root filesystem is JFS, you <e>must</e> add " ro" to the <c>kernel</c>
433 line since JFS needs to replay its log before it allows read-write mounting.
434 </note>
435
436 <note>
437 If dualboot with Windows is used, the partitioning example used in this
438 book will not be sufficient (our example uses all four primary partitions
439 for Linux, whereas at least one would need to be extended if Windows is
440 installed on a logical partition). Please proceed with caution and consider
441 the listing to be an example that needs to be modified to suit your own needs.
442 </note>
443
444 <pre caption="Example grub.conf">
445 <comment># Which listing to boot as default. 0 is the first, 1 the second etc.</comment>
446 default 0
447 <comment># How many seconds to wait before the default listing is booted.</comment>
448 timeout 30
449 <comment># Nice, fat splash-image to spice things up :)
450 # Comment out if you don't have a graphics card installed</comment>
451 splashimage=(hd0,1)/boot/grub/splash.xpm.gz
452
453 title Gentoo Linux <keyval id="kernel-version"/>
454 <comment># Partition where the kernel image (or operating system) is located</comment>
455 root (hd0,1)
456 kernel /boot/<keyval id="kernel-name"/> root=/dev/sda4
457
458 title Gentoo Linux <keyval id="kernel-version"/> (rescue)
459 <comment># Partition where the kernel image (or operating system) is located</comment>
460 root (hd0,1)
461 kernel /boot/<keyval id="kernel-name"/> root=/dev/sda4 init=/bin/bb
462
463 <comment># The next four lines are only if you dualboot with a Windows system.</comment>
464 <comment># In this case, Windows is hosted on /dev/sda6.</comment>
465 title Windows XP
466 rootnoverify (hd0,5)
467 makeactive
468 chainloader +1
469 </pre>
470
471 <p>
472 If, while building the Linux kernel, you opted to include an initramfs to boot
473 from, then you will need to change the configuration by referring to this
474 initramfs file and telling the initramfs where your real root device is at:
475 </p>
476
477 <pre caption="GRUB snippet for initramfs-enabled kernel builds">
478 title Gentoo Linux <keyval id="kernel-version"/>
479 root (hd0,1)
480 kernel /boot/<keyval id="kernel-version"/> <i>real_</i>root=/dev/sda4
481 <i>initrd /boot/<keyval id="genkernel-initrd"/></i>
482 </pre>
483
484 <p>
485 If you used a different partitioning scheme and/or kernel image, adjust
486 accordingly. However, make sure that anything that follows a GRUB-device (such
487 as <path>(hd0,1)</path>) is relative to the mountpoint, not the root. In other
488 words, <path>(hd0,1)/grub/splash.xpm.gz</path> is in reality
489 <path>/boot/grub/splash.xpm.gz</path> since <path>(hd0,1)</path> is
490 <path>/boot</path>.
491 </p>
492
493 <p>
494 Besides, if you chose to use a different partitioning scheme and did not put
495 <path>/boot</path> in a separate partition, the <path>/boot</path> prefix used
496 in the above code samples is really <e>required</e>. If you followed our
497 suggested partitioning plan, the <path>/boot</path> prefix it not required, but
498 a <path>boot</path> symlink makes it work. In short, the above examples should
499 work whether you defined a separate <path>/boot</path> partition or not.
500 </p>
501
502 <p>
503 If you need to pass any additional options to the kernel, simply add them to the
504 end of the kernel command. We're already passing one option
505 (<c>root=/dev/sda4</c> or <c>real_root=/dev/sda4</c>), but you can pass others
506 as well, such as the <c>video</c> statement for framebuffer as we discussed
507 previously.
508 </p>
509
510 <p>
511 If your bootloader configuration file contains the real_root parameter, use the
512 real_rootflags parameter to set root filesystem mount options.
513 </p>
514
515 <p>
516 If you're using a 2.6.7 or higher kernel and you jumpered your harddrive
517 because the BIOS can't handle large harddrives you'll need to append
518 <c>sda=stroke</c>. Replace sda with the device that requires this option.
519 </p>
520
521 <p>
522 <c>genkernel</c> users should know that their kernels use the same boot options
523 as is used for the Installation CD. For instance, if you have SCSI devices, you
524 should add <c>doscsi</c> as kernel option.
525 </p>
526
527 <p>
528 Now save the <path>grub.conf</path> file and exit. You still need to install
529 GRUB in the MBR (Master Boot Record) so that GRUB is automatically executed when
530 you boot your system.
531 </p>
532
533 <p>
534 The GRUB developers recommend the use of <c>grub-install</c>. However, if for
535 some reason <c>grub-install</c> fails to work correctly you still have the
536 option to manually install GRUB.
537 </p>
538
539 <p>
540 Continue with <uri link="#grub-install-auto">Default: Setting up GRUB using
541 grub-install</uri> or <uri link="#grub-install-manual">Alternative: Setting up
542 GRUB using manual instructions</uri>.
543 </p>
544
545 </body>
546 </subsection>
547 <subsection id="grub-install-auto">
548 <title>Default: Setting up GRUB using grub-install</title>
549 <body>
550
551 <p>
552 To install GRUB you will need to issue the <c>grub-install</c> command.
553 However, <c>grub-install</c> won't work off-the-shelf since we are inside a
554 chrooted environment. We need to create <path>/etc/mtab</path> which lists all
555 mounted filesystems. Fortunately, there is an easy way to accomplish this -
556 just copy over <path>/proc/mounts</path> to <path>/etc/mtab</path>, excluding
557 the <c>rootfs</c> line if you haven't created a separate boot partition. The
558 following command will work in both cases:
559 </p>
560
561 <pre caption="Creating /etc/mtab">
562 # <i>grep -v rootfs /proc/mounts &gt; /etc/mtab</i>
563 </pre>
564
565 <p>
566 When using Linux virtio disks, we need to tell grub where to find the disks as
567 the <c>grub-install</c> command will otherwise fail. This is done by adding the
568 device definition to the <path>device.map</path> file:
569 </p>
570
571 <pre caption="Adding the virtio disk to the device map table">
572 # <i>echo "(hd0) /dev/vda" >> /boot/grub/device.map</i>
573 </pre>
574
575 <p>
576 Now we can install GRUB using <c>grub-install</c>:
577 </p>
578
579 <pre caption="Running grub-install">
580 # <i>grub-install --no-floppy /dev/sda</i>
581 </pre>
582
583 <p>
584 If you have more questions regarding GRUB, please consult the <uri
585 link="http://www.gnu.org/software/grub/grub-faq.html">GRUB FAQ</uri>, the <uri
586 link="http://grub.enbug.org/GrubLegacy">GRUB Wiki</uri>, or read <c>info
587 grub</c> in your terminal.
588 </p>
589
590 <p>
591 Continue with <uri link="#reboot">Rebooting the System</uri>.
592 </p>
593
594 </body>
595 </subsection>
596 <subsection id="grub-install-manual">
597 <title>Alternative: Setting up GRUB using manual instructions</title>
598 <body>
599
600 <p>
601 To start configuring GRUB, you type in <c>grub</c>. You'll be presented
602 with the <path>grub&gt;</path> grub command-line prompt. Now, you need to type
603 in the right commands to install the GRUB boot record onto your hard drive.
604 </p>
605
606 <pre caption="Starting the GRUB shell">
607 # <i>grub --no-floppy</i>
608 </pre>
609
610 <note>
611 If your system does not have any floppy drives, add the <c>--no-floppy</c>
612 option to the above command to prevent grub from probing the (non-existing)
613 floppy drives.
614 </note>
615
616 <p>
617 In the example configuration we want to install GRUB so that it reads its
618 information from the boot partition <path><keyval id="/boot"/></path>, and
619 installs the GRUB boot record on the hard drive's MBR (master boot record) so
620 that the first thing we see when we turn on the computer is the GRUB prompt. Of
621 course, if you haven't followed the example configuration during the
622 installation, change the commands accordingly.
623 </p>
624
625 <p>
626 The tab completion mechanism of GRUB can be used from within GRUB.
627 For instance, if you type in "<c>root (</c>" followed by a TAB, you will
628 be presented with a list of devices (such as <path>hd0</path>). If you
629 type in "<c>root (hd0,</c>" followed by a TAB, you will receive a list
630 of available partitions to choose from (such as <path>hd0,1</path>).
631 </p>
632
633 <p>
634 By using the tab completion, setting up GRUB should be not that hard.
635 Now go on, configure GRUB, shall we? :-)
636 </p>
637
638 <pre caption="Installing GRUB in the MBR">
639 grub&gt; <i>root (hd0,1)</i> <comment>(Specify where your /boot partition resides)</comment>
640 grub&gt; <i>setup (hd0)</i> <comment>(Install GRUB in the MBR)</comment>
641 grub&gt; <i>quit</i> <comment>(Exit the GRUB shell)</comment>
642 </pre>
643
644 <note>
645 If you want to install GRUB in a certain partition instead of the MBR,
646 you have to alter the <c>setup</c> command so it points to the right
647 partition. For instance, if you want GRUB installed in
648 <path>/dev/sda4</path>, then the command becomes <c>setup (hd0,3)</c>.
649 Few users however want to do this.
650 </note>
651
652 <p>
653 If you have more questions regarding GRUB, please consult the <uri
654 link="http://www.gnu.org/software/grub/grub-faq.html">GRUB FAQ</uri>, the <uri
655 link="http://grub.enbug.org/GrubLegacy">GRUB Wiki</uri>, or read <c>info
656 grub</c> in your terminal.
657 </p>
658
659 <p>
660 Continue with <uri link="#reboot">Rebooting the System</uri>.
661 </p>
662
663 </body>
664 </subsection>
665 </section>
666
667 <section id="elilo" test="func:keyval('arch')='IA64'">
668 <title>Default: Installing elilo</title>
669 <body>
670
671 <p>
672 On the IA64 platform, the boot loader is called <c>elilo</c>. You may need to
673 emerge it on your machine first.
674 </p>
675
676 <pre caption="Installing elilo">
677 # <i>emerge elilo</i>
678 </pre>
679
680 <p>
681 You can find the configuration file at <path>/etc/elilo.conf</path> and a
682 sample file in the typical docs dir
683 <path>/usr/share/doc/elilo-&lt;ver&gt;/</path>. Here is another sample
684 configuration:
685 </p>
686
687 <pre caption="/etc/elilo.conf example">
688 boot=/dev/sda1
689 delay=30
690 timeout=50
691 default=Gentoo
692 append="console=ttyS0,9600"
693 prompt
694
695 image=/vmlinuz
696 label=Gentoo
697 root=/dev/sda2
698 read-only
699
700 image=/vmlinuz.old
701 label=Gentoo.old
702 root=/dev/sda2
703 read-only
704 </pre>
705
706 <p>
707 The <c>boot</c> line tells elilo the location of the boot partition (in this
708 case, <path>/dev/sda1</path>). The <c>delay</c> line sets the number of
709 10<sup>th</sup> of seconds before automatically booting the default when in
710 non-interactive mode. The <c>timeout</c> line is just like the delay line but
711 for interactive mode. The <c>default</c> line sets the default kernel entry
712 (which is defined below). The <c>append</c> line adds extra options to the
713 kernel command line. The <c>prompt</c> sets the default elilo behavior to
714 interactive.
715 </p>
716
717 <p>
718 The sections that start with <c>image</c> define different bootable images.
719 Each image has a nice <c>label</c>, a <c>root</c> filesystem, and will only
720 mount the root filesystem <c>read-only</c>.
721 </p>
722
723 <p>
724 If, while building the Linux kernel, you opted to include an initramfs to boot
725 from, then you will need to change the configuration by referring to this
726 initramfs file and telling the initramfs where your real root device is at:
727 </p>
728
729 <pre caption="ELILO snippet for initramfs-enabled kernel-builds">
730 image=/vmlinuz
731 label=Gentoo
732 <i>initrd=/<keyval id="genkernel-initrd"/></i>
733 <i>append = "initrd=<keyval id="genkernel-initrd"/> real_root=/dev/sda2 console=ttyS0,9600"</i>
734 read-only
735 </pre>
736
737 <p>
738 When configuration is done, just run <c>elilo --efiboot</c>. The
739 <c>--efiboot</c> option adds a menu entry for Gentoo Linux to the EFI Boot
740 Manager.
741 </p>
742
743 <pre caption="Applying the elilo configuration">
744 # <i>elilo --efiboot</i>
745 </pre>
746
747 <p>
748 Now continue with <uri link="#reboot">Rebooting the System</uri>.
749 </p>
750
751 </body>
752 </section>
753 <section id="reboot">
754 <title>Rebooting the System</title>
755 <subsection>
756 <body>
757
758 <p>
759 Exit the chrooted environment and unmount all mounted partitions. Then type in
760 that one magical command you have been waiting for: <c>reboot</c>.
761 </p>
762
763 <pre caption="Unmounting all partitions and rebooting" test="func:keyval('arch')='IA64'">
764 # <i>exit</i>
765 cdimage ~# <i>cd</i>
766 cdimage ~# <i>umount -l /mnt/gentoo/dev{/pts,/shm,}</i>
767 cdimage ~# <i>umount -l /mnt/gentoo{/boot,/sys,/proc,}</i>
768 cdimage ~# <i>reboot</i>
769 </pre>
770
771 <pre caption="Unmounting all partitions and rebooting" test="not(func:keyval('arch')='IA64')">
772 # <i>exit</i>
773 cdimage ~# <i>cd</i>
774 cdimage ~# <i>umount -l /mnt/gentoo/dev{/shm,/pts,}</i>
775 cdimage ~# <i>umount -l /mnt/gentoo{/boot,/proc,}</i>
776 cdimage ~# <i>reboot</i>
777 </pre>
778
779 <p>
780 Of course, don't forget to remove the bootable CD, otherwise the CD will be
781 booted again instead of your new Gentoo system.
782 </p>
783
784 <p test="func:keyval('arch')='IA64'">
785 When you reboot you should see a new Gentoo Linux menu option in the EFI Boot
786 Manager which will boot Gentoo.
787 </p>
788
789 <p>
790 Once rebooted in your Gentoo installation, finish up with <uri
791 link="?part=1&amp;chap=11">Finalizing your Gentoo Installation</uri>.
792 </p>
793
794 </body>
795 </subsection>
796 </section>
797 </sections>

  ViewVC Help
Powered by ViewVC 1.1.20