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

12.1 gimp3 ken/TL2024 lazarus plabs/newcss rahul/power-profiles-daemon trunk xry111/for-12.3 xry111/llvm18 xry111/spidermonkey128
Last change on this file since 93bd33d was 93bd33d, checked in by Pierre Labastie <pierre.labastie@…>, 8 months ago

grub-efi: move a comment start to its right place

"Additional Downloads" is needed for anything that is not the main
package, otherwise it wreaks havoc jhalfs

  • Property mode set to 100644
File size: 7.9 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 " ">
[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">
[09601d11]15 <!ENTITY unifont-md5sum "72f95e7ecb47a4c7ed610babe6959ead">
16 <!ENTITY unifont-size "1.3 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
[a9779b9]38 &lfs120_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">
123 <xref linkend="lvm2"/>
124 </para>
125
126
127 </sect2>
128
129 <sect2 role="installation">
130 <title>Installation of GRUB</title>
131
132 <para>
[d5cc78a]133 First, install font data as the
[756a787]134 <systemitem class="username">root</systemitem> user:
135 </para>
136
137<screen role="root"><userinput>mkdir -pv /usr/share/fonts/unifont &amp;&amp;
[ad34447a]138gunzip -c ../unifont-&unifont-version;.pcf.gz > /usr/share/fonts/unifont/unifont.pcf</userinput></screen>
[756a787]139
140 <warning>
141 <para>Unset any environment variables which may affect the build:</para>
142
143 <screen><userinput>unset {C,CPP,CXX,LD}FLAGS</userinput></screen>
144
145 <para>Don't try <quote>tuning</quote> this package with custom
146 compilation flags: this package is a bootloader, with low-level
147 operations in the source code which is likely to be broken by some
148 aggressive optimizations.</para>
149 </warning>
150
[6f87ba86]151 <para>
[426326c]152 Add a file missing from the release tarball:
[6f87ba86]153 </para>
154
[426326c]155 <screen><userinput>echo <literal>depends bli part_gpt</literal> > grub-core/extra_deps.lst</userinput></screen>
[6f87ba86]156
[672f2a5]157 <para>If you are running a 32-bit LFS, prepare a 64-bit compiler:</para>
158
159<!-- 'literal' is used deliberately to show this is only for 32-bit LFS -->
160<screen><userinput>case $(uname -m) in i?86 )
[7ca5792]161 <literal>tar xf ../gcc-&gcc-version;.tar.xz
162 mkdir gcc-&gcc-version;/build
163 pushd gcc-&gcc-version;/build
[672f2a5]164 ../configure --prefix=$PWD/../../x86_64-gcc \
165 --target=x86_64-linux-gnu \
166 --with-system-zlib \
167 --enable-languages=c,c++ \
168 --with-ld=/usr/bin/ld
169 make all-gcc
170 make install-gcc
171 popd
172 export TARGET_CC=$PWD/x86_64-gcc/bin/x86_64-linux-gnu-gcc</literal>
173esac</userinput></screen>
174
[756a787]175 <para>
176 Build <application>GRUB</application> with the following commands:
177 </para>
178
179<screen><userinput>./configure --prefix=/usr \
180 --sysconfdir=/etc \
181 --disable-efiemu \
182 --enable-grub-mkfont \
183 --with-platform=efi \
[672f2a5]184 --target=x86_64 \
[756a787]185 --disable-werror &amp;&amp;
[672f2a5]186unset TARGET_CC &amp;&amp;
[756a787]187make</userinput></screen>
188
189 <para>
[d5cc78a]190 This package does not have a test suite providing meaningful results.
[756a787]191 </para>
192
193 <para>
194 Now, as the <systemitem class="username">root</systemitem> user:
195 </para>
196
197<screen role="root"><userinput>make install &amp;&amp;
198mv -v /etc/bash_completion.d/grub /usr/share/bash-completion/completions</userinput></screen>
199
200 </sect2>
201
202 <sect2 role="commands">
203 <title>Command Explanations</title>
204
205 <para>
[d5cc78a]206 <parameter>--enable-grub-mkfont</parameter>: Build the tool named
207 <command>grub-mkfont</command> to generate the font file for the boot
208 loader from the font data we've installed.
[756a787]209 </para>
210
211 <warning>
212 <para>If the recommended dependency <xref linkend="freetype2"/> is not
[d5cc78a]213 installed, it is possible to omit this option and build GRUB. However,
[756a787]214 if <command>grub-mkfont</command> is not built, or the unicode font
[2c87187]215 data is not available at the time GRUB is built, GRUB won't install
[756a787]216 any font for the boot loader. The GRUB boot menu will be displayed
[0cef3a67]217 using a coarse font or in a smaller region on the screen.</para>
[756a787]218 </warning>
219
220 <para>
[d5cc78a]221 <parameter>--with-platform=efi</parameter>: Ensures building GRUB with
222 EFI enabled.
[756a787]223 </para>
224
[e724cb7]225 <para>
[672f2a5]226 <parameter>--target=x86_64</parameter>: Ensures building GRUB for
[ee763b6]227 x86_64 even if building on a 32-bit LFS system. Most EFI firmware
[672f2a5]228 on x86_64 does not support 32-bit bootloaders.
229 </para>
230
231 <para>
232 <option>--target=i386</option>: A few 32-bit x86 platforms have EFI
233 support. And, some x86_64 platforms have a 32-bit EFI implementation,
234 but they are very old and rare. Use this instead of
235 <parameter>--target=x86_64</parameter> if you are
236 <emphasis role='bold'>absolutely sure</emphasis> that LFS is running
237 on such a system.
[e724cb7]238 </para>
239
[756a787]240 </sect2>
241
242 <sect2>
243 <title>Configuring GRUB</title>
244
245 <para>
246 Using GRUB to make the LFS system bootable on UEFI platform will be
247 discussed in <xref linkend="grub-setup"/>.
248 </para>
249 </sect2>
250
251 <sect2 role="content">
252 <title>Contents</title>
253
254 <para>See the page for GRUB in LFS book.</para>
255 </sect2>
256
257</sect1>
Note: See TracBrowser for help on using the repository browser.