]> git.proxmox.com Git - efi-boot-shim.git/commit
Fetch the netboot image from the same device
authorGary Ching-Pang Lin <glin@suse.com>
Tue, 27 May 2014 06:12:32 +0000 (14:12 +0800)
committerPeter Jones <pjones@redhat.com>
Wed, 25 Jun 2014 13:53:23 +0000 (09:53 -0400)
commitf500a8742c19be604d33907b56ab9597fe448b65
treecaf5413f6e742f65733958d7b509cecadd700ff5
parent0ba09477afac58ef2eadc7311440e695e6250029
Fetch the netboot image from the same device

The previous strategy is to locate the first available PXE_BASE_CODE
protocol and to fetch the second stage image from it, and this may
cause shim to fetch the wrong second stage image, i.e. grub.efi.

Consider the machine with the following boot order:
1. PXE Boot
2. Hard Drive

Assume that the EFI image, e.g. bootx64.efi, in the PXE server is
broken, then "PXE Boot" will fail and fallback to "Hard Drive". While
shim.efi in "Hard Drive" is loaded, it will find the PXE protocol is
available and fetch grub.efi from the PXE server, not grub.efi in the
disk.

This commit checks the DeviceHandle from Loaded Image. If the device
supports PXE, then shim fetches grub.efi with the PXE protocol. Otherwise,
shim loads grub.efi from the disk.

Signed-off-by: Gary Ching-Pang Lin <glin@suse.com>
netboot.c
shim.c