Index: postlfs/filesystems/uefi-bootloaders/grub-efi.xml
===================================================================
--- postlfs/filesystems/uefi-bootloaders/grub-efi.xml (revision e724cb78d04714e7cba0aa2b3c0470590485c448)
+++ postlfs/filesystems/uefi-bootloaders/grub-efi.xml (revision 672f2a570f43d60e0ab017173569411c5f7eb05d)
@@ -10,9 +10,13 @@
-
+
+
+
+
+
]>
@@ -96,4 +100,23 @@
+
+ GCC (only needed if building on 32-bit LFS)
+
+
+ Download (HTTP):
+
+
+
+
+ Download MD5 sum: &gcc-md5sum;
+
+
+
+
+ Download size: &gcc-size;
+
+
+
+
GRUB Dependencies
@@ -120,11 +143,4 @@
Installation of GRUB
-
-
-
- The instruction does not work correctly on 32-bit LFS system
- at now.
-
-
@@ -147,4 +163,22 @@
+ If you are running a 32-bit LFS, prepare a 64-bit compiler:
+
+
+case $(uname -m) in i?86 )
+ tar xf ../gcc-11.2.0.tar.xz
+ mkdir gcc-11.2.0/build
+ pushd gcc-11.2.0/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:
@@ -156,5 +190,7 @@
--enable-grub-mkfont \
--with-platform=efi \
+ --target=x86_64 \
--disable-werror &&
+unset TARGET_CC &&
make
@@ -200,8 +236,16 @@
- : Some x86_64 systems have 32-bit UEFI
- implementation, but they are very old and rare.
- Do not use this option unless you are
- absolutely sure that LFS is running on such a system.
+ --target=x86_64: Ensures building GRUB for
+ x86_64 even if building on a 32-bit LFS system. Most EFI firmwares
+ 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.