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 | &lfs112_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 | <title>Unicode font data used to display GRUB menu</title>
|
---|
82 | <listitem>
|
---|
83 | <para>
|
---|
84 | Download (HTTP): <ulink url="&unifont-download-http;"/>
|
---|
85 | </para>
|
---|
86 | </listitem>
|
---|
87 | <listitem>
|
---|
88 | <para>
|
---|
89 | Download MD5 sum: &unifont-md5sum;
|
---|
90 | </para>
|
---|
91 | </listitem>
|
---|
92 | <listitem>
|
---|
93 | <para>
|
---|
94 | Download size: &unifont-size;
|
---|
95 | </para>
|
---|
96 | </listitem>
|
---|
97 | </itemizedlist>
|
---|
98 |
|
---|
99 | <itemizedlist spacing="compact">
|
---|
100 | <title>GCC (only needed if building on 32-bit LFS)</title>
|
---|
101 | <listitem>
|
---|
102 | <para>
|
---|
103 | Download (HTTP): <ulink url="&gcc-download-http;"/>
|
---|
104 | </para>
|
---|
105 | </listitem>
|
---|
106 | <listitem>
|
---|
107 | <para>
|
---|
108 | Download MD5 sum: &gcc-md5sum;
|
---|
109 | </para>
|
---|
110 | </listitem>
|
---|
111 | <listitem>
|
---|
112 | <para>
|
---|
113 | Download size: &gcc-size;
|
---|
114 | </para>
|
---|
115 | </listitem>
|
---|
116 | </itemizedlist>
|
---|
117 |
|
---|
118 | <bridgehead renderas="sect3">GRUB Dependencies</bridgehead>
|
---|
119 |
|
---|
120 | <bridgehead renderas="sect4">Recommended</bridgehead>
|
---|
121 | <para role="recommended">
|
---|
122 | <xref role="runtime" linkend="efibootmgr"/> (runtime) and
|
---|
123 | <xref linkend="freetype2"/>
|
---|
124 | </para>
|
---|
125 |
|
---|
126 | <bridgehead renderas="sect4">Optional</bridgehead>
|
---|
127 | <para role="optional">
|
---|
128 | <xref linkend="lvm2"/>
|
---|
129 | </para>
|
---|
130 |
|
---|
131 | <para condition="html" role="usernotes">User Notes:
|
---|
132 | <ulink url="&blfs-wiki;/grub-efi"/></para>
|
---|
133 |
|
---|
134 | </sect2>
|
---|
135 |
|
---|
136 | <sect2 role="installation">
|
---|
137 | <title>Installation of GRUB</title>
|
---|
138 |
|
---|
139 | <para>
|
---|
140 | First, install font data as the
|
---|
141 | <systemitem class="username">root</systemitem> user:
|
---|
142 | </para>
|
---|
143 |
|
---|
144 | <screen role="root"><userinput>mkdir -pv /usr/share/fonts/unifont &&
|
---|
145 | gunzip -c ../unifont-&unifont-version;.pcf.gz > /usr/share/fonts/unifont/unifont.pcf</userinput></screen>
|
---|
146 |
|
---|
147 | <warning>
|
---|
148 | <para>Unset any environment variables which may affect the build:</para>
|
---|
149 |
|
---|
150 | <screen><userinput>unset {C,CPP,CXX,LD}FLAGS</userinput></screen>
|
---|
151 |
|
---|
152 | <para>Don't try <quote>tuning</quote> this package with custom
|
---|
153 | compilation flags: this package is a bootloader, with low-level
|
---|
154 | operations in the source code which is likely to be broken by some
|
---|
155 | aggressive optimizations.</para>
|
---|
156 | </warning>
|
---|
157 |
|
---|
158 | <para>If you are running a 32-bit LFS, prepare a 64-bit compiler:</para>
|
---|
159 |
|
---|
160 | <!-- 'literal' is used deliberately to show this is only for 32-bit LFS -->
|
---|
161 | <screen><userinput>case $(uname -m) in i?86 )
|
---|
162 | <literal>tar xf ../gcc-&gcc-version;.tar.xz
|
---|
163 | mkdir gcc-&gcc-version;/build
|
---|
164 | pushd gcc-&gcc-version;/build
|
---|
165 | ../configure --prefix=$PWD/../../x86_64-gcc \
|
---|
166 | --target=x86_64-linux-gnu \
|
---|
167 | --with-system-zlib \
|
---|
168 | --enable-languages=c,c++ \
|
---|
169 | --with-ld=/usr/bin/ld
|
---|
170 | make all-gcc
|
---|
171 | make install-gcc
|
---|
172 | popd
|
---|
173 | export TARGET_CC=$PWD/x86_64-gcc/bin/x86_64-linux-gnu-gcc</literal>
|
---|
174 | esac</userinput></screen>
|
---|
175 |
|
---|
176 | <para>
|
---|
177 | Build <application>GRUB</application> with the following commands:
|
---|
178 | </para>
|
---|
179 |
|
---|
180 | <screen><userinput>./configure --prefix=/usr \
|
---|
181 | --sysconfdir=/etc \
|
---|
182 | --disable-efiemu \
|
---|
183 | --enable-grub-mkfont \
|
---|
184 | --with-platform=efi \
|
---|
185 | --target=x86_64 \
|
---|
186 | --disable-werror &&
|
---|
187 | unset TARGET_CC &&
|
---|
188 | make</userinput></screen>
|
---|
189 |
|
---|
190 | <para>
|
---|
191 | This package does not have a test suite providing meaningful results.
|
---|
192 | </para>
|
---|
193 |
|
---|
194 | <para>
|
---|
195 | Now, as the <systemitem class="username">root</systemitem> user:
|
---|
196 | </para>
|
---|
197 |
|
---|
198 | <screen role="root"><userinput>make install &&
|
---|
199 | mv -v /etc/bash_completion.d/grub /usr/share/bash-completion/completions</userinput></screen>
|
---|
200 |
|
---|
201 | </sect2>
|
---|
202 |
|
---|
203 | <sect2 role="commands">
|
---|
204 | <title>Command Explanations</title>
|
---|
205 |
|
---|
206 | <para>
|
---|
207 | <parameter>--enable-grub-mkfont</parameter>: Build the tool named
|
---|
208 | <command>grub-mkfont</command> to generate the font file for the boot
|
---|
209 | loader from the font data we've installed.
|
---|
210 | </para>
|
---|
211 |
|
---|
212 | <warning>
|
---|
213 | <para>If the recommended dependency <xref linkend="freetype2"/> is not
|
---|
214 | installed, it is possible to omit this option and build GRUB. However,
|
---|
215 | if <command>grub-mkfont</command> is not built, or the unicode font
|
---|
216 | data is not available at the time GRUB is built, GRUB won't install
|
---|
217 | any font for the boot loader. The GRUB boot menu will be displayed
|
---|
218 | using a coarse font and the early stage of kernel initialization will be
|
---|
219 | in <quote>blind mode</quote> — you can't see any kernel messages before
|
---|
220 | the graphics card driver is initialized. It will be very difficult to
|
---|
221 | diagnose some boot issues, especially if the graphics driver is
|
---|
222 | built as module.</para>
|
---|
223 | </warning>
|
---|
224 |
|
---|
225 | <para>
|
---|
226 | <parameter>--with-platform=efi</parameter>: Ensures building GRUB with
|
---|
227 | EFI enabled.
|
---|
228 | </para>
|
---|
229 |
|
---|
230 | <para>
|
---|
231 | <parameter>--target=x86_64</parameter>: Ensures building GRUB for
|
---|
232 | x86_64 even if building on a 32-bit LFS system. Most EFI firmwares
|
---|
233 | on x86_64 does not support 32-bit bootloaders.
|
---|
234 | </para>
|
---|
235 |
|
---|
236 | <para>
|
---|
237 | <option>--target=i386</option>: A few 32-bit x86 platforms have EFI
|
---|
238 | support. And, some x86_64 platforms have a 32-bit EFI implementation,
|
---|
239 | but they are very old and rare. Use this instead of
|
---|
240 | <parameter>--target=x86_64</parameter> if you are
|
---|
241 | <emphasis role='bold'>absolutely sure</emphasis> that LFS is running
|
---|
242 | on such a system.
|
---|
243 | </para>
|
---|
244 |
|
---|
245 | </sect2>
|
---|
246 |
|
---|
247 | <sect2>
|
---|
248 | <title>Configuring GRUB</title>
|
---|
249 |
|
---|
250 | <para>
|
---|
251 | Using GRUB to make the LFS system bootable on UEFI platform will be
|
---|
252 | discussed in <xref linkend="grub-setup"/>.
|
---|
253 | </para>
|
---|
254 | </sect2>
|
---|
255 |
|
---|
256 | <sect2 role="content">
|
---|
257 | <title>Contents</title>
|
---|
258 |
|
---|
259 | <para>See the page for GRUB in LFS book.</para>
|
---|
260 | </sect2>
|
---|
261 |
|
---|
262 | </sect1>
|
---|