1 | <?xml version="1.0" encoding="UTF-8"?>
|
---|
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 |
|
---|
8 | <sect1 id="ch-system-grub" role="wrap">
|
---|
9 | <?dbhtml filename="grub.html"?>
|
---|
10 |
|
---|
11 | <sect1info condition="script">
|
---|
12 | <productname>grub</productname>
|
---|
13 | <productnumber>&grub-version;</productnumber>
|
---|
14 | <address>&grub-url;</address>
|
---|
15 | </sect1info>
|
---|
16 |
|
---|
17 | <title>GRUB-&grub-version;</title>
|
---|
18 |
|
---|
19 | <indexterm zone="ch-system-grub">
|
---|
20 | <primary sortas="a-Grub">GRUB</primary>
|
---|
21 | </indexterm>
|
---|
22 |
|
---|
23 | <sect2 role="package">
|
---|
24 | <title/>
|
---|
25 |
|
---|
26 | <para>The GRUB package contains the GRand Unified Bootloader.</para>
|
---|
27 |
|
---|
28 | <segmentedlist>
|
---|
29 | <segtitle>&buildtime;</segtitle>
|
---|
30 | <segtitle>&diskspace;</segtitle>
|
---|
31 |
|
---|
32 | <seglistitem>
|
---|
33 | <seg>&grub-fin-sbu;</seg>
|
---|
34 | <seg>&grub-fin-du;</seg>
|
---|
35 | </seglistitem>
|
---|
36 | </segmentedlist>
|
---|
37 |
|
---|
38 | </sect2>
|
---|
39 |
|
---|
40 | <sect2 role="installation">
|
---|
41 | <title>Installation of GRUB</title>
|
---|
42 |
|
---|
43 | <note>
|
---|
44 | <para>
|
---|
45 | On ARM64 systems, the following instruction builds GRUB for UEFI.
|
---|
46 | But the built GRUB lacks some features because a few optional
|
---|
47 | dependencies of GRUB for UEFI is beyond the scope of LFS and not
|
---|
48 | installed yet.
|
---|
49 | </para>
|
---|
50 | <para>
|
---|
51 | If your system firmware does not support UEFI, you need to skip the
|
---|
52 | content of this page and try to figure out how to boot your system.
|
---|
53 | </para>
|
---|
54 | <para>
|
---|
55 | If your system has UEFI support and you wish to boot LFS with UEFI,
|
---|
56 | you can skip this package in LFS,
|
---|
57 | and install GRUB with UEFI support (and its dependencies) by following
|
---|
58 | the instructions on
|
---|
59 | <ulink url="&blfs-book;postlfs/grub-efi.html">the BLFS page</ulink>
|
---|
60 | (with <parameter>--target=x86_64</parameter> removed).
|
---|
61 | </para>
|
---|
62 | </note>
|
---|
63 |
|
---|
64 | <warning>
|
---|
65 | <para>Unset any environment variables which may affect the build:</para>
|
---|
66 |
|
---|
67 | <screen><userinput remap='pre'>unset {C,CPP,CXX,LD}FLAGS</userinput></screen>
|
---|
68 |
|
---|
69 | <para>Don't try <quote>tuning</quote> this package with custom
|
---|
70 | compilation flags. This package is a bootloader. The low-level
|
---|
71 | operations in the source code may be broken by
|
---|
72 | aggressive optimization.</para>
|
---|
73 | </warning>
|
---|
74 |
|
---|
75 | <para>
|
---|
76 | Add a file missing from the release tarball:
|
---|
77 | </para>
|
---|
78 |
|
---|
79 | <screen><userinput remap='pre'>echo <literal>depends bli part_gpt</literal> > grub-core/extra_deps.lst</userinput></screen>
|
---|
80 |
|
---|
81 | <!--https://git.savannah.gnu.org/cgit/grub.git/commit/?id=69edb312 -->
|
---|
82 | <para>Apply an upstream change so GRUB will be capable to load
|
---|
83 | compressed kernel image on an ARM64 system:</para>
|
---|
84 |
|
---|
85 | <screen><userinput remap='pre'>sed '/ARMXX_MAGIC/,+2d' -i grub-core/loader/arm64/linux.c</userinput></screen>
|
---|
86 |
|
---|
87 | <para>Prepare GRUB for compilation:</para>
|
---|
88 |
|
---|
89 | <screen><userinput remap="configure">./configure --prefix=/usr \
|
---|
90 | --sysconfdir=/etc \
|
---|
91 | --disable-efiemu \
|
---|
92 | --disable-werror</userinput></screen>
|
---|
93 |
|
---|
94 | <variablelist>
|
---|
95 | <title>The meaning of the new configure options:</title>
|
---|
96 |
|
---|
97 | <varlistentry>
|
---|
98 | <term><parameter>--disable-werror</parameter></term>
|
---|
99 | <listitem>
|
---|
100 | <para>This allows the build to complete with warnings introduced
|
---|
101 | by more recent versions of Flex.</para>
|
---|
102 | </listitem>
|
---|
103 | </varlistentry>
|
---|
104 |
|
---|
105 | <varlistentry>
|
---|
106 | <term><parameter>--disable-efiemu</parameter></term>
|
---|
107 | <listitem>
|
---|
108 | <para>This option minimizes what is built by disabling a feature and
|
---|
109 | eliminating some test programs not needed for LFS.</para>
|
---|
110 | </listitem>
|
---|
111 | </varlistentry>
|
---|
112 |
|
---|
113 | </variablelist>
|
---|
114 |
|
---|
115 | <para>Compile the package:</para>
|
---|
116 |
|
---|
117 | <screen><userinput remap="make">make</userinput></screen>
|
---|
118 |
|
---|
119 | <para>The test suite for this packages is not recommended. Most of
|
---|
120 | the tests depend on packages that are not available in the limited
|
---|
121 | LFS environment. To run the tests anyway, run <command>make check</command>.</para>
|
---|
122 |
|
---|
123 | <para>Install the package:</para>
|
---|
124 |
|
---|
125 | <screen><userinput remap="install">make install
|
---|
126 | mv -v /etc/bash_completion.d/grub /usr/share/bash-completion/completions</userinput></screen>
|
---|
127 |
|
---|
128 | <para>Making your LFS system bootable with GRUB will be discussed in
|
---|
129 | <xref linkend="ch-bootable-grub"/>.</para>
|
---|
130 |
|
---|
131 | </sect2>
|
---|
132 |
|
---|
133 | <sect2 id="contents-gRUB" role="content">
|
---|
134 | <title>Contents of GRUB</title>
|
---|
135 |
|
---|
136 | <segmentedlist>
|
---|
137 | <segtitle>Installed programs</segtitle>
|
---|
138 | <segtitle>Installed directories</segtitle>
|
---|
139 |
|
---|
140 | <seglistitem>
|
---|
141 |
|
---|
142 | <seg>grub-bios-setup, grub-editenv, grub-file, grub-fstest,
|
---|
143 | grub-glue-efi, grub-install, grub-kbdcomp, grub-macbless,
|
---|
144 | grub-menulst2cfg, grub-mkconfig,
|
---|
145 | grub-mkimage, grub-mklayout, grub-mknetdir,
|
---|
146 | grub-mkpasswd-pbkdf2, grub-mkrelpath, grub-mkrescue, grub-mkstandalone,
|
---|
147 | grub-ofpathname, grub-probe, grub-reboot, grub-render-label,
|
---|
148 | grub-script-check,
|
---|
149 | grub-set-default, grub-sparc64-setup, and grub-syslinux2cfg</seg>
|
---|
150 |
|
---|
151 | <seg>/usr/lib/grub, /etc/grub.d, /usr/share/grub, and /boot/grub (when grub-install
|
---|
152 | is first run)</seg>
|
---|
153 | </seglistitem>
|
---|
154 | </segmentedlist>
|
---|
155 |
|
---|
156 | <variablelist>
|
---|
157 | <bridgehead renderas="sect3">Short Descriptions</bridgehead>
|
---|
158 | <?dbfo list-presentation="list"?>
|
---|
159 | <?dbhtml list-presentation="table"?>
|
---|
160 |
|
---|
161 | <varlistentry id="grub-bios-setup">
|
---|
162 | <term><command>grub-bios-setup</command></term>
|
---|
163 | <listitem>
|
---|
164 | <para>Is a helper program for <command>grub-install</command></para>
|
---|
165 | <indexterm zone="ch-system-grub grub-bios-setup">
|
---|
166 | <primary sortas="b-grub-bios-setup">grub-bios-setup</primary>
|
---|
167 | </indexterm>
|
---|
168 | </listitem>
|
---|
169 | </varlistentry>
|
---|
170 |
|
---|
171 | <varlistentry id="grub-editenv">
|
---|
172 | <term><command>grub-editenv</command></term>
|
---|
173 | <listitem>
|
---|
174 | <para>Is a tool to edit the environment block</para>
|
---|
175 | <indexterm zone="ch-system-grub grub-editenv">
|
---|
176 | <primary sortas="b-grub-editenv">grub-editenv</primary>
|
---|
177 | </indexterm>
|
---|
178 | </listitem>
|
---|
179 | </varlistentry>
|
---|
180 |
|
---|
181 | <varlistentry id="grub-file">
|
---|
182 | <term><command>grub-file</command></term>
|
---|
183 | <listitem>
|
---|
184 | <para>Checks to see if the given file is of the specified type</para>
|
---|
185 | <indexterm zone="ch-system-grub grub-file">
|
---|
186 | <primary sortas="b-grub-file">grub-file</primary>
|
---|
187 | </indexterm>
|
---|
188 | </listitem>
|
---|
189 | </varlistentry>
|
---|
190 |
|
---|
191 | <varlistentry id="grub-fstest">
|
---|
192 | <term><command>grub-fstest</command></term>
|
---|
193 | <listitem>
|
---|
194 | <para>Is a tool to debug the filesystem driver</para>
|
---|
195 | <indexterm zone="ch-system-grub grub-fstest">
|
---|
196 | <primary sortas="b-grub-fstest">grub-fstest</primary>
|
---|
197 | </indexterm>
|
---|
198 | </listitem>
|
---|
199 | </varlistentry>
|
---|
200 |
|
---|
201 | <varlistentry id="grub-glue-efi">
|
---|
202 | <term><command>grub-glue-efi</command></term>
|
---|
203 | <listitem>
|
---|
204 | <para>Glues 32-bit and 64-bit binaries into a single file (for Apple machines)</para>
|
---|
205 | <indexterm zone="ch-system-grub grub-glue-efi">
|
---|
206 | <primary sortas="b-grub-glue-efi">grub-glue-efi</primary>
|
---|
207 | </indexterm>
|
---|
208 | </listitem>
|
---|
209 | </varlistentry>
|
---|
210 |
|
---|
211 | <varlistentry id="grub-install">
|
---|
212 | <term><command>grub-install</command></term>
|
---|
213 | <listitem>
|
---|
214 | <para>Installs GRUB on your drive</para>
|
---|
215 | <indexterm zone="ch-system-grub grub-install">
|
---|
216 | <primary sortas="b-grub-install">grub-install</primary>
|
---|
217 | </indexterm>
|
---|
218 | </listitem>
|
---|
219 | </varlistentry>
|
---|
220 |
|
---|
221 | <varlistentry id="grub-kbdcomp">
|
---|
222 | <term><command>grub-kbdcomp</command></term>
|
---|
223 | <listitem>
|
---|
224 | <para>Is a script that converts an xkb layout into one recognized by
|
---|
225 | GRUB</para>
|
---|
226 | <indexterm zone="ch-system-grub grub-kbdcomp">
|
---|
227 | <primary sortas="b-grub-kbdcomp">grub-kbdcomp</primary>
|
---|
228 | </indexterm>
|
---|
229 | </listitem>
|
---|
230 | </varlistentry>
|
---|
231 |
|
---|
232 | <varlistentry id="grub-macbless">
|
---|
233 | <term><command>grub-macbless</command></term>
|
---|
234 | <listitem>
|
---|
235 | <para>Is the Mac-style bless for HFS or HFS+ file systems (<command>bless</command>
|
---|
236 | is peculiar to Apple machines; it makes a device bootable)</para>
|
---|
237 | <indexterm zone="ch-system-grub grub-macbless">
|
---|
238 | <primary sortas="b-grub-macbless">grub-macbless</primary>
|
---|
239 | </indexterm>
|
---|
240 | </listitem>
|
---|
241 | </varlistentry>
|
---|
242 |
|
---|
243 | <varlistentry id="grub-menulst2cfg">
|
---|
244 | <term><command>grub-menulst2cfg</command></term>
|
---|
245 | <listitem>
|
---|
246 | <para>Converts a GRUB Legacy <filename>menu.lst</filename>
|
---|
247 | into a <filename>grub.cfg</filename> for use with GRUB 2</para>
|
---|
248 | <indexterm zone="ch-system-grub grub-menulst2cfg">
|
---|
249 | <primary sortas="b-grub-menulst2cfg">grub-menulst2cfg</primary>
|
---|
250 | </indexterm>
|
---|
251 | </listitem>
|
---|
252 | </varlistentry>
|
---|
253 |
|
---|
254 | <varlistentry id="grub-mkconfig">
|
---|
255 | <term><command>grub-mkconfig</command></term>
|
---|
256 | <listitem>
|
---|
257 | <para>Generates a <filename>grub.cfg</filename> file</para>
|
---|
258 | <indexterm zone="ch-system-grub grub-mkconfig">
|
---|
259 | <primary sortas="b-grub-mkconfig">grub-mkconfig</primary>
|
---|
260 | </indexterm>
|
---|
261 | </listitem>
|
---|
262 | </varlistentry>
|
---|
263 |
|
---|
264 | <varlistentry id="grub-mkimage">
|
---|
265 | <term><command>grub-mkimage</command></term>
|
---|
266 | <listitem>
|
---|
267 | <para>Makes a bootable image of GRUB</para>
|
---|
268 | <indexterm zone="ch-system-grub grub-mkimage">
|
---|
269 | <primary sortas="b-grub-mkimage">grub-mkimage</primary>
|
---|
270 | </indexterm>
|
---|
271 | </listitem>
|
---|
272 | </varlistentry>
|
---|
273 |
|
---|
274 | <varlistentry id="grub-mklayout">
|
---|
275 | <term><command>grub-mklayout</command></term>
|
---|
276 | <listitem>
|
---|
277 | <para>Generates a GRUB keyboard layout file</para>
|
---|
278 | <indexterm zone="ch-system-grub grub-mklayout">
|
---|
279 | <primary sortas="b-grub-mklayout">grub-mklayout</primary>
|
---|
280 | </indexterm>
|
---|
281 | </listitem>
|
---|
282 | </varlistentry>
|
---|
283 |
|
---|
284 | <varlistentry id="grub-mknetdir">
|
---|
285 | <term><command>grub-mknetdir</command></term>
|
---|
286 | <listitem>
|
---|
287 | <para>Prepares a GRUB netboot directory</para>
|
---|
288 | <indexterm zone="ch-system-grub grub-mknetdir">
|
---|
289 | <primary sortas="b-grub-mknetdir">grub-mknetdir</primary>
|
---|
290 | </indexterm>
|
---|
291 | </listitem>
|
---|
292 | </varlistentry>
|
---|
293 |
|
---|
294 | <varlistentry id="grub-mkpasswd-pbkdf2">
|
---|
295 | <term><command>grub-mkpasswd-pbkdf2</command></term>
|
---|
296 | <listitem>
|
---|
297 | <para>Generates an encrypted PBKDF2 password for use in the boot
|
---|
298 | menu</para>
|
---|
299 | <indexterm zone="ch-system-grub grub-mkpasswd-pbkdf2">
|
---|
300 | <primary sortas="b-grub-mkpasswd-pbkdf2">grub-mkpasswd-pbkdf2</primary>
|
---|
301 | </indexterm>
|
---|
302 | </listitem>
|
---|
303 | </varlistentry>
|
---|
304 |
|
---|
305 | <varlistentry id="grub-mkrelpath">
|
---|
306 | <term><command>grub-mkrelpath</command></term>
|
---|
307 | <listitem>
|
---|
308 | <para>Makes a system pathname relative to its root</para>
|
---|
309 | <indexterm zone="ch-system-grub grub-mkrelpath">
|
---|
310 | <primary sortas="b-grub-mkrelpath">grub-mkrelpath</primary>
|
---|
311 | </indexterm>
|
---|
312 | </listitem>
|
---|
313 | </varlistentry>
|
---|
314 |
|
---|
315 | <varlistentry id="grub-mkrescue">
|
---|
316 | <term><command>grub-mkrescue</command></term>
|
---|
317 | <listitem>
|
---|
318 | <para>Makes a bootable image of GRUB suitable for a floppy disk,
|
---|
319 | CDROM/DVD, or a USB drive</para>
|
---|
320 | <indexterm zone="ch-system-grub grub-mkrescue">
|
---|
321 | <primary sortas="b-grub-mkrescue">grub-mkrescue</primary>
|
---|
322 | </indexterm>
|
---|
323 | </listitem>
|
---|
324 | </varlistentry>
|
---|
325 |
|
---|
326 | <varlistentry id="grub-mkstandalone">
|
---|
327 | <term><command>grub-mkstandalone</command></term>
|
---|
328 | <listitem>
|
---|
329 | <para>Generates a standalone image</para>
|
---|
330 | <indexterm zone="ch-system-grub grub-mkstandalone">
|
---|
331 | <primary sortas="b-grub-mkstandalone">grub-mkstandalone</primary>
|
---|
332 | </indexterm>
|
---|
333 | </listitem>
|
---|
334 | </varlistentry>
|
---|
335 |
|
---|
336 | <varlistentry id="grub-ofpathname">
|
---|
337 | <term><command>grub-ofpathname</command></term>
|
---|
338 | <listitem>
|
---|
339 | <para>Is a helper program that prints the path to a GRUB device</para>
|
---|
340 | <indexterm zone="ch-system-grub grub-ofpathname">
|
---|
341 | <primary sortas="b-grub-ofpathname">grub-ofpathname</primary>
|
---|
342 | </indexterm>
|
---|
343 | </listitem>
|
---|
344 | </varlistentry>
|
---|
345 |
|
---|
346 | <varlistentry id="grub-probe">
|
---|
347 | <term><command>grub-probe</command></term>
|
---|
348 | <listitem>
|
---|
349 | <para>Probes device information for a given path or device</para>
|
---|
350 | <indexterm zone="ch-system-grub grub-probe">
|
---|
351 | <primary sortas="b-grub-probe">grub-probe</primary>
|
---|
352 | </indexterm>
|
---|
353 | </listitem>
|
---|
354 | </varlistentry>
|
---|
355 |
|
---|
356 | <varlistentry id="grub-reboot">
|
---|
357 | <term><command>grub-reboot</command></term>
|
---|
358 | <listitem>
|
---|
359 | <para>Sets the default boot entry for GRUB for the next boot only</para>
|
---|
360 | <indexterm zone="ch-system-grub grub-reboot">
|
---|
361 | <primary sortas="b-grub-reboot">grub-reboot</primary>
|
---|
362 | </indexterm>
|
---|
363 | </listitem>
|
---|
364 | </varlistentry>
|
---|
365 |
|
---|
366 | <varlistentry id="grub-render-label">
|
---|
367 | <term><command>grub-render-label</command></term>
|
---|
368 | <listitem>
|
---|
369 | <para>Renders Apple .disk_label for Apple Macs</para>
|
---|
370 | <indexterm zone="ch-system-grub grub-render-label">
|
---|
371 | <primary sortas="b-grub-render-label">grub-render-label</primary>
|
---|
372 | </indexterm>
|
---|
373 | </listitem>
|
---|
374 | </varlistentry>
|
---|
375 |
|
---|
376 | <varlistentry id="grub-script-check">
|
---|
377 | <term><command>grub-script-check</command></term>
|
---|
378 | <listitem>
|
---|
379 | <para>Checks the GRUB configuration script for syntax errors</para>
|
---|
380 | <indexterm zone="ch-system-grub grub-script-check">
|
---|
381 | <primary sortas="b-grub-script-check">grub-script-check</primary>
|
---|
382 | </indexterm>
|
---|
383 | </listitem>
|
---|
384 | </varlistentry>
|
---|
385 |
|
---|
386 | <varlistentry id="grub-set-default">
|
---|
387 | <term><command>grub-set-default</command></term>
|
---|
388 | <listitem>
|
---|
389 | <para>Sets the default boot entry for GRUB</para>
|
---|
390 | <indexterm zone="ch-system-grub grub-set-default">
|
---|
391 | <primary sortas="b-grub-set-default">grub-set-default</primary>
|
---|
392 | </indexterm>
|
---|
393 | </listitem>
|
---|
394 | </varlistentry>
|
---|
395 |
|
---|
396 | <varlistentry id="grub-sparc64-setup">
|
---|
397 | <term><command>grub-sparc64-setup</command></term>
|
---|
398 | <listitem>
|
---|
399 | <para>Is a helper program for grub-setup</para>
|
---|
400 | <indexterm zone="ch-system-grub grub-sparc64-setup">
|
---|
401 | <primary sortas="b-grub-sparc64-setup">grub-setup</primary>
|
---|
402 | </indexterm>
|
---|
403 | </listitem>
|
---|
404 | </varlistentry>
|
---|
405 |
|
---|
406 | <varlistentry id="grub-syslinux2cfg">
|
---|
407 | <term><command>grub-syslinux2cfg</command></term>
|
---|
408 | <listitem>
|
---|
409 | <para>Transforms a syslinux config file into grub.cfg format</para>
|
---|
410 | <indexterm zone="ch-system-grub grub-syslinux2cfg">
|
---|
411 | <primary sortas="b-grub-syslinux2cfg">grub-syslinux2cfg</primary>
|
---|
412 | </indexterm>
|
---|
413 | </listitem>
|
---|
414 | </varlistentry>
|
---|
415 |
|
---|
416 | </variablelist>
|
---|
417 |
|
---|
418 | </sect2>
|
---|
419 |
|
---|
420 | </sect1>
|
---|