• A
    efi_loader: bootmgr: fix a problem in loading an image from a short-path · 57ad6241
    AKASHI Takahiro 提交于
    Booting from a short-form device path which starts with the first element
    being a File Path Media Device Path failed because it doesn't contain
    any valid device with simple file system protocol and efi_dp_find_obj()
    in efi_load_image_from_path() will return NULL.
    For instance,
    /VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b)/Scsi(0,0)/\helloworld.efi
    -> shortened version: /\helloworld.efi
    
    With this patch applied, all the media devices with simple file system
    protocol are enumerated and the boot manager attempts to boot temporarily
    generated device paths one-by-one.
    
    This new implementation is still a bit incompatible with the UEFI
    specification in terms of:
    * not creating real boot options
    * not try
      "If a device does not support the EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, but
      supports the EFI_BLOCK_IO_PROTOCOL protocol, then the EFI Boot Service
      ConnectController must be called for this device with DriverImageHandle
      and RemainingDevicePath set to NULL and the Recursive flag is set to TRUE."
    (See section 3.1.2 "Load Option Processing".)
    
    But it still gives us a closer and better solution than the current.
    
    Fixes: commit 9cdf4702 ("efi_loader: support booting via short-form device-path")
    Signed-off-by: NAKASHI Takahiro <takahiro.akashi@linaro.org>
    Reviewed-by: NHeinrich Schuchardt <heinrich.schuchardt@canonical.com>
    57ad6241
efi_bootmgr.c 8.7 KB