[lfs-dev] grub-2.02~beta2

Dan McGhee beesnees at grm.net
Sun Oct 12 07:10:31 PDT 2014

On Oct 12, 2014, at 8:51 AM, Pierre Labastie <pierre.labastie at neuf.fr> wrote:

> I replaced the motherboard of my computer, which was dying. So now I have a
> new one with UEFI firmware, which prompted me to try to use it. Problem is,
> right now, I am only able to run in legacy mode.
> But what I have done, which may be relevant to this thread and testing
> instructions is to use a qemu VM with EFI firmware (just added -bios OVMF.fd
> to the command line options, I use Debian's qemu and oackage ovmf is
> installed). Then, I got to the point to be able to load grubXXX.efi, and to
> have it boot the kernel. So this is a good solution to testing instructions...
> Roughly, building grub-efi just amounts to add --with-target=efi to the book
> instructions, assuming:
> a) freetype2 is on the system (no need for fontconfig), then grub has been
> (re)built once to install grub-mkfont, and is now rebuilt with grub-mkfont
> installed.
> b) there is unifont.pcf in one of the subdirectories of /usr/share/fonts (can
> be downloaded from
> http://unifoundry.com/pub/unifont-7.0.03/font-builds/unifont-7.0.03.pcf.gz).
> unifont.pcf will be automagically translated to unicode.pf2 during the build.
> Assuming that your EFI partition is mounted at /boot/efi, the installation of
> grub is done with:
> grub-install --target=x86_64-efi --efi-directory=/boot/efi
> grub.cfg contains:
> set default=0
> set timeout=5
> insmod all_video
> insmod gfxterm
> # May be needed: insmod lvm
> loadfont unifont
> set gfxmode=1024x768
> set gfxpayload=keep
> terminal_output gfxterm
> [...usual menus...]
> EFIShell is built in OVMF.fd, so I used that for setting the boot ordre
Pierre, this is really, really helpful.  Thanks.

As soon as I can get all my computer things ironed out, I’ll be able to finish the hint.  It’s original goal was to do what you have done in a basic LFS system either rebuilding grub before Ch. 8 or waiting until just before Ch.8 to build it.  There are a about five packages that need to be built and installed at that time, but it’s doable.

May I include what you have done in the hint for those that use virtualization?

Many thanks again.

More information about the lfs-dev mailing list