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

12.0 12.1 12.2 gimp3 kea ken/TL2024 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 f5cfb36 was 0cef3a67, checked in by Xi Ruoyao <xry111@…>, 18 months ago

grub-efi: Fix "blind mode" issue

Move "insmod all_video" out of the "if loadfont" statement. It's enough
for the kernel to use EFI FB.

The "terminal_output gfxterm" statement has to be guarded by "if
loadfont", or it can garble the display if unicode.pf2 not available.

"gfxmode" seems no-use on EFI. According to upstream doc it's only
used for VGA BIOS Extension (as the name suggests, not available in EFI
environment).

  • Property mode set to 100644
File size: 8.6 KB
RevLine 
[756a787]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
[227bd7d6]7 <!ENTITY grub-efi-download-http "https://ftp.gnu.org/gnu/grub/grub-&grub-version;.tar.xz">
[756a787]8 <!ENTITY grub-efi-download-ftp " ">
[227bd7d6]9 <!ENTITY grub-efi-md5sum "cf0fd928b1e5479c8108ee52cb114363">
10 <!ENTITY grub-efi-size "6.3 MB">
[7a91c80]11 <!ENTITY grub-efi-buildsize "137 MB">
[672f2a5]12 <!ENTITY grub-efi-time "1.0 SBU (on 64-bit LFS)">
[756a787]13
[c6b192c]14 <!ENTITY unifont-download-http "https://unifoundry.com/pub/unifont/unifont-&unifont-version;/font-builds/unifont-&unifont-version;.pcf.gz">
[7cff22d]15 <!ENTITY unifont-md5sum "c371b9b4a8a51228c468cc7efccec098">
16 <!ENTITY unifont-size "1.4 MB">
[672f2a5]17
18 <!ENTITY gcc-download-http "&gnu-http;/gcc/gcc-&gcc-version;/gcc-&gcc-version;.tar.xz">
[ce1d6581]19 <!ENTITY gcc-md5sum "73bafd0af874439dcdb9fc063b6fb069">
20 <!ENTITY gcc-size "81 MB">
[756a787]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
[c6c286b]42 &lfs113_checked;
[756a787]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
[6f87ba86]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
[756a787]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
[672f2a5]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
[756a787]127 <bridgehead renderas="sect3">GRUB Dependencies</bridgehead>
128
129 <bridgehead renderas="sect4">Recommended</bridgehead>
130 <para role="recommended">
[8013518e]131 <xref role="runtime" linkend="efibootmgr"/> (runtime) and
[756a787]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>
[d5cc78a]149 First, install font data as the
[756a787]150 <systemitem class="username">root</systemitem> user:
151 </para>
152
153<screen role="root"><userinput>mkdir -pv /usr/share/fonts/unifont &amp;&amp;
[ad34447a]154gunzip -c ../unifont-&unifont-version;.pcf.gz > /usr/share/fonts/unifont/unifont.pcf</userinput></screen>
[756a787]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
[6f87ba86]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
[672f2a5]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 )
[7ca5792]180 <literal>tar xf ../gcc-&gcc-version;.tar.xz
181 mkdir gcc-&gcc-version;/build
182 pushd gcc-&gcc-version;/build
[672f2a5]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
[756a787]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 \
[672f2a5]203 --target=x86_64 \
[756a787]204 --disable-werror &amp;&amp;
[672f2a5]205unset TARGET_CC &amp;&amp;
[756a787]206make</userinput></screen>
207
208 <para>
[d5cc78a]209 This package does not have a test suite providing meaningful results.
[756a787]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>
[d5cc78a]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.
[756a787]228 </para>
229
230 <warning>
231 <para>If the recommended dependency <xref linkend="freetype2"/> is not
[d5cc78a]232 installed, it is possible to omit this option and build GRUB. However,
[756a787]233 if <command>grub-mkfont</command> is not built, or the unicode font
[2c87187]234 data is not available at the time GRUB is built, GRUB won't install
[756a787]235 any font for the boot loader. The GRUB boot menu will be displayed
[0cef3a67]236 using a coarse font or in a smaller region on the screen.</para>
[756a787]237 </warning>
238
239 <para>
[d5cc78a]240 <parameter>--with-platform=efi</parameter>: Ensures building GRUB with
241 EFI enabled.
[756a787]242 </para>
243
[e724cb7]244 <para>
[672f2a5]245 <parameter>--target=x86_64</parameter>: Ensures building GRUB for
246 x86_64 even if building on a 32-bit LFS system. Most EFI firmwares
247 on x86_64 does not support 32-bit bootloaders.
248 </para>
249
250 <para>
251 <option>--target=i386</option>: A few 32-bit x86 platforms have EFI
252 support. And, some x86_64 platforms have a 32-bit EFI implementation,
253 but they are very old and rare. Use this instead of
254 <parameter>--target=x86_64</parameter> if you are
255 <emphasis role='bold'>absolutely sure</emphasis> that LFS is running
256 on such a system.
[e724cb7]257 </para>
258
[756a787]259 </sect2>
260
261 <sect2>
262 <title>Configuring GRUB</title>
263
264 <para>
265 Using GRUB to make the LFS system bootable on UEFI platform will be
266 discussed in <xref linkend="grub-setup"/>.
267 </para>
268 </sect2>
269
270 <sect2 role="content">
271 <title>Contents</title>
272
273 <para>See the page for GRUB in LFS book.</para>
274 </sect2>
275
276</sect1>
Note: See TracBrowser for help on using the repository browser.