2004-05-03 11:59:46 +01:00
|
|
|
<?xml version="1.0" encoding="ISO-8859-1"?>
|
2005-01-30 18:06:48 +00:00
|
|
|
<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [
|
2004-05-03 11:59:46 +01:00
|
|
|
<!ENTITY % general-entities SYSTEM "../general.ent">
|
|
|
|
%general-entities;
|
|
|
|
]>
|
2004-01-27 22:29:49 +00:00
|
|
|
<sect1 id="ch-bootable-grub">
|
2005-01-30 11:27:57 +00:00
|
|
|
<title>Making the LFS System Bootable</title>
|
2004-05-03 11:59:46 +01:00
|
|
|
<?dbhtml filename="grub.html"?>
|
|
|
|
|
2003-09-11 22:35:35 +01:00
|
|
|
|
2004-12-20 18:08:34 +00:00
|
|
|
<para>We highly recommend that you create a Grub boot floppy diskette just in case.
|
2003-10-15 09:31:59 +01:00
|
|
|
Insert a blank floppy diskette and run the following commands:</para>
|
|
|
|
|
|
|
|
<screen><userinput>dd if=/boot/grub/stage1 of=/dev/fd0 bs=512 count=1
|
|
|
|
dd if=/boot/grub/stage2 of=/dev/fd0 bs=512 seek=1</userinput></screen>
|
|
|
|
|
|
|
|
<para>Remove the diskette and store it somewhere safe. Now we'll run the
|
2004-06-19 18:46:53 +01:00
|
|
|
<command>grub</command> shell:</para>
|
2003-09-12 01:47:51 +01:00
|
|
|
|
2003-10-10 00:22:07 +01:00
|
|
|
<screen><userinput>grub</userinput></screen>
|
2003-09-12 01:47:51 +01:00
|
|
|
|
2003-10-08 23:31:01 +01:00
|
|
|
<para>First, tell Grub where to search for its <filename>stage{1,2}</filename>
|
2004-05-03 11:59:46 +01:00
|
|
|
files -- you can use the Tab key everywhere to make Grub show the alternatives:</para>
|
2003-09-12 01:47:51 +01:00
|
|
|
|
2003-10-10 00:22:07 +01:00
|
|
|
<screen><userinput>root (hd0,3)</userinput></screen>
|
2003-09-12 01:47:51 +01:00
|
|
|
|
2004-05-03 11:59:46 +01:00
|
|
|
<para>Tell Grub to install itself into the MBR (Master Boot Record) of
|
2004-06-19 18:46:53 +01:00
|
|
|
<filename class="partition">hda</filename>:</para>
|
2003-09-12 01:47:51 +01:00
|
|
|
|
2003-10-10 00:22:07 +01:00
|
|
|
<screen><userinput>setup (hd0)</userinput></screen>
|
2003-10-08 23:31:01 +01:00
|
|
|
|
|
|
|
<para>If all is well, Grub will have reported finding its files in
|
2004-06-19 18:46:53 +01:00
|
|
|
<filename class="directory">/boot/grub</filename>. That's all there is to it:</para>
|
2003-10-08 23:31:01 +01:00
|
|
|
|
2003-10-10 00:22:07 +01:00
|
|
|
<screen><userinput>quit</userinput></screen>
|
2003-10-08 23:31:01 +01:00
|
|
|
|
2004-05-03 11:59:46 +01:00
|
|
|
<para>Now we need to create a <quote>menu list</quote> file, defining Grub's
|
|
|
|
boot menu:</para>
|
2003-10-08 23:31:01 +01:00
|
|
|
|
2004-06-19 18:46:53 +01:00
|
|
|
<screen><userinput>cat > /boot/grub/menu.lst << "EOF"
|
2005-01-30 12:51:22 +00:00
|
|
|
<literal># Begin /boot/grub/menu.lst
|
2003-09-12 01:47:51 +01:00
|
|
|
|
2003-10-08 23:31:01 +01:00
|
|
|
# By default boot the first menu entry.
|
2003-09-12 01:47:51 +01:00
|
|
|
default 0
|
|
|
|
|
2003-10-08 23:31:01 +01:00
|
|
|
# Allow 30 seconds before booting the default.
|
2003-09-12 01:47:51 +01:00
|
|
|
timeout 30
|
|
|
|
|
2003-10-08 23:31:01 +01:00
|
|
|
# Use prettier colors.
|
2003-09-12 01:47:51 +01:00
|
|
|
color green/black light-green/black
|
|
|
|
|
2003-10-08 23:31:01 +01:00
|
|
|
# The first entry is for LFS.
|
2004-05-04 18:34:59 +01:00
|
|
|
title LFS &version;
|
2003-09-12 07:50:02 +01:00
|
|
|
root (hd0,3)
|
2005-01-30 12:51:22 +00:00
|
|
|
kernel /boot/lfskernel-&linux-version; root=/dev/hda4</literal>
|
2004-06-19 18:46:53 +01:00
|
|
|
EOF</userinput></screen>
|
2003-09-12 01:47:51 +01:00
|
|
|
|
2004-01-26 22:23:41 +00:00
|
|
|
<para>You may want to add an entry for your host distribution. It might look
|
2003-10-08 23:31:01 +01:00
|
|
|
like this:</para>
|
2003-09-12 01:47:51 +01:00
|
|
|
|
2004-06-19 18:46:53 +01:00
|
|
|
<screen><userinput>cat >> /boot/grub/menu.lst << "EOF"
|
2005-01-30 12:51:22 +00:00
|
|
|
<literal>title Red Hat
|
2003-09-12 07:50:02 +01:00
|
|
|
root (hd0,2)
|
2004-01-09 23:45:52 +00:00
|
|
|
kernel /boot/kernel-2.4.20 root=/dev/hda3
|
2005-01-30 12:51:22 +00:00
|
|
|
initrd /boot/initrd-2.4.20</literal>
|
2004-06-19 18:46:53 +01:00
|
|
|
EOF</userinput></screen>
|
2003-09-12 01:47:51 +01:00
|
|
|
|
|
|
|
<para>Also, if you happen to dual-boot Windows, the following entry should
|
|
|
|
allow booting it:</para>
|
|
|
|
|
2004-06-19 18:46:53 +01:00
|
|
|
<screen><userinput>cat >> /boot/grub/menu.lst << "EOF"
|
2005-01-30 12:51:22 +00:00
|
|
|
<literal>title Windows
|
2003-09-12 07:50:02 +01:00
|
|
|
rootnoverify (hd0,0)
|
2005-01-30 12:51:22 +00:00
|
|
|
chainloader +1</literal>
|
2004-06-19 18:46:53 +01:00
|
|
|
EOF</userinput></screen>
|
2003-09-12 01:47:51 +01:00
|
|
|
|
2004-09-28 16:43:56 +01:00
|
|
|
<para>The FHS stipulates that Grub's menu.lst file should be symlinked to
|
|
|
|
/etc/grub/menu.lst. To satisfy this requirement, issue the following
|
|
|
|
command:</para>
|
|
|
|
|
|
|
|
<screen><userinput>mkdir /etc/grub &&
|
|
|
|
ln -s /boot/grub/menu.lst /etc/grub</userinput></screen>
|
|
|
|
|
2003-09-11 22:35:35 +01:00
|
|
|
</sect1>
|