source: postlfs/filesystems/uefi-bootloaders/grub-efi.xml@ ddde9f37

11.3 12.0 12.1 12.2 gimp3 kea ken/TL2024 ken/inkscape-core-mods ken/tuningfonts lazarus lxqt plabs/newcss python3.11 qt5new rahul/power-profiles-daemon renodr/vulkan-addition trunk xry111/for-12.3 xry111/llvm18 xry111/spidermonkey128 xry111/xf86-video-removal
Last change on this file since ddde9f37 was c6c286b, checked in by Xi Ruoyao <xry111@…>, 19 months ago

tag grub-efi

  • Property mode set to 100644
File size: 8.8 KB
Line 
1<?xml version="1.0" encoding="ISO-8859-1"?>
2<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
3 "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
4 <!ENTITY % general-entities SYSTEM "../../../general.ent">
5 %general-entities;
6
7 <!ENTITY grub-efi-download-http "https://ftp.gnu.org/gnu/grub/grub-&grub-version;.tar.xz">
8 <!ENTITY grub-efi-download-ftp " ">
9 <!ENTITY grub-efi-md5sum "cf0fd928b1e5479c8108ee52cb114363">
10 <!ENTITY grub-efi-size "6.3 MB">
11 <!ENTITY grub-efi-buildsize "137 MB">
12 <!ENTITY grub-efi-time "1.0 SBU (on 64-bit LFS)">
13
14 <!ENTITY unifont-download-http "https://unifoundry.com/pub/unifont/unifont-&unifont-version;/font-builds/unifont-&unifont-version;.pcf.gz">
15 <!ENTITY unifont-md5sum "c371b9b4a8a51228c468cc7efccec098">
16 <!ENTITY unifont-size "1.4 MB">
17
18 <!ENTITY gcc-download-http "&gnu-http;/gcc/gcc-&gcc-version;/gcc-&gcc-version;.tar.xz">
19 <!ENTITY gcc-md5sum "73bafd0af874439dcdb9fc063b6fb069">
20 <!ENTITY gcc-size "81 MB">
21]>
22
23<sect1 id="grub-efi" xreflabel="GRUB-&grub-version; for EFI">
24 <?dbhtml filename="grub-efi.html"?>
25
26
27 <title>GRUB-&grub-version; for EFI</title>
28
29 <indexterm zone="grub-efi">
30 <primary sortas="a-grub-efi">grub-efi</primary>
31 </indexterm>
32
33 <sect2 role="package">
34 <title>Introduction to GRUB</title>
35
36 <para>
37 The <application>GRUB</application> package provides GRand Unified
38 Bootloader. In this page it will be built with UEFI support, which
39 is not enabled for GRUB built in LFS.
40 </para>
41
42 &lfs113_checked;
43
44 <bridgehead renderas="sect3">Package Information</bridgehead>
45 <itemizedlist spacing="compact">
46 <listitem>
47 <para>
48 Download (HTTP): <ulink url="&grub-efi-download-http;"/>
49 </para>
50 </listitem>
51 <listitem>
52 <para>
53 Download (FTP): <ulink url="&grub-efi-download-ftp;"/>
54 </para>
55 </listitem>
56 <listitem>
57 <para>
58 Download MD5 sum: &grub-efi-md5sum;
59 </para>
60 </listitem>
61 <listitem>
62 <para>
63 Download size: &grub-efi-size;
64 </para>
65 </listitem>
66 <listitem>
67 <para>
68 Estimated disk space required: &grub-efi-buildsize;
69 </para>
70 </listitem>
71 <listitem>
72 <para>
73 Estimated build time: &grub-efi-time;
74 </para>
75 </listitem>
76 </itemizedlist>
77
78 <bridgehead renderas="sect3">Additional Downloads</bridgehead>
79
80 <itemizedlist spacing="compact">
81 <listitem>
82 <para>
83 Required patch:
84 <ulink url="&patch-root;/grub-&grub-version;-upstream_fixes-1.patch"/>
85 </para>
86 </listitem>
87 </itemizedlist>
88
89 <itemizedlist spacing="compact">
90 <title>Unicode font data used to display GRUB menu</title>
91 <listitem>
92 <para>
93 Download (HTTP): <ulink url="&unifont-download-http;"/>
94 </para>
95 </listitem>
96 <listitem>
97 <para>
98 Download MD5 sum: &unifont-md5sum;
99 </para>
100 </listitem>
101 <listitem>
102 <para>
103 Download size: &unifont-size;
104 </para>
105 </listitem>
106 </itemizedlist>
107
108 <itemizedlist spacing="compact">
109 <title>GCC (only needed if building on 32-bit LFS)</title>
110 <listitem>
111 <para>
112 Download (HTTP): <ulink url="&gcc-download-http;"/>
113 </para>
114 </listitem>
115 <listitem>
116 <para>
117 Download MD5 sum: &gcc-md5sum;
118 </para>
119 </listitem>
120 <listitem>
121 <para>
122 Download size: &gcc-size;
123 </para>
124 </listitem>
125 </itemizedlist>
126
127 <bridgehead renderas="sect3">GRUB Dependencies</bridgehead>
128
129 <bridgehead renderas="sect4">Recommended</bridgehead>
130 <para role="recommended">
131 <xref role="runtime" linkend="efibootmgr"/> (runtime) and
132 <xref linkend="freetype2"/>
133 </para>
134
135 <bridgehead renderas="sect4">Optional</bridgehead>
136 <para role="optional">
137 <xref linkend="lvm2"/>
138 </para>
139
140 <para condition="html" role="usernotes">User Notes:
141 <ulink url="&blfs-wiki;/grub-efi"/></para>
142
143 </sect2>
144
145 <sect2 role="installation">
146 <title>Installation of GRUB</title>
147
148 <para>
149 First, install font data as the
150 <systemitem class="username">root</systemitem> user:
151 </para>
152
153<screen role="root"><userinput>mkdir -pv /usr/share/fonts/unifont &amp;&amp;
154gunzip -c ../unifont-&unifont-version;.pcf.gz > /usr/share/fonts/unifont/unifont.pcf</userinput></screen>
155
156 <warning>
157 <para>Unset any environment variables which may affect the build:</para>
158
159 <screen><userinput>unset {C,CPP,CXX,LD}FLAGS</userinput></screen>
160
161 <para>Don't try <quote>tuning</quote> this package with custom
162 compilation flags: this package is a bootloader, with low-level
163 operations in the source code which is likely to be broken by some
164 aggressive optimizations.</para>
165 </warning>
166
167 <para>
168 Fix an issue causing <command>grub-install</command> to fail when the
169 <filename class='directory'>/boot</filename> partition (or the root
170 partition if <filename class='directory'>/boot</filename> is not a
171 separate partition) is created by e2fsprogs-1.47.0 or later:
172 </para>
173
174<screen><userinput>patch -Np1 -i ../grub-&grub-version;-upstream_fixes-1.patch</userinput></screen>
175
176 <para>If you are running a 32-bit LFS, prepare a 64-bit compiler:</para>
177
178<!-- 'literal' is used deliberately to show this is only for 32-bit LFS -->
179<screen><userinput>case $(uname -m) in i?86 )
180 <literal>tar xf ../gcc-&gcc-version;.tar.xz
181 mkdir gcc-&gcc-version;/build
182 pushd gcc-&gcc-version;/build
183 ../configure --prefix=$PWD/../../x86_64-gcc \
184 --target=x86_64-linux-gnu \
185 --with-system-zlib \
186 --enable-languages=c,c++ \
187 --with-ld=/usr/bin/ld
188 make all-gcc
189 make install-gcc
190 popd
191 export TARGET_CC=$PWD/x86_64-gcc/bin/x86_64-linux-gnu-gcc</literal>
192esac</userinput></screen>
193
194 <para>
195 Build <application>GRUB</application> with the following commands:
196 </para>
197
198<screen><userinput>./configure --prefix=/usr \
199 --sysconfdir=/etc \
200 --disable-efiemu \
201 --enable-grub-mkfont \
202 --with-platform=efi \
203 --target=x86_64 \
204 --disable-werror &amp;&amp;
205unset TARGET_CC &amp;&amp;
206make</userinput></screen>
207
208 <para>
209 This package does not have a test suite providing meaningful results.
210 </para>
211
212 <para>
213 Now, as the <systemitem class="username">root</systemitem> user:
214 </para>
215
216<screen role="root"><userinput>make install &amp;&amp;
217mv -v /etc/bash_completion.d/grub /usr/share/bash-completion/completions</userinput></screen>
218
219 </sect2>
220
221 <sect2 role="commands">
222 <title>Command Explanations</title>
223
224 <para>
225 <parameter>--enable-grub-mkfont</parameter>: Build the tool named
226 <command>grub-mkfont</command> to generate the font file for the boot
227 loader from the font data we've installed.
228 </para>
229
230 <warning>
231 <para>If the recommended dependency <xref linkend="freetype2"/> is not
232 installed, it is possible to omit this option and build GRUB. However,
233 if <command>grub-mkfont</command> is not built, or the unicode font
234 data is not available at the time GRUB is built, GRUB won't install
235 any font for the boot loader. The GRUB boot menu will be displayed
236 using a coarse font and the early stage of kernel initialization will be
237 in <quote>blind mode</quote> &mdash; you can't see any kernel messages before
238 the graphics card driver is initialized. It will be very difficult to
239 diagnose some boot issues, especially if the graphics driver is
240 built as module.</para>
241 </warning>
242
243 <para>
244 <parameter>--with-platform=efi</parameter>: Ensures building GRUB with
245 EFI enabled.
246 </para>
247
248 <para>
249 <parameter>--target=x86_64</parameter>: Ensures building GRUB for
250 x86_64 even if building on a 32-bit LFS system. Most EFI firmwares
251 on x86_64 does not support 32-bit bootloaders.
252 </para>
253
254 <para>
255 <option>--target=i386</option>: A few 32-bit x86 platforms have EFI
256 support. And, some x86_64 platforms have a 32-bit EFI implementation,
257 but they are very old and rare. Use this instead of
258 <parameter>--target=x86_64</parameter> if you are
259 <emphasis role='bold'>absolutely sure</emphasis> that LFS is running
260 on such a system.
261 </para>
262
263 </sect2>
264
265 <sect2>
266 <title>Configuring GRUB</title>
267
268 <para>
269 Using GRUB to make the LFS system bootable on UEFI platform will be
270 discussed in <xref linkend="grub-setup"/>.
271 </para>
272 </sect2>
273
274 <sect2 role="content">
275 <title>Contents</title>
276
277 <para>See the page for GRUB in LFS book.</para>
278 </sect2>
279
280</sect1>
Note: See TracBrowser for help on using the repository browser.