grub-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] efi: make sure EFI disk controllers are connected when, discover


From: Renaud Métrich
Subject: [PATCH] efi: make sure EFI disk controllers are connected when, discovering devices
Date: Tue, 1 Feb 2022 11:38:42 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.4.0

When efi.quickboot is enabled on VMWare (which is the default for hardware release 16 and later), it may happen that not all EFI devices are connected.

Due to this, browsing the devices in make_devices() just fails to find devices, in particular partitions for a given disk.
This typically happens when network booting, then trying to chainload to local disk (this is used in deployment tools such as Red Hat Satellite).

This patch makes sure all controllers are connected before enumerating the disks.

It blindly calls the EFI ConnectController function with recursive option and just ignores the result, which is 0 (EFI_SUCCESS) or 14 (EFI_NOT_FOUND) when the handle is not a controller.

Example of "grub.cfg" file used to chainload when system boots over the network:

~~~

menuentry 'Chainload Grub2 EFI from ESP' --id local {
  unset root
  search --file --no-floppy --efidisk-only --set=root /EFI/BOOT/BOOTX64.EFI
  if [ -f ($root)/EFI/BOOT/grubx64.efi ]; then
    chainloader ($root)/EFI/BOOT/grubx64.efi
  elif [ -f ($root)/EFI/redhat/shimx64.efi ]; then
    chainloader ($root)/EFI/redhat/shimx64.efi
  elif [ -f ($root)/EFI/redhat/grubx64.efi ]; then
    chainloader ($root)/EFI/redhat/grubx64.efi
  fi
}

~~~

This patch has been tested on QEMU/KVM systems (for non regression) and VMWare VMs (at hardware level 6.7 and 7.0u2, with and without quickboot for functionality testing).


Attachment: 0001-efi-make-sure-EFI-disk-controllers-are-connected-whe.patch
Description: Text Data

Attachment: OpenPGP_signature
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]