mirror of
https://git.linuxfromscratch.org/lfs.git
synced 2025-01-31 11:21:59 +00:00
Update to GRUB-1.97
git-svn-id: http://svn.linuxfromscratch.org/LFS/trunk/BOOK@9088 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689
This commit is contained in:
parent
258deb14d5
commit
f9bcaecdd3
@ -37,6 +37,22 @@
|
||||
|
||||
-->
|
||||
|
||||
<listitem>
|
||||
<para>2009-10-29</para>
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
<para>[bdubbs] Upgraded to GRUB-1.97. Split the
|
||||
build/install portion from the configuration of /boot and
|
||||
the mbr and placed the build portion in Chapter 6.
|
||||
Expanded the discussion about the /boot mbr portion in Chapter 8.
|
||||
Fixes <ulink url="&lfs-ticket-root;2093">#2093</ulink>.
|
||||
This also eliminates the need for an initramfs as
|
||||
specified in
|
||||
<ulink url="&lfs-ticket-root;2033">#2033</ulink>.</para>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para>2009-10-20</para>
|
||||
<itemizedlist>
|
||||
|
@ -91,9 +91,9 @@
|
||||
<!--<listitem>
|
||||
<para>Groff &groff-version;</para>
|
||||
</listitem>-->
|
||||
<!--<listitem>
|
||||
<listitem>
|
||||
<para>GRUB &grub-version;</para>
|
||||
</listitem>-->
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>Gzip &gzip-version;</para>
|
||||
</listitem>
|
||||
|
@ -53,6 +53,7 @@
|
||||
<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="flex.xml"/>
|
||||
<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="gettext.xml"/>
|
||||
<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="groff.xml"/>
|
||||
<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="grub.xml"/>
|
||||
<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="gzip.xml"/>
|
||||
<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="iproute2.xml"/>
|
||||
<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="kbd.xml"/>
|
||||
|
@ -40,52 +40,35 @@
|
||||
<sect2 role="installation">
|
||||
<title>Installation of GRUB</title>
|
||||
|
||||
<para>This package is known to have issues when its default
|
||||
optimization flags (including the <parameter>-march</parameter> and
|
||||
<parameter>-mcpu</parameter> options) are changed. If any environment
|
||||
variables that override default optimizations have been defined, such
|
||||
as <envar>CFLAGS</envar> and <envar>CXXFLAGS</envar>,
|
||||
unset them when building GRUB.</para>
|
||||
|
||||
<para>Start by applying the following patch to allow for better drive
|
||||
detection, fix some GCC 4.x issues, and provide better SATA support
|
||||
for some disk controllers:</para>
|
||||
|
||||
<screen><userinput remap="pre">patch -Np1 -i ../&grub-geometry-patch;</userinput></screen>
|
||||
|
||||
<para>By default, GRUB doesn't support ext2 filesystems with 256-byte inodes.
|
||||
Fix this by applying the following patch:</para>
|
||||
|
||||
<screen><userinput remap="pre">patch -Np1 -i ../&grub-inode-patch;</userinput></screen>
|
||||
|
||||
<para>Prepare GRUB for compilation:</para>
|
||||
|
||||
<screen><userinput remap="configure">./configure --prefix=/usr</userinput></screen>
|
||||
<screen><userinput remap="configure">mkdir build
|
||||
cd build
|
||||
../configure --prefix=/usr \
|
||||
--sysconfdir=/etc \
|
||||
--disable-largefile \
|
||||
--disable-grub-emu \
|
||||
--disable-grub-emu-usb \
|
||||
--disable-grub-fstest \
|
||||
--disable-efiemu</userinput></screen>
|
||||
|
||||
<para>Using a separate build directory keeps the 2400 generated
|
||||
files out of the main directory and is recommeded by the developers.
|
||||
The --disable switches just minimze what is built by disabling
|
||||
features and testing programs not really needed for LFS.</para>
|
||||
|
||||
<para>Compile the package:</para>
|
||||
|
||||
<screen><userinput remap="make">make</userinput></screen>
|
||||
|
||||
<para>To test the results, issue:</para>
|
||||
|
||||
<screen><userinput remap="test">make check</userinput></screen>
|
||||
<para>This package does not come with a test suite.</para>
|
||||
|
||||
<para>Install the package:</para>
|
||||
|
||||
<screen><userinput remap="install">make install
|
||||
mkdir -v /boot/grub
|
||||
cp -v /usr/lib/grub/i386-pc/stage{1,2} /boot/grub</userinput></screen>
|
||||
<screen><userinput remap="install">make install</userinput></screen>
|
||||
|
||||
<para>Replace <filename class="directory">i386-pc</filename> with whatever
|
||||
directory is appropriate for the hardware in use.</para>
|
||||
|
||||
<para>The <filename class="directory">i386-pc</filename> directory
|
||||
contains a number of <filename>*stage1_5</filename> files, different
|
||||
ones for different file systems. Review the files available and copy
|
||||
the appropriate ones to the <filename
|
||||
class="directory">/boot/grub</filename> directory. Most users will
|
||||
copy the <filename>e2fs_stage1_5</filename> and/or
|
||||
<filename>reiserfs_stage1_5</filename> files.</para>
|
||||
<para>Using GRUB to make you LFS system bootable will be discussed in
|
||||
<xref linkend="ch-bootable-grub"/>.</para>
|
||||
|
||||
</sect2>
|
||||
|
||||
@ -94,10 +77,14 @@ cp -v /usr/lib/grub/i386-pc/stage{1,2} /boot/grub</userinput></screen>
|
||||
|
||||
<segmentedlist>
|
||||
<segtitle>Installed programs</segtitle>
|
||||
<segtitle>Installed directories</segtitle>
|
||||
|
||||
<seglistitem>
|
||||
<seg>grub, grub-install, grub-md5-crypt, grub-set-default,
|
||||
grub-terminfo, and mbchk</seg>
|
||||
<seg>grub-editenv, grub-mkelfimage, grub-mkfont, grub-mkimage,
|
||||
grub-mkrescue, grub-dumpbios, grub-install, grub-mkconfig,
|
||||
grub-mkdevicemap, grub-probe, grub-setup</seg>
|
||||
|
||||
<seg>/usr/lib/grub, /etc/grub.d, /usr/share/grub, /usr/inclue/grub</seg>
|
||||
</seglistitem>
|
||||
</segmentedlist>
|
||||
|
||||
@ -106,12 +93,62 @@ cp -v /usr/lib/grub/i386-pc/stage{1,2} /boot/grub</userinput></screen>
|
||||
<?dbfo list-presentation="list"?>
|
||||
<?dbhtml list-presentation="table"?>
|
||||
|
||||
<varlistentry id="grub">
|
||||
<term><command>grub</command></term>
|
||||
<varlistentry id="grub-editenv">
|
||||
<term><command>grub-editenv</command></term>
|
||||
<listitem>
|
||||
<para>The Grand Unified Bootloader's command shell</para>
|
||||
<indexterm zone="ch-system-grub grub">
|
||||
<primary sortas="b-grub">grub</primary>
|
||||
<para>A tool to edit the environment block</para>
|
||||
<indexterm zone="ch-system-grub grub-editenv">
|
||||
<primary sortas="b-grub-editenv">grub-editenv</primary>
|
||||
</indexterm>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry id="grub-mkelfimage">
|
||||
<term><command>grub-mkelfimage</command></term>
|
||||
<listitem>
|
||||
<para>Make a bootable image of GRUB</para>
|
||||
<indexterm zone="ch-system-grub grub-mkelfimage">
|
||||
<primary sortas="b-grub-mkelfimage">grub-mkelfimage</primary>
|
||||
</indexterm>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry id="grub-mkfont">
|
||||
<term><command>grub-mkfont</command></term>
|
||||
<listitem>
|
||||
<para>Update fonts for GRUB use</para>
|
||||
<indexterm zone="ch-system-grub grub-mkfont">
|
||||
<primary sortas="b-grub-mkfont">grub-mkfont</primary>
|
||||
</indexterm>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry id="grub-mkimage">
|
||||
<term><command>grub-mkimage</command></term>
|
||||
<listitem>
|
||||
<para>Make a bootable image of GRUB</para>
|
||||
<indexterm zone="ch-system-grub grub-mkimage">
|
||||
<primary sortas="b-grub-mkimage">grub-mkimage</primary>
|
||||
</indexterm>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry id="grub-mkrescue">
|
||||
<term><command>grub-mkrescue</command></term>
|
||||
<listitem>
|
||||
<para>Make a bootable image of GRUB suitable for a floppy disk</para>
|
||||
<indexterm zone="ch-system-grub grub-mkrescue">
|
||||
<primary sortas="b-grub-mkrescue">grub-mkrescue</primary>
|
||||
</indexterm>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry id="grub-dumpbios">
|
||||
<term><command>grub-dumpbios</command></term>
|
||||
<listitem>
|
||||
<para>Create vbios and int10 dump</para>
|
||||
<indexterm zone="ch-system-grub grub-dumpbios">
|
||||
<primary sortas="b-grub-dumpbios">grub-dumpbios</primary>
|
||||
</indexterm>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
@ -119,50 +156,49 @@ cp -v /usr/lib/grub/i386-pc/stage{1,2} /boot/grub</userinput></screen>
|
||||
<varlistentry id="grub-install">
|
||||
<term><command>grub-install</command></term>
|
||||
<listitem>
|
||||
<para>Installs GRUB on the given device</para>
|
||||
<para>Install GRUB on your drive</para>
|
||||
<indexterm zone="ch-system-grub grub-install">
|
||||
<primary sortas="b-grub-install">grub-install</primary>
|
||||
</indexterm>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry id="grub-md5-crypt">
|
||||
<term><command>grub-md5-crypt</command></term>
|
||||
<varlistentry id="grub-mkconfig">
|
||||
<term><command>grub-mkconfig</command></term>
|
||||
<listitem>
|
||||
<para>Encrypts a password in MD5 format</para>
|
||||
<indexterm zone="ch-system-grub grub-md5-crypt">
|
||||
<primary sortas="b-grub-md5-crypt">grub-md5-crypt</primary>
|
||||
<para>Generate a grub config file</para>
|
||||
<indexterm zone="ch-system-grub grub-mkconfig">
|
||||
<primary sortas="b-grub-mkconfig">grub-mkconfig</primary>
|
||||
</indexterm>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry id="grub-set-default">
|
||||
<term><command>grub-set-default</command></term>
|
||||
<varlistentry id="grub-mkdevicemap">
|
||||
<term><command>grub-mkdevicemap</command></term>
|
||||
<listitem>
|
||||
<para>Sets the default boot entry for GRUB</para>
|
||||
<indexterm zone="ch-system-grub grub-set-default">
|
||||
<primary sortas="b-grub-set-default">grub-set-default</primary>
|
||||
<para>Generate a device map file automatically</para>
|
||||
<indexterm zone="ch-system-grub grub-mkdevicemap">
|
||||
<primary sortas="b-grub-mkdevicemap">grub-mkdevicemap</primary>
|
||||
</indexterm>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry id="grub-terminfo">
|
||||
<term><command>grub-terminfo</command></term>
|
||||
<varlistentry id="grub-probe">
|
||||
<term><command>grub-probe</command></term>
|
||||
<listitem>
|
||||
<para>Generates a terminfo command from a terminfo name; it can be
|
||||
employed if an unknown terminal is being used</para>
|
||||
<indexterm zone="ch-system-grub grub-terminfo">
|
||||
<primary sortas="b-grub-terminfo">grub-terminfo</primary>
|
||||
<para>Probe device information for a given path or device</para>
|
||||
<indexterm zone="ch-system-grub grub-probe">
|
||||
<primary sortas="b-grub-probe">grub-probe</primary>
|
||||
</indexterm>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry id="mbchk">
|
||||
<term><command>mbchk</command></term>
|
||||
<varlistentry id="grub-setup">
|
||||
<term><command>grub-setup</command></term>
|
||||
<listitem>
|
||||
<para>Checks the format of a multi-boot kernel</para>
|
||||
<indexterm zone="ch-system-grub mbchk">
|
||||
<primary sortas="b-mbchk">mbchk</primary>
|
||||
<para>Set up images to boot from a device</para>
|
||||
<indexterm zone="ch-system-grub grub-setup">
|
||||
<primary sortas="b-grub-setup">grub-setup</primary>
|
||||
</indexterm>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
@ -14,96 +14,10 @@
|
||||
<address>&grub-url;</address>
|
||||
</sect1info>
|
||||
|
||||
<title>GRUB-&grub-version;</title>
|
||||
|
||||
<indexterm zone="ch-bootable-grub">
|
||||
<primary sortas="a-Grub">GRUB</primary>
|
||||
</indexterm>
|
||||
|
||||
<sect2 role="package">
|
||||
<title/>
|
||||
|
||||
<para>The GRUB package contains the GRand Unified Bootloader.</para>
|
||||
|
||||
<segmentedlist>
|
||||
<segtitle>&buildtime;</segtitle>
|
||||
<segtitle>&diskspace;</segtitle>
|
||||
|
||||
<seglistitem>
|
||||
<seg>&grub-ch6-sbu;</seg>
|
||||
<seg>&grub-ch6-du;</seg>
|
||||
</seglistitem>
|
||||
</segmentedlist>
|
||||
|
||||
</sect2>
|
||||
|
||||
<sect2 role="installation">
|
||||
<title>Installation of GRUB</title>
|
||||
|
||||
<para>Your shiny new LFS system is almost complete. One of the last
|
||||
things to do is to ensure that the system can be properly booted.</para>
|
||||
|
||||
<caution>
|
||||
<para>This package will only build for x86 and x86_64 architectures
|
||||
containing 32-bit libs. If you chose to build on x86_64 without 32-bit
|
||||
libraries (no multilib), then you must use LILO instead. Information on
|
||||
<quote>boot loading</quote> for other architectures should be available in
|
||||
the usual resource-specific locations for those architectures.</para>
|
||||
</caution>
|
||||
|
||||
<para>This package is known to have issues when its default
|
||||
optimization flags (including the <parameter>-march</parameter> and
|
||||
<parameter>-mcpu</parameter> options) are changed. If any environment
|
||||
variables that override default optimizations have been defined, such
|
||||
as <envar>CFLAGS</envar> and <envar>CXXFLAGS</envar>,
|
||||
unset them when building GRUB.</para>
|
||||
|
||||
<para>Start by applying the following patch to allow for better drive
|
||||
detection, fix some GCC 4.x issues, and provide better SATA support
|
||||
for some disk controllers:</para>
|
||||
|
||||
<screen><userinput remap="pre">patch -Np1 -i ../&grub-geometry-patch;</userinput></screen>
|
||||
|
||||
<para>By default, GRUB doesn't support ext2 filesystems with 256-byte inodes.
|
||||
Fix this by applying the following patch:</para>
|
||||
|
||||
<screen><userinput remap="pre">patch -Np1 -i ../&grub-inode-patch;</userinput></screen>
|
||||
|
||||
<para>Prepare GRUB for compilation:</para>
|
||||
|
||||
<screen><userinput remap="configure">./configure --prefix=/usr</userinput></screen>
|
||||
|
||||
<para>Compile the package, but use custom optimization flags to
|
||||
prevent an error flagged in the test routines:</para>
|
||||
|
||||
<screen><userinput remap="make">make CFLAGS="-march=i486 -mtune=native -Os"</userinput></screen>
|
||||
|
||||
<para>To test the results, issue:</para>
|
||||
|
||||
<screen><userinput remap="test">make check</userinput></screen>
|
||||
|
||||
<para>Install the package:</para>
|
||||
|
||||
<screen><userinput remap="install">make install
|
||||
mkdir -v /boot/grub
|
||||
cp -v /usr/lib/grub/i386-pc/stage{1,2} /boot/grub</userinput></screen>
|
||||
|
||||
<para>Replace <filename class="directory">i386-pc</filename> with whatever
|
||||
directory is appropriate for the hardware in use.</para>
|
||||
|
||||
<para>The <filename class="directory">i386-pc</filename> directory
|
||||
contains a number of <filename>*stage1_5</filename> files, different
|
||||
ones for different file systems. Review the files available and copy
|
||||
the appropriate ones to the <filename
|
||||
class="directory">/boot/grub</filename> directory. Most users will
|
||||
copy the <filename>e2fs_stage1_5</filename> and/or
|
||||
<filename>reiserfs_stage1_5</filename> files.</para>
|
||||
|
||||
</sect2>
|
||||
|
||||
<sect2 role="configuration">
|
||||
<title>Configuring GRUB</title>
|
||||
<title>Using GRUB to Set Up the Boot Process</title>
|
||||
|
||||
<sect2>
|
||||
<title>Introduction</title>
|
||||
|
||||
<para>Boot loading can be a complex area, so a few cautionary
|
||||
words are in order. Be familiar with the current boot loader and any other
|
||||
@ -113,194 +27,185 @@ cp -v /usr/lib/grub/i386-pc/stage{1,2} /boot/grub</userinput></screen>
|
||||
unusable (un-bootable).</para>
|
||||
|
||||
<para>The procedure involves writing some special GRUB files to specific
|
||||
locations on the hard drive. We highly recommend creating a GRUB boot floppy
|
||||
diskette as a backup. Insert a blank floppy diskette and run the following
|
||||
commands:</para>
|
||||
locations on the hard drive. We highly recommend creating a GRUB boot
|
||||
floppy diskette as a backup. 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, run the
|
||||
<command>grub</command> shell:</para>
|
||||
|
||||
<screen><userinput>grub</userinput></screen>
|
||||
<screen role="nodump"><userinput>cd /tmp
|
||||
grub-mkrescue --image-type=floppy floppy.img
|
||||
dd if=floppy.img of =/def/fd0 bs=1440 count=1</userinput></screen>
|
||||
|
||||
<para>GRUB uses its own naming structure for drives and partitions in
|
||||
the form of <emphasis>(hdn,m)</emphasis>, where <emphasis>n</emphasis>
|
||||
is the hard drive number and <emphasis>m</emphasis> is the partition
|
||||
number, both starting from zero. For example, partition <filename
|
||||
class="partition">hda1</filename> is <emphasis>(hd0,0)</emphasis> to
|
||||
GRUB and <filename class="partition">hdb3</filename> is
|
||||
<emphasis>(hd1,2)</emphasis>. In contrast to Linux, GRUB does not
|
||||
number. The hard drive number starts from zero, but he partition number
|
||||
starts from one for normal partitions and five for extended partitions.
|
||||
Note that this is different form earlier versions where
|
||||
both numbers started from zero. For example, partition <filename
|
||||
class="partition">sda1</filename> is <emphasis>(hd0,1)</emphasis> to
|
||||
GRUB and <filename class="partition">sdb3</filename> is
|
||||
<emphasis>(hd1,3)</emphasis>. In contrast to Linux, GRUB does not
|
||||
consider CD-ROM drives to be hard drives. For example, if using a CD
|
||||
on <filename class="partition">hdb</filename> and a second hard drive
|
||||
on <filename class="partition">hdc</filename>, that second hard drive
|
||||
would still be <emphasis>(hd1)</emphasis>.</para>
|
||||
|
||||
<para>You can determine what GRUB thinks your disk devices are by running:</para>
|
||||
|
||||
<screen role="nodump"><userinput>grub-mkdevicemap --verbose --device-map=device.map
|
||||
cat device.map</userinput></screen>
|
||||
|
||||
<para>The location of the boot partition is a choice of the user that
|
||||
affects the configuration. One recommendation is to have a separate small
|
||||
(suggested size is 100 MB) partition just for boot information. That way
|
||||
each build, whether LFS or some commercial distro, can access the same boot
|
||||
files and access can be made from any booted system. If you choose to do
|
||||
this, you will need to mount the separate partition, move all files in the
|
||||
current <filename class="directory">/boot</filename> directory (e.g. the
|
||||
linux kernel you just built in the previous section) to the new partition.
|
||||
You will then need to unmount the partition and remount it as <filename
|
||||
class="directory">/boot</filename>. If you do this, be sure to update
|
||||
<filename>/etc/fstab</filename>.</para>
|
||||
|
||||
<para>Using the current lfs partition will also work, but configuration
|
||||
for multiple systems is more difficult.</para>
|
||||
</sect2>
|
||||
|
||||
<sect2>
|
||||
<title>Setting Up the Configuration</title>
|
||||
|
||||
<para>Using the above information, determine the appropriate
|
||||
designator for the root partition (or boot partition, if a separate
|
||||
one is used). For the following example, it is assumed that the root
|
||||
(or separate boot) partition is <filename
|
||||
class="partition">hda4</filename>.</para>
|
||||
class="partition">sda2</filename>.</para>
|
||||
|
||||
<para>Tell GRUB where to search for its
|
||||
<filename>stage{1,2}</filename> files. The Tab key can be used
|
||||
everywhere to make GRUB show the alternatives:</para>
|
||||
<para>Install the GRUB files into <filename
|
||||
class="directory">/boot/grub</filename>:</para>
|
||||
|
||||
<screen><userinput>root (hd0,3)</userinput></screen>
|
||||
<screen role="nodump"><userinput>grub-install --grub-setup=/bin/true /dev/sda</userinput></screen>
|
||||
|
||||
<para>We use --grub-setup=/bin/true for now to prevent update the
|
||||
Master Boot Record (MBR). In this way, we can test our installation
|
||||
before committing to a change that is hard to revert.</para>
|
||||
|
||||
<para>Generate <filename>/boot/grub/grub.cfg</filename>:</para>
|
||||
|
||||
<screen role="nodump"><userinput>grub-mkconfig -o /boot/grub/grub.cfg</userinput></screen>
|
||||
|
||||
<para>Here <command>grub-mkconfig</command> uses the files in <filename
|
||||
class="directory">/etc/grub.d/</filename> to determine the contents
|
||||
of this file. The configuration file will look something like:</para>
|
||||
<screen><computeroutput>#
|
||||
# DO NOT EDIT THIS FILE
|
||||
#
|
||||
# It is automatically generated by /usr/sbin/grub-mkconfig using templates
|
||||
# from /etc/grub.d and settings from /etc/default/grub
|
||||
#
|
||||
|
||||
### BEGIN /etc/grub.d/00_header ###
|
||||
set default=0
|
||||
set timeout=5
|
||||
### END /etc/grub.d/00_header ###
|
||||
|
||||
### BEGIN /etc/grub.d/10_linux ###
|
||||
menuentry "GNU/Linux, Linux 2.6.30.2-lfs65" {
|
||||
insmod ext2
|
||||
set root=(hd0,2)
|
||||
search --no-floppy --fs-uuid --set 915852a7-859e-45a6-9ff0-d3ebfdb5cea2
|
||||
linux /boot/vmlinux-&linux-version;-lfs-&version; root=/dev/sda2 ro
|
||||
}
|
||||
menuentry "GNU/Linux, Linux 2.6.30.2-lfs65 (recovery mode)" {
|
||||
insmod ext2
|
||||
set root=(hd0,2)
|
||||
search --no-floppy --fs-uuid --set 915852a7-859e-45a6-9ff0-d3ebfdb5cea2
|
||||
linux /boot/vmlinux-&linux-version;-lfs-&version; root=/dev/sda2 ro single
|
||||
}
|
||||
menuentry "GNU/Linux, Linux 2.6.28-11-server" {
|
||||
insmod ext2
|
||||
set root=(hd0,2)
|
||||
search --no-floppy --fs-uuid --set 6b4c0339-5501-4a85-8351-e398e5252be8
|
||||
linux /boot/vmlinuz-2.6.28-11-server root=UUID=6b4c0339-5501-4a85-8351-e398e5252be8 ro
|
||||
initrd /boot/initrd.img-2.6.28-11-server
|
||||
}
|
||||
menuentry "GNU/Linux, Linux 2.6.28-11-server (recovery mode)" {
|
||||
insmod ext2
|
||||
set root=(hd0,2)
|
||||
search --no-floppy --fs-uuid --set 6b4c0339-5501-4a85-8351-e398e5252be8
|
||||
linux /boot/vmlinuz-2.6.28-11-server root=UUID=6b4c0339-5501-4a85-8351-e398e5252be8 ro single
|
||||
initrd /boot/initrd.img-2.6.28-11-server
|
||||
}
|
||||
### END /etc/grub.d/10_linux ###
|
||||
|
||||
### BEGIN /etc/grub.d/30_os-prober ###
|
||||
### END /etc/grub.d/30_os-prober ###
|
||||
|
||||
### BEGIN /etc/grub.d/40_custom ###
|
||||
# This file provides an easy way to add custom menu entries. Simply type the
|
||||
# menu entries you want to add after this comment. Be careful not to change
|
||||
# the 'exec tail' line above.
|
||||
### END /etc/grub.d/40_custom ###
|
||||
</computeroutput></screen>
|
||||
|
||||
<para>Note that even though there is a warning not to edit the file, you can
|
||||
do so as long as you do not re-reun <command>grub-mkconfig</command>. The
|
||||
<emphasis>search</emphasis> lines are not meaningful for LFS systems as that
|
||||
command needs an initrd image for processing. If installing on a separate
|
||||
partition the linux and initrd lines will not have the /boot on the file
|
||||
names. In this example the kernel files for a Ubuntu installation are
|
||||
also found in <filename class="directory">/boot</filename>.</para>
|
||||
|
||||
</sect2>
|
||||
|
||||
<sect2>
|
||||
<title>Testing the Configuration</title>
|
||||
|
||||
<para>The core image of GRUB is also a Multiboot kernel, so if you already
|
||||
have GRUB Legacy loaded you can load GRUB-&grub-version; through your old
|
||||
boot loader. To accomplish this, you will need to exit the
|
||||
<command>chroot</command> environment and re-enter it to finish the
|
||||
few remaining portions of the book.</para>
|
||||
|
||||
<screen role="nodump"><userinput>/sbin/reboot
|
||||
...
|
||||
grub> root (hd0,1)
|
||||
grub> kernel /boot/grub/core.img
|
||||
grub> boot</userinput></screen>
|
||||
|
||||
<para>Note that the GRUB commands above are assumed to be GRUB Legacy.
|
||||
At this point the GRUB prompt will appear (very similar to GRUB Legacy) and
|
||||
you can explore the interface or boot to one of the systems in the grub.cfg
|
||||
file.</para>
|
||||
|
||||
</sect2>
|
||||
|
||||
<sect2>
|
||||
<title>Updating the Master Boot Record</title>
|
||||
|
||||
<para>If you tested the GRUB configuration as specified above, re-enter
|
||||
the <command>chroot</command> envronment.</para>
|
||||
|
||||
<warning>
|
||||
<para>The following command will overwrite the current boot loader. Do not
|
||||
run the command if this is not desired, for example, if using a third party
|
||||
boot manager to manage the Master Boot Record (MBR). In this scenario, it
|
||||
would make more sense to install GRUB into the <quote>boot sector</quote>
|
||||
of the LFS partition. In this case, this next command would become
|
||||
<userinput>setup (hd0,3)</userinput>.</para>
|
||||
boot manager to manage the Master Boot Record (MBR).</para>
|
||||
</warning>
|
||||
|
||||
<para>Tell GRUB to install itself into the MBR of
|
||||
<filename class="partition">hda</filename>:</para>
|
||||
<para>Update the MBR with:</para>
|
||||
|
||||
<screen><userinput>setup (hd0)</userinput></screen>
|
||||
<screen role="nodump"><userinput>grub-setup</userinput></screen>
|
||||
|
||||
<para>If all went well, GRUB will have reported finding its files in
|
||||
<filename class="directory">/boot/grub</filename>. That's all there is
|
||||
to it. Quit the <command>grub</command> shell:</para>
|
||||
<para>This program uses the following defaults and are correct if you did not
|
||||
deviate from the instructions above:</para>
|
||||
|
||||
<screen><userinput>quit</userinput></screen>
|
||||
<itemizedlist>
|
||||
<listitem><para>boot image - boot.img </para></listitem>
|
||||
<listitem><para>core image - core.img </para></listitem>
|
||||
<listitem><para>directory - /boot/grub</para></listitem>
|
||||
<listitem><para>device map - device.map</para></listitem>
|
||||
<listitem><para>root device - guessed </para></listitem>
|
||||
</itemizedlist>
|
||||
|
||||
<para>Create a <quote>menu list</quote> file defining GRUB's boot menu:</para>
|
||||
|
||||
<screen><userinput>cat > /boot/grub/menu.lst << "EOF"
|
||||
<literal># Begin /boot/grub/menu.lst
|
||||
|
||||
# By default boot the first menu entry.
|
||||
default 0
|
||||
|
||||
# Allow 30 seconds before booting the default.
|
||||
timeout 30
|
||||
|
||||
# Use prettier colors.
|
||||
color green/black light-green/black
|
||||
|
||||
# The first entry is for LFS.
|
||||
title LFS &version;
|
||||
root (hd0,3)
|
||||
kernel /boot/lfskernel-&linux-version; root=/dev/hda4</literal>
|
||||
EOF</userinput></screen>
|
||||
|
||||
<para>Add an entry for the host distribution if desired. It might look
|
||||
like this:</para>
|
||||
|
||||
<screen><userinput>cat >> /boot/grub/menu.lst << "EOF"
|
||||
<literal>title Red Hat
|
||||
root (hd0,2)
|
||||
kernel /boot/kernel-2.6.5 root=/dev/hda3
|
||||
initrd /boot/initrd-2.6.5</literal>
|
||||
EOF</userinput></screen>
|
||||
|
||||
<para>If dual-booting Windows, the following entry will allow
|
||||
booting it:</para>
|
||||
|
||||
<screen><userinput>cat >> /boot/grub/menu.lst << "EOF"
|
||||
<literal>title Windows
|
||||
rootnoverify (hd0,0)
|
||||
chainloader +1</literal>
|
||||
EOF</userinput></screen>
|
||||
|
||||
<para>If <command>info grub</command> does not provide all necessary material,
|
||||
additional information regarding GRUB is located on its website at:
|
||||
<ulink url="http://www.gnu.org/software/grub/"/>.</para>
|
||||
|
||||
<para>The FHS stipulates that GRUB's <filename>menu.lst</filename> file should
|
||||
be symlinked to <filename class="symlink">/etc/grub/menu.lst</filename>. To
|
||||
satisfy this requirement, issue the following command:</para>
|
||||
|
||||
<screen><userinput>mkdir -v /etc/grub
|
||||
ln -sv /boot/grub/menu.lst /etc/grub</userinput></screen>
|
||||
|
||||
</sect2>
|
||||
|
||||
<sect2 id="contents-gRUB" role="content">
|
||||
<title>Contents of GRUB</title>
|
||||
|
||||
<segmentedlist>
|
||||
<segtitle>Installed programs</segtitle>
|
||||
|
||||
<seglistitem>
|
||||
<seg>grub, grub-install, grub-md5-crypt, grub-set-default,
|
||||
grub-terminfo, and mbchk</seg>
|
||||
</seglistitem>
|
||||
</segmentedlist>
|
||||
|
||||
<variablelist>
|
||||
<bridgehead renderas="sect3">Short Descriptions</bridgehead>
|
||||
<?dbfo list-presentation="list"?>
|
||||
<?dbhtml list-presentation="table"?>
|
||||
|
||||
<varlistentry id="grub">
|
||||
<term><command>grub</command></term>
|
||||
<listitem>
|
||||
<para>The Grand Unified Bootloader's command shell</para>
|
||||
<indexterm zone="ch-bootable-grub grub">
|
||||
<primary sortas="b-grub">grub</primary>
|
||||
</indexterm>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry id="grub-install">
|
||||
<term><command>grub-install</command></term>
|
||||
<listitem>
|
||||
<para>Installs GRUB on the given device</para>
|
||||
<indexterm zone="ch-bootable-grub grub-install">
|
||||
<primary sortas="b-grub-install">grub-install</primary>
|
||||
</indexterm>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry id="grub-md5-crypt">
|
||||
<term><command>grub-md5-crypt</command></term>
|
||||
<listitem>
|
||||
<para>Encrypts a password in MD5 format</para>
|
||||
<indexterm zone="ch-bootable-grub grub-md5-crypt">
|
||||
<primary sortas="b-grub-md5-crypt">grub-md5-crypt</primary>
|
||||
</indexterm>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry id="grub-set-default">
|
||||
<term><command>grub-set-default</command></term>
|
||||
<listitem>
|
||||
<para>Sets the default boot entry for GRUB</para>
|
||||
<indexterm zone="ch-bootable-grub grub-set-default">
|
||||
<primary sortas="b-grub-set-default">grub-set-default</primary>
|
||||
</indexterm>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry id="grub-terminfo">
|
||||
<term><command>grub-terminfo</command></term>
|
||||
<listitem>
|
||||
<para>Generates a terminfo command from a terminfo name; it can be
|
||||
employed if an unknown terminal is being used</para>
|
||||
<indexterm zone="ch-bootable-grub grub-terminfo">
|
||||
<primary sortas="b-grub-terminfo">grub-terminfo</primary>
|
||||
</indexterm>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry id="mbchk">
|
||||
<term><command>mbchk</command></term>
|
||||
<listitem>
|
||||
<para>Checks the format of a multi-boot kernel</para>
|
||||
<indexterm zone="ch-bootable-grub mbchk">
|
||||
<primary sortas="b-mbchk">mbchk</primary>
|
||||
</indexterm>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
</variablelist>
|
||||
|
||||
</sect2>
|
||||
</sect2>
|
||||
|
||||
</sect1>
|
||||
|
@ -115,10 +115,13 @@
|
||||
required to complete the installation. Some files need to be copied to
|
||||
the <filename class="directory">/boot</filename> directory.</para>
|
||||
|
||||
<para>The path to the kernel image may vary depending on the platform
|
||||
being used. The following command assumes an x86 architecture:</para>
|
||||
<para>The path to the kernel image may vary depending on the platform being
|
||||
used. The filename below can be changed to suit your taste, but the stem of
|
||||
the filename should be <emphasis>vmlinux</emphasis> to be compatible with
|
||||
the automatic setup of the boot process described in the next section. The
|
||||
following command assumes an x86 architecture:</para>
|
||||
|
||||
<screen><userinput remap="install">cp -v arch/x86/boot/bzImage /boot/lfskernel-&linux-version;</userinput></screen>
|
||||
<screen><userinput remap="install">cp -v arch/x86/boot/bzImage /boot/vmlinux-&linux-version;-lfs-&version;</userinput></screen>
|
||||
|
||||
<para><filename>System.map</filename> is a symbol file for the kernel.
|
||||
It maps the function entry points of every function in the kernel API,
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
<!ENTITY version "SVN-20091020">
|
||||
<!ENTITY releasedate "October 20, 2009">
|
||||
<!ENTITY version "SVN-20091029">
|
||||
<!ENTITY releasedate "October 29, 2009">
|
||||
<!ENTITY copyrightdate "1999-2009"><!-- jhalfs needs a literal dash, not – -->
|
||||
<!ENTITY milestone "7.0">
|
||||
<!ENTITY generic-version "development"> <!-- Use "development", "testing", or "x.y[-pre{x}]" -->
|
||||
|
10
packages.ent
10
packages.ent
@ -232,13 +232,13 @@
|
||||
<!ENTITY groff-ch6-du "66 MB">
|
||||
<!ENTITY groff-ch6-sbu "0.7 SBU">
|
||||
|
||||
<!ENTITY grub-version "0.97">
|
||||
<!ENTITY grub-size "949 KB">
|
||||
<!ENTITY grub-version "1.97">
|
||||
<!ENTITY grub-size "1.2 MB">
|
||||
<!ENTITY grub-url "&alpha-gnu;grub/grub-&grub-version;.tar.gz">
|
||||
<!ENTITY grub-md5 "cd3f3eb54446be6003156158d51f4884">
|
||||
<!ENTITY grub-md5 "3700068f871b4f394315ebb8ba324df4">
|
||||
<!ENTITY grub-home "&gnu-software;grub/">
|
||||
<!ENTITY grub-ch6-du "10.2 MB">
|
||||
<!ENTITY grub-ch6-sbu "0.2 SBU">
|
||||
<!ENTITY grub-ch6-du "27.7 MB">
|
||||
<!ENTITY grub-ch6-sbu "0.4 SBU">
|
||||
|
||||
<!ENTITY gzip-version "1.3.13">
|
||||
<!ENTITY gzip-size "795 KB">
|
||||
|
Loading…
Reference in New Issue
Block a user