Changes in chapter10/grub.xml [c423f883:c7f74cd]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
chapter10/grub.xml
rc423f883 rc7f74cd 19 19 <note> 20 20 <para> 21 This section assume your system has UEFI support and you wish to boot 22 LFS with UEFI and GRUB built following the instructions in Chapter 8. 23 </para> 24 <para> 25 If you've installed GRUB for UEFI with optional dependencies following 26 BLFS, you should skip this page, and configure GRUB with UEFI support 21 If your system has UEFI support and you wish to boot LFS with UEFI, 22 you should skip this page, and configure GRUB with UEFI support 27 23 using the instructions provided in 28 <ulink url="&blfs-book;postlfs/grub-setup.html">the BLFS page</ulink>, 29 but replace <parameter>--target=x86_64-efi</parameter> with 30 <parameter>--target=loongarch64-efi</parameter> for the 64-bit 31 LoongArch system. 32 </para> 33 <para> 34 If your system does not support UEFI or you don't want to use it, 35 you'll need to figure out how to configure the booting process of 36 the system on your own. 24 <ulink url="&blfs-book;postlfs/grub-setup.html">the BLFS page</ulink>. 37 25 </para> 38 26 </note> … … 47 35 LILO.</para></warning> 48 36 49 <para> Ensure that an emergency boot disk is ready to <quote>rescue</quote>37 <para> Ensure that an emergency boot disk is ready to <quote>rescue</quote> 50 38 the computer if the computer becomes unusable (un-bootable). If you do not 51 already have a boot device, you can create one. To create a emergency 52 boot device for UEFI, consult section <quote>Create an Emergency Boot 53 Disk</quote> in 54 <ulink url="&blfs-book;postlfs/grub-setup.html">the BLFS page</ulink>.</para> 55 56 </sect2> 57 58 <sect2> 59 <title>Turn off Secure Boot</title> 60 61 <para>LFS does not have the essential packages to support Secure Boot. 62 To set up the boot process following the instructions in this section, 63 Secure Boot must be turned off from the configuration interface of the 64 firmware. Read the documentation provided by the manufacturer of your 65 system to find out how.</para> 39 already have a boot device, you can create one. In order for the procedure 40 below to work, you need to jump ahead to BLFS and install 41 <userinput>xorriso</userinput> from the <ulink 42 url="&blfs-book;multimedia/libisoburn.html"> 43 libisoburn</ulink> package.</para> 44 45 <screen role="nodump"><userinput>cd /tmp 46 grub-mkrescue --output=grub-img.iso 47 xorriso -as cdrecord -v dev=/dev/cdrw blank=as_needed grub-img.iso</userinput></screen> 48 66 49 </sect2> 67 50 … … 89 72 <title>Setting Up the Configuration</title> 90 73 91 <para>GRUB works by creating an EFI executable in the EFI System 92 Partition (ESP). You can find the ESP with:</para> 93 94 <screen role="nodump"><userinput>fdisk -l | grep 'EFI System'</userinput></screen> 95 96 <para>If no ESP exists on your hard drive (for example, you are building 97 LFS on a fresh new system with a Live CD as the host distro), read 98 <ulink url="&blfs-book;postlfs/grub-setup.html">the BLFS page</ulink> 99 for the instruction to create an ESP on your hard drive.</para> 100 101 <para>If the ESP is not mounted at 102 <filename class="directory">/boot/efi</filename> (in the chroot), 103 mount it now:</para> 104 105 <screen role="nodump"><userinput>mkdir -pv /boot/efi 106 mount /boot/efi</userinput></screen> 107 108 <note> 109 <para>The path to the device node is intentionally omitted in the 110 command. We expect the entry for mounting the ESP to 111 <filename class="directory">/boot/efi</filename> is already in 112 <filename>/etc/fstab</filename>. Add the entry before running the 113 command if you forgot to create an entry for the ESP in 114 <xref linkend="ch-bootable-fstab"/>.</para> 115 </note> 74 <para>GRUB works by writing data to the first physical track of the 75 hard disk. This area is not part of any file system. The programs 76 there access GRUB modules in the boot partition. The default location 77 is /boot/grub/.</para> 116 78 117 79 <para>The location of the boot partition is a choice of the user that … … 138 100 139 101 <para>Install the GRUB files into <filename 140 class="directory">/boot/grub</filename> and the GRUB EFI executable into 141 <filename>/boot/efi/EFI/BOOT/BOOTLOONGARCH64.EFI</filename>:</para> 102 class="directory">/boot/grub</filename> and set up the boot track:</para> 142 103 143 104 <warning> 144 <para>The following command will overwrite 145 <filename>BOOTLOONGARCH64.EFI</filename>. Do not run the command if 146 this is not desired, for example, if it contains a third party boot 147 manager. You can backup it with <command>cp</command> as it's a 148 regular file.</para> 105 <para>The following command will overwrite the current boot loader. Do not 106 run the command if this is not desired, for example, if using a third party 107 boot manager to manage the Master Boot Record (MBR).</para> 149 108 </warning> 150 109 151 <screen role="nodump"><userinput>grub-install --removable</userinput></screen>110 <screen role="nodump"><userinput>grub-install /dev/sda</userinput></screen> 152 111 153 112 <note> 154 <para> 155 <parameter>--removable</parameter> may seem strange here. The UEFI 156 firmware searches EFI executables for boot loaders in a hardcoded 157 path, <filename>EFI/BOOT/BOOTLOONGARCH64.EFI</filename> in the ESP, and other 158 boot loader paths listed in the EFI variables. We've not installed 159 the utilities for manipulating EFI variables so we need to install 160 the EFI executable into the hardcoded path. The hardcoded path is 161 usually used by removable devices (for example, USB thumb devices) 162 so the <command>grub-install</command> option for this purpose is 163 named <parameter>--removable</parameter>. 164 </para> 165 <para> 166 UEFI implementation usually prefers the boot loaders with paths 167 recorded in an EFI variable, to the boot loader with the hardcoded 168 search path. You may need to invoke the boot device selection menu 169 or setting interface of your EFI firmware on next boot to explicitly 170 select the bootloader. 171 </para> 172 <para> 173 Some UEFI implementation may completely skip the hardcoded path if 174 there are other boot loaders in the same hard drive with paths 175 recorded in an EFI variable. Then you need to create an EFI 176 variable for the newly installed boot loader. Install 177 <ulink url="&blfs-book;postlfs/efibootmgr.html">efibootmgr</ulink>, 178 then run the following commands: 179 180 <screen role="nodump"><userinput>mount -v -t efivarfs efivarfs /sys/firmware/efi/efivars 181 efibootmgr -B -L LFS || true 182 efibootmgr -c -L LFS -l '\EFI\BOOT\BOOTLOONGARCH64.EFI' -d /dev/sda 183 umount /sys/firmware/efi/efivars</userinput></screen> 184 185 Replace <filename>/dev/sda</filename> with the device node of the 186 hard drive where you are installing GRUB into. 187 </para> 113 <para>If the system has been booted using UEFI, 114 <command>grub-install</command> will try to install files for the 115 <emphasis>x86_64-efi</emphasis> target, but those files 116 have not been installed in <xref linkend="chapter-building-system"/>. 117 If this is the case, add <option>--target i386-pc</option> to the 118 command above.</para> 188 119 </note> 189 120 … … 213 144 insmod ext2 214 145 set root=(hd0,2) 215 216 insmod all_video217 146 218 147 menuentry "GNU/Linux, Linux &linux-version;-lfs-&version;" {
Note:
See TracChangeset
for help on using the changeset viewer.