opengnsys_ipxe/src
Michael Brown 09e8a15408 [efi] Claim fixed device paths by uninstalling device path protocol
As documented in commits 6a004be ("[efi] Support the initrd
autodetection mechanism in newer Linux kernels") and 04e60a2 ("[efi]
Omit EFI_LOAD_FILE2_PROTOCOL for a zero-length initrd"), the choice in
Linux of using a fixed device path requires bootloaders to allow for
the fact that a previous bootloader may have already installed a
handle with the fixed device path.

We currently deal with this situation by reusing the existing handle,
replacing the EFI_LOAD_FILE2_PROTOCOL instance with our own.  Simplify
the code by instead uninstalling the EFI_DEVICE_PATH_PROTOCOL instance
from the existing handle (if present), thereby allowing the creation
of a new handle to succeed.

Create the new handle only if we have a non-empty initrd to provide.
This works around bugs in bootloaders such as the systemd EFI stub
that fail to allow for the existence of multiple-bootloader chains.
(The workaround is not comprehensive: if the user has downloaded other
images in iPXE before invoking the systemd Unified Kernel Image (UKI),
then the systemd EFI stub will still crash and burn since it fails to
allow for the fact that a previous bootloader has already installed a
handle with the fixed device path.)

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2023-03-15 16:48:35 +00:00
..
arch [image] Always unregister currently executing image 2023-03-07 12:22:19 +00:00
bin Rename .cvsignore files to .gitignore 2007-06-09 22:57:00 +01:00
config [params] Rename "form parameter" to "request parameter" 2023-03-01 11:55:04 +00:00
core [image] Always unregister currently executing image 2023-03-07 12:22:19 +00:00
crypto [rng] Allow for entropy sources that fail during startup tests 2023-02-20 14:53:10 +00:00
doc [build] Rename gPXE to iPXE 2010-04-19 23:43:39 +01:00
drivers [intel] Add workaround for I210 reset hardware bugs 2023-03-14 14:44:32 +00:00
hci [params] Allow for arbitrary HTTP request headers to be specified 2023-03-01 12:20:02 +00:00
image [efi] Use image name instead of pointer value in debug messages 2023-03-07 14:18:00 +00:00
include [params] Allow for arbitrary HTTP request headers to be specified 2023-03-01 12:20:02 +00:00
interface [efi] Claim fixed device paths by uninstalling device path protocol 2023-03-15 16:48:35 +00:00
libgcc [libgcc] Change __divmoddi4 from int64 [unknown] to int64_t 2020-07-21 14:33:32 +01:00
net [dhcp] Unregister ProxyDHCP and PXEBS settings on a successful DHCPACK 2023-03-14 11:35:30 +00:00
scripts [arm] Inhibit linker warnings about an implied executable stack 2023-01-23 12:55:44 +00:00
tests [params] Allow for arbitrary HTTP request headers to be specified 2023-03-01 12:20:02 +00:00
usr [pxe] Avoid drawing menu items on bottom row of screen 2023-01-23 20:30:59 +00:00
util [util] Add support for LoongArch64 binaries 2023-02-03 12:44:11 +00:00
.gitignore [build] Add support for local configuration files 2010-03-26 19:07:22 +00:00
Makefile [build] Avoid invoking genkeymap.py via Perl 2022-02-15 13:54:28 +00:00
Makefile.efi [efi] Use zero for PCI vendor/device IDs when no applicable ID exists 2021-07-26 15:47:47 +01:00
Makefile.housekeeping [dhcp] Simplify platform-specific client architecture definitions 2023-01-22 17:45:34 +00:00
Makefile.linux [linux] Centralise the linker script for Linux binaries 2023-01-22 12:38:03 +00:00
doxygen.cfg [build] Remove PACKED macro 2010-05-29 23:49:47 +01:00