diff --git a/chapter01/changelog.xml b/chapter01/changelog.xml
index 8f7ff2071..231fe4169 100644
--- a/chapter01/changelog.xml
+++ b/chapter01/changelog.xml
@@ -37,6 +37,22 @@
-->
+
+ 2009-10-29
+
+
+ [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 #2093.
+ This also eliminates the need for an initramfs as
+ specified in
+ #2033.
+
+
+
+
2009-10-20
diff --git a/chapter01/whatsnew.xml b/chapter01/whatsnew.xml
index b0d55ea49..cb3c0b2be 100644
--- a/chapter01/whatsnew.xml
+++ b/chapter01/whatsnew.xml
@@ -91,9 +91,9 @@
-
+
Gzip &gzip-version;
diff --git a/chapter06/chapter06.xml b/chapter06/chapter06.xml
index b98877f56..4529b2728 100644
--- a/chapter06/chapter06.xml
+++ b/chapter06/chapter06.xml
@@ -53,6 +53,7 @@
+
diff --git a/chapter06/grub.xml b/chapter06/grub.xml
index 77795c2f3..a442e8d63 100644
--- a/chapter06/grub.xml
+++ b/chapter06/grub.xml
@@ -40,52 +40,35 @@
Installation of GRUB
- This package is known to have issues when its default
- optimization flags (including the -march and
- -mcpu options) are changed. If any environment
- variables that override default optimizations have been defined, such
- as CFLAGS and CXXFLAGS,
- unset them when building GRUB.
-
- 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:
-
-patch -Np1 -i ../&grub-geometry-patch;
-
- By default, GRUB doesn't support ext2 filesystems with 256-byte inodes.
- Fix this by applying the following patch:
-
-patch -Np1 -i ../&grub-inode-patch;
-
Prepare GRUB for compilation:
-./configure --prefix=/usr
+mkdir build
+cd build
+../configure --prefix=/usr \
+ --sysconfdir=/etc \
+ --disable-largefile \
+ --disable-grub-emu \
+ --disable-grub-emu-usb \
+ --disable-grub-fstest \
+ --disable-efiemu
+
+ 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.
Compile the package:
make
- To test the results, issue:
-
-make check
+ This package does not come with a test suite.
Install the package:
-make install
-mkdir -v /boot/grub
-cp -v /usr/lib/grub/i386-pc/stage{1,2} /boot/grub
+make install
- Replace i386-pc with whatever
- directory is appropriate for the hardware in use.
-
- The i386-pc directory
- contains a number of *stage1_5 files, different
- ones for different file systems. Review the files available and copy
- the appropriate ones to the /boot/grub directory. Most users will
- copy the e2fs_stage1_5 and/or
- reiserfs_stage1_5 files.
+ Using GRUB to make you LFS system bootable will be discussed in
+ .
@@ -94,10 +77,14 @@ cp -v /usr/lib/grub/i386-pc/stage{1,2} /boot/grub
Installed programs
+ Installed directories
- grub, grub-install, grub-md5-crypt, grub-set-default,
- grub-terminfo, and mbchk
+ grub-editenv, grub-mkelfimage, grub-mkfont, grub-mkimage,
+ grub-mkrescue, grub-dumpbios, grub-install, grub-mkconfig,
+ grub-mkdevicemap, grub-probe, grub-setup
+
+ /usr/lib/grub, /etc/grub.d, /usr/share/grub, /usr/inclue/grub
@@ -106,12 +93,62 @@ cp -v /usr/lib/grub/i386-pc/stage{1,2} /boot/grub
-
- grub
+
+ grub-editenv
- The Grand Unified Bootloader's command shell
-
- grub
+ A tool to edit the environment block
+
+ grub-editenv
+
+
+
+
+
+ grub-mkelfimage
+
+ Make a bootable image of GRUB
+
+ grub-mkelfimage
+
+
+
+
+
+ grub-mkfont
+
+ Update fonts for GRUB use
+
+ grub-mkfont
+
+
+
+
+
+ grub-mkimage
+
+ Make a bootable image of GRUB
+
+ grub-mkimage
+
+
+
+
+
+ grub-mkrescue
+
+ Make a bootable image of GRUB suitable for a floppy disk
+
+ grub-mkrescue
+
+
+
+
+
+ grub-dumpbios
+
+ Create vbios and int10 dump
+
+ grub-dumpbios
@@ -119,50 +156,49 @@ cp -v /usr/lib/grub/i386-pc/stage{1,2} /boot/grub
grub-install
- Installs GRUB on the given device
+ Install GRUB on your drive
grub-install
-
- grub-md5-crypt
+
+ grub-mkconfig
- Encrypts a password in MD5 format
-
- grub-md5-crypt
+ Generate a grub config file
+
+ grub-mkconfig
-
- grub-set-default
+
+ grub-mkdevicemap
- Sets the default boot entry for GRUB
-
- grub-set-default
+ Generate a device map file automatically
+
+ grub-mkdevicemap
-
- grub-terminfo
+
+ grub-probe
- Generates a terminfo command from a terminfo name; it can be
- employed if an unknown terminal is being used
-
- grub-terminfo
+ Probe device information for a given path or device
+
+ grub-probe
-
- mbchk
+
+ grub-setup
- Checks the format of a multi-boot kernel
-
- mbchk
+ Set up images to boot from a device
+
+ grub-setup
diff --git a/chapter08/grub.xml b/chapter08/grub.xml
index f8c4efcad..bfe9bc510 100644
--- a/chapter08/grub.xml
+++ b/chapter08/grub.xml
@@ -14,96 +14,10 @@
&grub-url;
- GRUB-&grub-version;
-
-
- GRUB
-
-
-
-
-
- The GRUB package contains the GRand Unified Bootloader.
-
-
- &buildtime;
- &diskspace;
-
-
- &grub-ch6-sbu;
- &grub-ch6-du;
-
-
-
-
-
-
- Installation of GRUB
-
- 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.
-
-
- 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
- boot loading
for other architectures should be available in
- the usual resource-specific locations for those architectures.
-
-
- This package is known to have issues when its default
- optimization flags (including the -march and
- -mcpu options) are changed. If any environment
- variables that override default optimizations have been defined, such
- as CFLAGS and CXXFLAGS,
- unset them when building GRUB.
-
- 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:
-
-patch -Np1 -i ../&grub-geometry-patch;
-
- By default, GRUB doesn't support ext2 filesystems with 256-byte inodes.
- Fix this by applying the following patch:
-
-patch -Np1 -i ../&grub-inode-patch;
-
- Prepare GRUB for compilation:
-
-./configure --prefix=/usr
-
- Compile the package, but use custom optimization flags to
- prevent an error flagged in the test routines:
-
-make CFLAGS="-march=i486 -mtune=native -Os"
-
- To test the results, issue:
-
-make check
-
- Install the package:
-
-make install
-mkdir -v /boot/grub
-cp -v /usr/lib/grub/i386-pc/stage{1,2} /boot/grub
-
- Replace i386-pc with whatever
- directory is appropriate for the hardware in use.
-
- The i386-pc directory
- contains a number of *stage1_5 files, different
- ones for different file systems. Review the files available and copy
- the appropriate ones to the /boot/grub directory. Most users will
- copy the e2fs_stage1_5 and/or
- reiserfs_stage1_5 files.
-
-
-
-
- Configuring GRUB
+ Using GRUB to Set Up the Boot Process
+
+ Introduction
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
unusable (un-bootable).
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:
+ 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:
-dd if=/boot/grub/stage1 of=/dev/fd0 bs=512 count=1
-dd if=/boot/grub/stage2 of=/dev/fd0 bs=512 seek=1
-
- Remove the diskette and store it somewhere safe. Now, run the
- grub shell:
-
-grub
+cd /tmp
+grub-mkrescue --image-type=floppy floppy.img
+dd if=floppy.img of =/def/fd0 bs=1440 count=1
GRUB uses its own naming structure for drives and partitions in
the form of (hdn,m), where n
is the hard drive number and m is the partition
- number, both starting from zero. For example, partition hda1 is (hd0,0) to
- GRUB and hdb3 is
- (hd1,2). 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 sda1 is (hd0,1) to
+ GRUB and sdb3 is
+ (hd1,3). In contrast to Linux, GRUB does not
consider CD-ROM drives to be hard drives. For example, if using a CD
on hdb and a second hard drive
on hdc, that second hard drive
would still be (hd1).
+ You can determine what GRUB thinks your disk devices are by running:
+
+grub-mkdevicemap --verbose --device-map=device.map
+cat device.map
+
+ 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 /boot 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 /boot. If you do this, be sure to update
+ /etc/fstab.
+
+ Using the current lfs partition will also work, but configuration
+ for multiple systems is more difficult.
+
+
+
+ Setting Up the Configuration
+
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 hda4.
+ class="partition">sda2.
- Tell GRUB where to search for its
- stage{1,2} files. The Tab key can be used
- everywhere to make GRUB show the alternatives:
+ Install the GRUB files into /boot/grub:
-root (hd0,3)
+grub-install --grub-setup=/bin/true /dev/sda
+
+ 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.
+
+ Generate /boot/grub/grub.cfg:
+
+grub-mkconfig -o /boot/grub/grub.cfg
+
+ Here grub-mkconfig uses the files in /etc/grub.d/ to determine the contents
+ of this file. The configuration file will look something like:
+#
+# 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 ###
+
+
+ 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 grub-mkconfig. The
+ search 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 /boot.
+
+
+
+
+ Testing the Configuration
+
+ 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
+ chroot environment and re-enter it to finish the
+ few remaining portions of the book.
+
+/sbin/reboot
+...
+grub> root (hd0,1)
+grub> kernel /boot/grub/core.img
+grub> boot
+
+ 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.
+
+
+
+
+ Updating the Master Boot Record
+
+ If you tested the GRUB configuration as specified above, re-enter
+ the chroot envronment.
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 boot sector
- of the LFS partition. In this case, this next command would become
- setup (hd0,3).
+ boot manager to manage the Master Boot Record (MBR).
- Tell GRUB to install itself into the MBR of
- hda:
+ Update the MBR with:
-setup (hd0)
+grub-setup
- If all went well, GRUB will have reported finding its files in
- /boot/grub. That's all there is
- to it. Quit the grub shell:
+ This program uses the following defaults and are correct if you did not
+ deviate from the instructions above:
-quit
+
+ boot image - boot.img
+ core image - core.img
+ directory - /boot/grub
+ device map - device.map
+ root device - guessed
+
- Create a menu list
file defining GRUB's boot menu:
-
-cat > /boot/grub/menu.lst << "EOF"
-# 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
-EOF
-
- Add an entry for the host distribution if desired. It might look
- like this:
-
-cat >> /boot/grub/menu.lst << "EOF"
-title Red Hat
-root (hd0,2)
-kernel /boot/kernel-2.6.5 root=/dev/hda3
-initrd /boot/initrd-2.6.5
-EOF
-
- If dual-booting Windows, the following entry will allow
- booting it:
-
-cat >> /boot/grub/menu.lst << "EOF"
-title Windows
-rootnoverify (hd0,0)
-chainloader +1
-EOF
-
- If info grub does not provide all necessary material,
- additional information regarding GRUB is located on its website at:
- .
-
- 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:
-
-mkdir -v /etc/grub
-ln -sv /boot/grub/menu.lst /etc/grub
-
-
-
-
- Contents of GRUB
-
-
- Installed programs
-
-
- grub, grub-install, grub-md5-crypt, grub-set-default,
- grub-terminfo, and mbchk
-
-
-
-
- Short Descriptions
-
-
-
-
- grub
-
- The Grand Unified Bootloader's command shell
-
- grub
-
-
-
-
-
- grub-install
-
- Installs GRUB on the given device
-
- grub-install
-
-
-
-
-
- grub-md5-crypt
-
- Encrypts a password in MD5 format
-
- grub-md5-crypt
-
-
-
-
-
- grub-set-default
-
- Sets the default boot entry for GRUB
-
- grub-set-default
-
-
-
-
-
- grub-terminfo
-
- Generates a terminfo command from a terminfo name; it can be
- employed if an unknown terminal is being used
-
- grub-terminfo
-
-
-
-
-
- mbchk
-
- Checks the format of a multi-boot kernel
-
- mbchk
-
-
-
-
-
-
-
+
diff --git a/chapter08/kernel.xml b/chapter08/kernel.xml
index 46cbb479d..a2b737b8d 100644
--- a/chapter08/kernel.xml
+++ b/chapter08/kernel.xml
@@ -115,10 +115,13 @@
required to complete the installation. Some files need to be copied to
the /boot directory.
- The path to the kernel image may vary depending on the platform
- being used. The following command assumes an x86 architecture:
+ 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 vmlinux to be compatible with
+ the automatic setup of the boot process described in the next section. The
+ following command assumes an x86 architecture:
-cp -v arch/x86/boot/bzImage /boot/lfskernel-&linux-version;
+cp -v arch/x86/boot/bzImage /boot/vmlinux-&linux-version;-lfs-&version;
System.map is a symbol file for the kernel.
It maps the function entry points of every function in the kernel API,
diff --git a/general.ent b/general.ent
index 06eedcc8b..e8856d368 100644
--- a/general.ent
+++ b/general.ent
@@ -1,6 +1,6 @@
-
-
+
+
diff --git a/packages.ent b/packages.ent
index d2fecb8f2..9d36049e7 100644
--- a/packages.ent
+++ b/packages.ent
@@ -232,13 +232,13 @@
-
-
+
+
-
+
-
-
+
+