Skip to content

efi: Eliminate globals from the `peimage.c` chainloader

Mate Kukri requested to merge peimage-refactor into master

This changes peimage.c such that, it:

  • Asks UEFI to allocate a new handle for the chainloaded image
  • Installs new EFI_LOADED_IMAGE_PROTOCOL and EFI_LOADED_IMAGE_DEVICE_PATH protocol instances on the new handle
  • Associates the "image_info" struct with the handle by the use of new guid GRUB_PEIMAGE_MARKER_GUID
  • (Un)Installs the BootServices.Exit() hook at module load/unload time. Make said hook locate our internal info structure by way of GUID lookup instead of a global variable.

Merge request reports

Loading