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

12.2 gimp3 lazarus trunk xry111/for-12.3 xry111/spidermonkey128
Last change on this file since 3a3fe00f was ce4d00e, checked in by Xi Ruoyao <xry111@…>, 4 months ago

grub-efi: No longer assume LFS grub is skipped (#19612)

  • Property mode set to 100644
File size: 10.0 KB
RevLine 
[ab4fdfc]1<?xml version="1.0" encoding="UTF-8"?>
[756a787]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 " ">
[426326c]9 <!ENTITY grub-efi-md5sum "60c564b1bdc39d8e43b3aab4bc0fb140">
10 <!ENTITY grub-efi-size "6.4 MB">
[a9779b9]11 <!ENTITY grub-efi-buildsize "183 MB">
12 <!ENTITY grub-efi-time "0.4 SBU (on 64-bit LFS, using parallelism=4)">
[756a787]13
[c6b192c]14 <!ENTITY unifont-download-http "https://unifoundry.com/pub/unifont/unifont-&unifont-version;/font-builds/unifont-&unifont-version;.pcf.gz">
[338e204]15 <!ENTITY unifont-md5sum "da47e9c7a2cec3b68a0fad5d2a341dcc">
16 <!ENTITY unifont-size "1.4 MB">
[756a787]17]>
18
19<sect1 id="grub-efi" xreflabel="GRUB-&grub-version; for EFI">
20 <?dbhtml filename="grub-efi.html"?>
21
22
23 <title>GRUB-&grub-version; for EFI</title>
24
25 <indexterm zone="grub-efi">
26 <primary sortas="a-grub-efi">grub-efi</primary>
27 </indexterm>
28
29 <sect2 role="package">
30 <title>Introduction to GRUB</title>
31
32 <para>
33 The <application>GRUB</application> package provides GRand Unified
34 Bootloader. In this page it will be built with UEFI support, which
35 is not enabled for GRUB built in LFS.
36 </para>
37
[a9922f2]38 &lfs121_checked;
[756a787]39
40 <bridgehead renderas="sect3">Package Information</bridgehead>
41 <itemizedlist spacing="compact">
42 <listitem>
43 <para>
44 Download (HTTP): <ulink url="&grub-efi-download-http;"/>
45 </para>
46 </listitem>
47 <listitem>
48 <para>
49 Download (FTP): <ulink url="&grub-efi-download-ftp;"/>
50 </para>
51 </listitem>
52 <listitem>
53 <para>
54 Download MD5 sum: &grub-efi-md5sum;
55 </para>
56 </listitem>
57 <listitem>
58 <para>
59 Download size: &grub-efi-size;
60 </para>
61 </listitem>
62 <listitem>
63 <para>
64 Estimated disk space required: &grub-efi-buildsize;
65 </para>
66 </listitem>
67 <listitem>
68 <para>
69 Estimated build time: &grub-efi-time;
70 </para>
71 </listitem>
72 </itemizedlist>
73
[93bd33d]74 <bridgehead renderas="sect3">Additional Downloads</bridgehead>
75 <!--
[6f87ba86]76 <itemizedlist spacing="compact">
77 <listitem>
78 <para>
79 Required patch:
80 <ulink url="&patch-root;/grub-&grub-version;-upstream_fixes-1.patch"/>
81 </para>
82 </listitem>
83 </itemizedlist>
[426326c]84 -->
[756a787]85 <itemizedlist spacing="compact">
86 <title>Unicode font data used to display GRUB menu</title>
87 <listitem>
88 <para>
89 Download (HTTP): <ulink url="&unifont-download-http;"/>
90 </para>
91 </listitem>
92 <listitem>
93 <para>
94 Download MD5 sum: &unifont-md5sum;
95 </para>
96 </listitem>
97 <listitem>
98 <para>
99 Download size: &unifont-size;
100 </para>
101 </listitem>
102 </itemizedlist>
103
[672f2a5]104 <itemizedlist spacing="compact">
105 <title>GCC (only needed if building on 32-bit LFS)</title>
106 <listitem>
107 <para>
[bd141376]108 Refer to <xref linkend='gcc'/> page for download info.
[672f2a5]109 </para>
110 </listitem>
111 </itemizedlist>
112
[756a787]113 <bridgehead renderas="sect3">GRUB Dependencies</bridgehead>
114
115 <bridgehead renderas="sect4">Recommended</bridgehead>
116 <para role="recommended">
[8013518e]117 <xref role="runtime" linkend="efibootmgr"/> (runtime) and
[756a787]118 <xref linkend="freetype2"/>
119 </para>
120
121 <bridgehead renderas="sect4">Optional</bridgehead>
122 <para role="optional">
[ce4d00e]123 <xref linkend="lvm2"/> and
124 <xref linkend="fuse3"/>
[756a787]125 </para>
126 </sect2>
127
128 <sect2 role="installation">
129 <title>Installation of GRUB</title>
130
131 <para>
[d5cc78a]132 First, install font data as the
[756a787]133 <systemitem class="username">root</systemitem> user:
134 </para>
135
136<screen role="root"><userinput>mkdir -pv /usr/share/fonts/unifont &amp;&amp;
[ad34447a]137gunzip -c ../unifont-&unifont-version;.pcf.gz > /usr/share/fonts/unifont/unifont.pcf</userinput></screen>
[756a787]138
139 <warning>
140 <para>Unset any environment variables which may affect the build:</para>
141
142 <screen><userinput>unset {C,CPP,CXX,LD}FLAGS</userinput></screen>
143
144 <para>Don't try <quote>tuning</quote> this package with custom
145 compilation flags: this package is a bootloader, with low-level
146 operations in the source code which is likely to be broken by some
147 aggressive optimizations.</para>
148 </warning>
149
[6f87ba86]150 <para>
[426326c]151 Add a file missing from the release tarball:
[6f87ba86]152 </para>
153
[426326c]154 <screen><userinput>echo <literal>depends bli part_gpt</literal> > grub-core/extra_deps.lst</userinput></screen>
[6f87ba86]155
[672f2a5]156 <para>If you are running a 32-bit LFS, prepare a 64-bit compiler:</para>
157
158<!-- 'literal' is used deliberately to show this is only for 32-bit LFS -->
159<screen><userinput>case $(uname -m) in i?86 )
[7ca5792]160 <literal>tar xf ../gcc-&gcc-version;.tar.xz
161 mkdir gcc-&gcc-version;/build
162 pushd gcc-&gcc-version;/build
[672f2a5]163 ../configure --prefix=$PWD/../../x86_64-gcc \
164 --target=x86_64-linux-gnu \
165 --with-system-zlib \
166 --enable-languages=c,c++ \
167 --with-ld=/usr/bin/ld
168 make all-gcc
169 make install-gcc
170 popd
171 export TARGET_CC=$PWD/x86_64-gcc/bin/x86_64-linux-gnu-gcc</literal>
172esac</userinput></screen>
173
[756a787]174 <para>
175 Build <application>GRUB</application> with the following commands:
176 </para>
177
178<screen><userinput>./configure --prefix=/usr \
179 --sysconfdir=/etc \
180 --disable-efiemu \
181 --enable-grub-mkfont \
182 --with-platform=efi \
[672f2a5]183 --target=x86_64 \
[756a787]184 --disable-werror &amp;&amp;
[672f2a5]185unset TARGET_CC &amp;&amp;
[756a787]186make</userinput></screen>
187
188 <para>
[d5cc78a]189 This package does not have a test suite providing meaningful results.
[756a787]190 </para>
191
192 <para>
[ce4d00e]193 Now, if you've skip the LFS GRUB package, as the
194 <systemitem class="username">root</systemitem> user:
[756a787]195 </para>
196
[ce4d00e]197<screen role="nodump"><userinput>make install &amp;&amp;
[756a787]198mv -v /etc/bash_completion.d/grub /usr/share/bash-completion/completions</userinput></screen>
199
[ce4d00e]200 <para>
201 If you've not skip LFS GRUB package, as the &root; user, only install
202 the components not installed from the LFS GRUB package instead:
203 </para>
204
205<screen role="root"><userinput>make DESTDIR=$PWD/dest install
206cp -av dest/usr/lib/grub/x86_64-efi -T /usr/lib/grub/x86_64-efi
207cp -av dest/usr/share/grub/*.{pf2,h} /usr/share/grub
208cp -av dest/usr/bin/grub-mkfont /usr/bin</userinput></screen>
209
210 <para>
211 If the optional dependencies are installed, also install the
212 <command>grub-mount</command> program:
213 </para>
214
215<screen role="nodump"><userinput>cp -av dest/usr/bin/grub-mount /usr/bin</userinput></screen>
216
[756a787]217 </sect2>
218
219 <sect2 role="commands">
220 <title>Command Explanations</title>
221
222 <para>
[d5cc78a]223 <parameter>--enable-grub-mkfont</parameter>: Build the tool named
224 <command>grub-mkfont</command> to generate the font file for the boot
225 loader from the font data we've installed.
[756a787]226 </para>
227
228 <warning>
229 <para>If the recommended dependency <xref linkend="freetype2"/> is not
[d5cc78a]230 installed, it is possible to omit this option and build GRUB. However,
[756a787]231 if <command>grub-mkfont</command> is not built, or the unicode font
[2c87187]232 data is not available at the time GRUB is built, GRUB won't install
[756a787]233 any font for the boot loader. The GRUB boot menu will be displayed
[0cef3a67]234 using a coarse font or in a smaller region on the screen.</para>
[756a787]235 </warning>
236
237 <para>
[d5cc78a]238 <parameter>--with-platform=efi</parameter>: Ensures building GRUB with
239 EFI enabled.
[756a787]240 </para>
241
[e724cb7]242 <para>
[672f2a5]243 <parameter>--target=x86_64</parameter>: Ensures building GRUB for
[ee763b6]244 x86_64 even if building on a 32-bit LFS system. Most EFI firmware
[672f2a5]245 on x86_64 does not support 32-bit bootloaders.
246 </para>
247
248 <para>
249 <option>--target=i386</option>: A few 32-bit x86 platforms have EFI
250 support. And, some x86_64 platforms have a 32-bit EFI implementation,
251 but they are very old and rare. Use this instead of
252 <parameter>--target=x86_64</parameter> if you are
253 <emphasis role='bold'>absolutely sure</emphasis> that LFS is running
254 on such a system.
[e724cb7]255 </para>
256
[756a787]257 </sect2>
258
259 <sect2>
260 <title>Configuring GRUB</title>
261
262 <para>
263 Using GRUB to make the LFS system bootable on UEFI platform will be
264 discussed in <xref linkend="grub-setup"/>.
265 </para>
266 </sect2>
267
268 <sect2 role="content">
269 <title>Contents</title>
270
[ce4d00e]271 <para>
272 A list of the installed files, along with their short
273 descriptions can be found at
274 <ulink url="&lfs-root;/chapter08/grub.html#contents-gRUB"/>.
275 </para>
276
277 <para>
278 Listed below are the newly installed programs
279 along with short descriptions.
280 </para>
281
282 <segmentedlist>
283 <segtitle>Installed Programs</segtitle>
284 <segtitle>Installed Directories</segtitle>
285
286 <seglistitem>
287 <seg>grub-mkfont and grub-mount (optional)</seg>
288 <seg>/usr/lib/grub/x86_64-efi</seg>
289 </seglistitem>
290 </segmentedlist>
291
292 <variablelist>
293 <bridgehead renderas="sect3">Short Descriptions</bridgehead>
294 <?dbfo list-presentation="list"?>
295 <?dbhtml list-presentation="table"?>
296
297 <varlistentry id="grub-mkfont">
298 <term><command>grub-mkfont</command></term>
299 <listitem>
300 <para>
301 converts common font file formats into PF2
302 </para>
303 <indexterm zone="grub-efi grub-mkfont">
304 <primary sortas="b-grub-mkfont">grub-mkfont</primary>
305 </indexterm>
306 </listitem>
307 </varlistentry>
308
309 <varlistentry id="grub-mount">
310 <term><command>grub-mount</command></term>
311 <listitem>
312 <para>
313 is a debug tool for filesystem driver
314 </para>
315 <indexterm zone="grub-efi grub-mount">
316 <primary sortas="b-grub-mount">grub-mount</primary>
317 </indexterm>
318 </listitem>
319 </varlistentry>
320 </variablelist>
321
[756a787]322 </sect2>
323
324</sect1>
Note: See TracBrowser for help on using the repository browser.