VirtualBox

Changeset 82509 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Dec 9, 2019 12:12:17 PM (5 years ago)
Author:
vboxsync
Message:

EFI/Firmware/UefiBootManagerLib: Use the gVBoxFsBlessedFileInfoGuid information type to query the blessed file on HFS+ volumes instead of having the path hard coded

Location:
trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Library/UefiBootManagerLib
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c

    r80934 r82509  
    10071007  EFI_SIMPLE_FILE_SYSTEM_PROTOCOL     *pSFs  = NULL;
    10081008  EFI_FILE_PROTOCOL                   *pRoot = NULL;
    1009   EFI_FILE_PROTOCOL                   *pFile = NULL;
    10101009
    10111010  *ppwszFileName = EFI_REMOVABLE_MEDIA_FILE_NAME;
     
    10171016    if (!EFI_ERROR(Status))
    10181017    {
    1019       Status = pRoot->Open(pRoot, &pFile, VBOX_EFI_APPLE_MEDIA_FILE_NAME, EFI_FILE_MODE_READ,
    1020                            EFI_FILE_READ_ONLY | EFI_FILE_HIDDEN | EFI_FILE_SYSTEM);
    1021       if (!EFI_ERROR(Status))
    1022       {
    1023         *ppwszFileName = VBOX_EFI_APPLE_MEDIA_FILE_NAME;
    1024         pFile->Close(pFile);
     1018      VBOX_FS_BLESSED_FILE *Buffer = NULL;
     1019      UINTN BufferSize = 0;
     1020
     1021      Status = pRoot->GetInfo(pRoot, &gVBoxFsBlessedFileInfoGuid, &BufferSize, Buffer);
     1022      if (Status == EFI_BUFFER_TOO_SMALL) {
     1023        Buffer = AllocatePool (BufferSize);
     1024        ASSERT (Buffer != NULL);
     1025
     1026        /** @todo We might leak this allocation but it doesn't really matter as it
     1027         * is of type BootServicesData and will be reclaimed by the OS when it boots.
     1028         */
     1029        Status = pRoot->GetInfo(pRoot, &gVBoxFsBlessedFileInfoGuid, &BufferSize, Buffer);
     1030        if (!EFI_ERROR(Status))
     1031        {
     1032          DEBUG ((EFI_D_INFO, "[Bds] VBoxBmQueryMediaFileNameForSFs: Got blessed file info %s\n", &Buffer->BlessedFile[0]));
     1033          *ppwszFileName = &Buffer->BlessedFile[0];
     1034        }
    10251035      }
    10261036
  • trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Library/UefiBootManagerLib/InternalBm.h

    r80901 r82509  
    4848#include <Guid/StatusCodeDataTypeId.h>
    4949#include <Guid/StatusCodeDataTypeVariable.h>
     50#ifdef VBOX
     51#include <Guid/VBoxFsBlessedFileInfo.h>
     52#endif
    5053
    5154#include <Library/PrintLib.h>
     
    8285#endif
    8386
    84 #ifdef VBOX
    85 /* Support for booting Apple macOS. */
    86 # define VBOX_EFI_APPLE_MEDIA_FILE_NAME L"\\System\\Library\\CoreServices\\boot.efi"
    87 #endif
    88 
    8987typedef enum {
    9088  BmAcpiFloppyBoot,
  • trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Library/UefiBootManagerLib/UefiBootManagerLib.inf

    r80721 r82509  
    4141  MdePkg/MdePkg.dec
    4242  MdeModulePkg/MdeModulePkg.dec
     43  VBoxPkg/VBoxPkg.dec
    4344
    4445[LibraryClasses]
     
    8586  gEfiDiskInfoSdMmcInterfaceGuid                ## SOMETIMES_CONSUMES ## GUID
    8687
     88  gVBoxFsBlessedFileInfoGuid                    ## SOMETIMES_CONSUMES ## GUID
     89
    8790[Protocols]
    8891  gEfiPciRootBridgeIoProtocolGuid               ## CONSUMES
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette