%general-entities; ]> GRUB-&grub-version; for EFI grub-efi Introduction to GRUB The GRUB package provides GRand Unified Bootloader. In this page it will be built with UEFI support, which is not enabled for GRUB built in LFS. &lfs121_checked; Package Information Download (HTTP): Download (FTP): Download MD5 sum: &grub-efi-md5sum; Download size: &grub-efi-size; Estimated disk space required: &grub-efi-buildsize; Estimated build time: &grub-efi-time; Additional Downloads Unicode font data used to display GRUB menu Download (HTTP): Download MD5 sum: &unifont-md5sum; Download size: &unifont-size; GCC (only needed if building on 32-bit LFS) Refer to page for download info. GRUB Dependencies Recommended (runtime) and Optional and Installation of GRUB First, install font data as the root user: mkdir -pv /usr/share/fonts/unifont && gunzip -c ../unifont-&unifont-version;.pcf.gz > /usr/share/fonts/unifont/unifont.pcf Unset any environment variables which may affect the build: unset {C,CPP,CXX,LD}FLAGS Don't try tuning this package with custom compilation flags: this package is a bootloader, with low-level operations in the source code which is likely to be broken by some aggressive optimizations. Add a file missing from the release tarball: echo depends bli part_gpt > grub-core/extra_deps.lst If you are running a 32-bit LFS, prepare a 64-bit compiler: case $(uname -m) in i?86 ) tar xf ../gcc-&gcc-version;.tar.xz mkdir gcc-&gcc-version;/build pushd gcc-&gcc-version;/build ../configure --prefix=$PWD/../../x86_64-gcc \ --target=x86_64-linux-gnu \ --with-system-zlib \ --enable-languages=c,c++ \ --with-ld=/usr/bin/ld make all-gcc make install-gcc popd export TARGET_CC=$PWD/x86_64-gcc/bin/x86_64-linux-gnu-gcc esac Build GRUB with the following commands: ./configure --prefix=/usr \ --sysconfdir=/etc \ --disable-efiemu \ --enable-grub-mkfont \ --with-platform=efi \ --target=x86_64 \ --disable-werror && unset TARGET_CC && make This package does not have a test suite providing meaningful results. Now, if you've skip the LFS GRUB package, as the root user: make install && mv -v /etc/bash_completion.d/grub /usr/share/bash-completion/completions If you've not skip LFS GRUB package, as the &root; user, only install the components not installed from the LFS GRUB package instead: make DESTDIR=$PWD/dest install cp -av dest/usr/lib/grub/x86_64-efi -T /usr/lib/grub/x86_64-efi cp -av dest/usr/share/grub/*.{pf2,h} /usr/share/grub cp -av dest/usr/bin/grub-mkfont /usr/bin If the optional dependencies are installed, also install the grub-mount program: cp -av dest/usr/bin/grub-mount /usr/bin Command Explanations --enable-grub-mkfont: Build the tool named grub-mkfont to generate the font file for the boot loader from the font data we've installed. If the recommended dependency is not installed, it is possible to omit this option and build GRUB. However, if grub-mkfont is not built, or the unicode font data is not available at the time GRUB is built, GRUB won't install any font for the boot loader. The GRUB boot menu will be displayed using a coarse font or in a smaller region on the screen. --with-platform=efi: Ensures building GRUB with EFI enabled. --target=x86_64: Ensures building GRUB for x86_64 even if building on a 32-bit LFS system. Most EFI firmware on x86_64 does not support 32-bit bootloaders. : A few 32-bit x86 platforms have EFI support. And, some x86_64 platforms have a 32-bit EFI implementation, but they are very old and rare. Use this instead of --target=x86_64 if you are absolutely sure that LFS is running on such a system. Configuring GRUB Using GRUB to make the LFS system bootable on UEFI platform will be discussed in . Contents A list of the installed files, along with their short descriptions can be found at . Listed below are the newly installed programs along with short descriptions. Installed Programs Installed Directories grub-mkfont and grub-mount (optional) /usr/lib/grub/x86_64-efi Short Descriptions grub-mkfont converts common font file formats into PF2 grub-mkfont grub-mount is a debug tool for filesystem driver grub-mount