diff --git a/chapter08/chapter08.xml b/chapter08/chapter08.xml index c3ded2719..40419eb57 100644 --- a/chapter08/chapter08.xml +++ b/chapter08/chapter08.xml @@ -74,7 +74,6 @@ - diff --git a/chapter08/grub.xml b/chapter08/grub.xml deleted file mode 100644 index aa13ce3b0..000000000 --- a/chapter08/grub.xml +++ /dev/null @@ -1,403 +0,0 @@ - - - %general-entities; -]> - - - - - - grub - &grub-version; -
&grub-url;
-
- - GRUB-&grub-version; - - - GRUB - - - - - - <para>The GRUB package contains the GRand Unified Bootloader.</para> - - <segmentedlist> - <segtitle>&buildtime;</segtitle> - <segtitle>&diskspace;</segtitle> - - <seglistitem> - <seg>&grub-fin-sbu;</seg> - <seg>&grub-fin-du;</seg> - </seglistitem> - </segmentedlist> - - </sect2> - - <sect2 role="installation"> - <title>Installation of GRUB - - - - If your system has UEFI support and you wish to boot LFS with UEFI, - you can skip this package in LFS, - and install GRUB with UEFI support (and its dependencies) by following - the instructions on - the BLFS page. - - - - - Unset any environment variables which may affect the build: - - unset {C,CPP,CXX,LD}FLAGS - - Don't try tuning this package with custom - compilation flags. This package is a bootloader. The low-level - operations in the source code may be broken by - aggressive optimization. - - - - Add a file missing from the release tarball: - - -echo depends bli part_gpt > grub-core/extra_deps.lst - - Prepare GRUB for compilation: - -./configure --prefix=/usr \ - --sysconfdir=/etc \ - --disable-efiemu \ - --disable-werror - - - The meaning of the new configure options: - - - --disable-werror - - This allows the build to complete with warnings introduced - by more recent versions of Flex. - - - - - --disable-efiemu - - This option minimizes what is built by disabling a feature and - eliminating some test programs not needed for LFS. - - - - - - Compile the package: - -make - - The test suite for this packages is not recommended. Most of - the tests depend on packages that are not available in the limited - LFS environment. To run the tests anyway, run make check. - - Install the package: - -make install -mv -v /etc/bash_completion.d/grub /usr/share/bash-completion/completions - - Making your LFS system bootable with GRUB will be discussed in - . - - - - - Contents of GRUB - - - Installed programs - Installed directories - - - - grub-bios-setup, grub-editenv, grub-file, grub-fstest, - grub-glue-efi, grub-install, grub-kbdcomp, grub-macbless, - grub-menulst2cfg, grub-mkconfig, - grub-mkimage, grub-mklayout, grub-mknetdir, - grub-mkpasswd-pbkdf2, grub-mkrelpath, grub-mkrescue, grub-mkstandalone, - grub-ofpathname, grub-probe, grub-reboot, grub-render-label, - grub-script-check, - grub-set-default, grub-sparc64-setup, and grub-syslinux2cfg - - /usr/lib/grub, /etc/grub.d, /usr/share/grub, and /boot/grub (when grub-install - is first run) - - - - - Short Descriptions - - - - - grub-bios-setup - - Is a helper program for grub-install - - grub-bios-setup - - - - - - grub-editenv - - Is a tool to edit the environment block - - grub-editenv - - - - - - grub-file - - Checks to see if the given file is of the specified type - - grub-file - - - - - - grub-fstest - - Is a tool to debug the filesystem driver - - grub-fstest - - - - - - grub-glue-efi - - Glues 32-bit and 64-bit binaries into a single file (for Apple machines) - - grub-glue-efi - - - - - - grub-install - - Installs GRUB on your drive - - grub-install - - - - - - grub-kbdcomp - - Is a script that converts an xkb layout into one recognized by - GRUB - - grub-kbdcomp - - - - - - grub-macbless - - Is the Mac-style bless for HFS or HFS+ file systems (bless - is peculiar to Apple machines; it makes a device bootable) - - grub-macbless - - - - - - grub-menulst2cfg - - Converts a GRUB Legacy menu.lst - into a grub.cfg for use with GRUB 2 - - grub-menulst2cfg - - - - - - grub-mkconfig - - Generates a grub.cfg file - - grub-mkconfig - - - - - - grub-mkimage - - Makes a bootable image of GRUB - - grub-mkimage - - - - - - grub-mklayout - - Generates a GRUB keyboard layout file - - grub-mklayout - - - - - - grub-mknetdir - - Prepares a GRUB netboot directory - - grub-mknetdir - - - - - - grub-mkpasswd-pbkdf2 - - Generates an encrypted PBKDF2 password for use in the boot - menu - - grub-mkpasswd-pbkdf2 - - - - - - grub-mkrelpath - - Makes a system pathname relative to its root - - grub-mkrelpath - - - - - - grub-mkrescue - - Makes a bootable image of GRUB suitable for a floppy disk, - CDROM/DVD, or a USB drive - - grub-mkrescue - - - - - - grub-mkstandalone - - Generates a standalone image - - grub-mkstandalone - - - - - - grub-ofpathname - - Is a helper program that prints the path to a GRUB device - - grub-ofpathname - - - - - - grub-probe - - Probes device information for a given path or device - - grub-probe - - - - - - grub-reboot - - Sets the default boot entry for GRUB for the next boot only - - grub-reboot - - - - - - grub-render-label - - Renders Apple .disk_label for Apple Macs - - grub-render-label - - - - - - grub-script-check - - Checks the GRUB configuration script for syntax errors - - grub-script-check - - - - - - grub-set-default - - Sets the default boot entry for GRUB - - grub-set-default - - - - - - grub-sparc64-setup - - Is a helper program for grub-setup - - grub-setup - - - - - - grub-syslinux2cfg - - Transforms a syslinux config file into grub.cfg format - - grub-syslinux2cfg - - - - - - - - -
diff --git a/chapter08/pkgmgt.xml b/chapter08/pkgmgt.xml index 10ec5d199..b6b230b3f 100644 --- a/chapter08/pkgmgt.xml +++ b/chapter08/pkgmgt.xml @@ -376,8 +376,8 @@ make DESTDIR=/usr/pkg/libfoo/1.1 install versions of some processors may provide instructions that are unavailable with earlier versions. - Finally, the new system has to be made bootable via . + Finally, the new system has to be made bootable by configuring + a bootloader correctly. diff --git a/chapter09/symlinks.xml b/chapter09/symlinks.xml index 71e35f231..ea35c5dce 100644 --- a/chapter09/symlinks.xml +++ b/chapter09/symlinks.xml @@ -37,9 +37,7 @@ kernel command line. This is most appropriate for systems that have just one ethernet device of a particular type. Laptops often have two ethernet connections named eth0 and - wlan0; such laptops can also use this method. The command line - is in the GRUB configuration file. - See . + wlan0; such laptops can also use this method. diff --git a/chapter10/chapter10.xml b/chapter10/chapter10.xml index 28b30f55e..1b737d72f 100644 --- a/chapter10/chapter10.xml +++ b/chapter10/chapter10.xml @@ -14,6 +14,5 @@ - diff --git a/chapter10/grub.xml b/chapter10/grub.xml deleted file mode 100644 index 1706ccb3c..000000000 --- a/chapter10/grub.xml +++ /dev/null @@ -1,218 +0,0 @@ - - - %general-entities; -]> - - - - - - grub - &grub-version; -
&grub-url;
-
- - Using GRUB to Set Up the Boot Process - - - - If your system has UEFI support and you wish to boot LFS with UEFI, - you should skip the instructions in this page but still learn the - syntax of grub.cfg and the method to specify - a partition in the file from this page, and configure GRUB with UEFI - support using the instructions provided in - the BLFS page. - - - - - Introduction - - Configuring GRUB incorrectly can render your system - inoperable without an alternate boot device such as a CD-ROM or bootable - USB drive. This section is not required to boot your LFS system. You may - just want to modify your current boot loader, e.g. Grub-Legacy, GRUB2, or - LILO. - - Ensure that an emergency boot disk is ready to rescue - the computer if the computer becomes unusable (un-bootable). If you do not - already have a boot device, you can create one. In order for the procedure - below to work, you need to jump ahead to BLFS and install - xorriso from the - libisoburn package. - -cd /tmp -grub-mkrescue --output=grub-img.iso -xorriso -as cdrecord -v dev=/dev/cdrw blank=as_needed grub-img.iso - - - - - GRUB Naming Conventions - - 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. The hard drive numbers start from zero, but the partition numbers - start from one for normal partitions (from five for extended partitions). - Note that this is different from 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). - - - - - Setting Up the Configuration - - GRUB works by writing data to the first physical track of the - hard disk. This area is not part of any file system. The programs - there access GRUB modules in the boot partition. The default location - is /boot/grub/. - - 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 200 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. - - Leaving /boot on - the current LFS partition will also work, but configuration - for multiple systems is more difficult. - - 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 sda2. - - Install the GRUB files into /boot/grub and set up the boot track: - - - 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). - - -grub-install /dev/sda - - - If the system has been booted using UEFI, - grub-install will try to install files for the - x86_64-efi target, but those files - have not been installed in . - If this is the case, add to the - command above. - - - - - - Creating the GRUB Configuration File - - Generate /boot/grub/grub.cfg: - - cat > /boot/grub/grub.cfg << "EOF" -# Begin /boot/grub/grub.cfg -set default=0 -set timeout=5 - -insmod part_gpt -insmod ext2 -set root=(hd0,2) - -menuentry "GNU/Linux, Linux &linux-version;-lfs-&version;" { - linux /boot/vmlinuz-&linux-version;-lfs-&version; root=/dev/sda2 ro -} -EOF - - - The insmod commands load the - GRUB modules named - part_gpt and ext2. - Despite the naming, ext2 actually supports - ext2, - ext3, and - ext4 filesystems. - The grub-install command has embedded some modules - into the main GRUB image (installed into - the MBR or the GRUB BIOS partition) to access the other modules - (in /boot/grub/i386-pc) without - a chicken-or-egg issue, so with a typical configuration these two - modules are already embedded and those two insmod - commands will do nothing. But they do no harm anyway, and they may - be needed with some rare configurations. - - - From GRUB's perspective, the - kernel files are relative to the partition used. If you - used a separate /boot partition, remove /boot from the above - linux line. You will also need to change the - set root line to point to the boot partition. - - - - The GRUB designator for a partition may change if you added or - removed some disks (including removable disks like USB thumb devices). - The change may cause boot failure because - grub.cfg refers to some old - designators. If you wish to avoid such a problem, you may use - the UUID of a partition and the UUID of a filesystem instead of a GRUB designator to - specify a device. - Run lsblk -o UUID,PARTUUID,PATH,MOUNTPOINT to show - the UUIDs of your filesystems (in the UUID column) and - partitions (in the PARTUUID column). Then replace - set root=(hdx,y) with - search --set=root --fs-uuid <UUID of the filesystem - where the kernel is installed>, and replace - root=/dev/sda2 with - root=PARTUUID=<UUID of the partition where LFS - is built>. - Note that the UUID of a partition is completely different from the - UUID of the filesystem in this partition. Some online resources may - instruct you to use - root=UUID=<filesystem UUID> - instead of - root=PARTUUID=<partition UUID>, - but doing so will require an initramfs, which is beyond the scope of - LFS. - The name of the device node for a partition in - /dev may also change (this is less - likely than a GRUB designator change). You can also replace - paths to device nodes like /dev/sda1 with - PARTUUID=<partition UUID>, - in /etc/fstab, to avoid a potential boot failure - in case the device node name has changed. - - - GRUB is an extremely powerful program and it provides a tremendous - number of options for booting from a wide variety of devices, operating - systems, and partition types. There are also many options for customization - such as graphical splash screens, playing sounds, mouse input, etc. The - details of these options are beyond the scope of this introduction. - - There is a command, grub-mkconfig, that - can write a configuration file automatically. It uses a set of scripts in - /etc/grub.d/ and will destroy any customizations that you make. These scripts - are designed primarily for non-source distributions and are not recommended for - LFS. If you install a commercial Linux distribution, there is a good chance - that this program will be run. Be sure to back up your grub.cfg file. - - - -
diff --git a/chapter10/kernel.xml b/chapter10/kernel.xml index 6eafeaf27..484096bc2 100644 --- a/chapter10/kernel.xml +++ b/chapter10/kernel.xml @@ -375,6 +375,14 @@ cp -iv .config /boot/config-&linux-version; + + At this point, you should install and/or configure your + bootloader to boot the LFS system with the kernel just installed. + The firmware interface of MIPS systems is not standardized so the + detailed process will be board-specific. You can reuse the bootloader + from your host distro if possible. + + Install the documentation for the Linux kernel: cp -r Documentation -T /usr/share/doc/linux-&linux-version;