summaryrefslogtreecommitdiff
path: root/src/VBox/Devices/EFI/Firmware
diff options
context:
space:
mode:
authorvboxsync <vboxsync@cfe28804-0f27-0410-a406-dd0f0b0b656f>2019-12-09 12:10:54 +0000
committervboxsync <vboxsync@cfe28804-0f27-0410-a406-dd0f0b0b656f>2019-12-09 12:10:54 +0000
commitac056b60dc2957b266ae06f5cc7d041762cfc3a3 (patch)
treed7369dfaf4cd9385b3460ce253863ec5bf747634 /src/VBox/Devices/EFI/Firmware
parent457794bed59cbaa3b650899356784e258a7d96f2 (diff)
downloadVirtualBox-svn-ac056b60dc2957b266ae06f5cc7d041762cfc3a3.tar.gz
EFI/Firmware/VBoxPkg: Add new GUID to retrieve the blessed file from HFS+ volumes through GetInfo()
git-svn-id: https://www.virtualbox.org/svn/vbox/trunk@82508 cfe28804-0f27-0410-a406-dd0f0b0b656f
Diffstat (limited to 'src/VBox/Devices/EFI/Firmware')
-rw-r--r--src/VBox/Devices/EFI/Firmware/VBoxPkg/VBoxFsDxe/VBoxFswParam.h2
-rw-r--r--src/VBox/Devices/EFI/Firmware/VBoxPkg/VBoxFsDxe/VBoxHfs.inf1
-rw-r--r--src/VBox/Devices/EFI/Firmware/VBoxPkg/VBoxFsDxe/fsw_efi.c32
-rw-r--r--src/VBox/Devices/EFI/Firmware/VBoxPkg/VBoxPkg.dec1
4 files changed, 36 insertions, 0 deletions
diff --git a/src/VBox/Devices/EFI/Firmware/VBoxPkg/VBoxFsDxe/VBoxFswParam.h b/src/VBox/Devices/EFI/Firmware/VBoxPkg/VBoxFsDxe/VBoxFswParam.h
index cec1c0d27f1..a700f0229ca 100644
--- a/src/VBox/Devices/EFI/Firmware/VBoxPkg/VBoxFsDxe/VBoxFswParam.h
+++ b/src/VBox/Devices/EFI/Firmware/VBoxPkg/VBoxFsDxe/VBoxFswParam.h
@@ -53,6 +53,8 @@
# include <Guid/FileSystemVolumeLabelInfo.h>
# include <Protocol/ComponentName.h>
+# include <Guid/VBoxFsBlessedFileInfo.h> /* For HFS blessed file support. */
+
# define BS gBS
# define PROTO_NAME(x) gEfi ## x ## Guid
# define GUID_NAME(x) gEfi ## x ## Guid
diff --git a/src/VBox/Devices/EFI/Firmware/VBoxPkg/VBoxFsDxe/VBoxHfs.inf b/src/VBox/Devices/EFI/Firmware/VBoxPkg/VBoxFsDxe/VBoxHfs.inf
index e0500c829ec..32ed5823348 100644
--- a/src/VBox/Devices/EFI/Firmware/VBoxPkg/VBoxFsDxe/VBoxHfs.inf
+++ b/src/VBox/Devices/EFI/Firmware/VBoxPkg/VBoxFsDxe/VBoxHfs.inf
@@ -63,6 +63,7 @@
gEfiFileInfoGuid
gEfiFileSystemInfoGuid
gEfiFileSystemVolumeLabelInfoIdGuid
+ gVBoxFsBlessedFileInfoGuid
[Protocols]
gEfiDiskIoProtocolGuid
diff --git a/src/VBox/Devices/EFI/Firmware/VBoxPkg/VBoxFsDxe/fsw_efi.c b/src/VBox/Devices/EFI/Firmware/VBoxPkg/VBoxFsDxe/fsw_efi.c
index 5ebf0fa0b00..c2e89e1f2c5 100644
--- a/src/VBox/Devices/EFI/Firmware/VBoxPkg/VBoxFsDxe/fsw_efi.c
+++ b/src/VBox/Devices/EFI/Firmware/VBoxPkg/VBoxFsDxe/fsw_efi.c
@@ -136,6 +136,10 @@ EFI_STATUS fsw_efi_dnode_fill_FileInfo(IN FSW_VOLUME_DATA *Volume,
IN OUT UINTN *BufferSize,
OUT VOID *Buffer);
+#if defined(VBOX) && (FSTYPE == hfs)
+extern fsw_status_t fsw_hfs_get_blessed_file(void *vol, struct fsw_string *path);
+#endif
+
/**
* Interface structure for the EFI Driver Binding protocol.
*/
@@ -982,6 +986,34 @@ EFI_STATUS fsw_efi_dnode_getinfo(IN FSW_FILE_DATA *File,
*BufferSize = RequiredSize;
Status = EFI_SUCCESS;
+#ifdef VBOX
+ } else if (CompareGuid(InformationType, &gVBoxFsBlessedFileInfoGuid)) {
+
+# if FSTYPE == hfs
+ struct fsw_string StrBlessedFile;
+
+ fsw_status_t rc = fsw_hfs_get_blessed_file(Volume->vol, &StrBlessedFile);
+ if (!rc)
+ {
+ // check buffer size
+ RequiredSize = SIZE_OF_VBOX_FS_BLESSED_FILE + fsw_efi_strsize(&StrBlessedFile);
+ if (*BufferSize < RequiredSize) {
+ *BufferSize = RequiredSize;
+ return EFI_BUFFER_TOO_SMALL;
+ }
+
+ // copy volume label
+ fsw_efi_strcpy(((VBOX_FS_BLESSED_FILE *)Buffer)->BlessedFile, &StrBlessedFile);
+
+ // prepare for return
+ *BufferSize = RequiredSize;
+ Status = EFI_SUCCESS;
+ }
+ else
+# endif
+ Status = EFI_UNSUPPORTED;
+#endif
+
} else {
Status = EFI_UNSUPPORTED;
}
diff --git a/src/VBox/Devices/EFI/Firmware/VBoxPkg/VBoxPkg.dec b/src/VBox/Devices/EFI/Firmware/VBoxPkg/VBoxPkg.dec
index cc9ac203567..80f67913a3a 100644
--- a/src/VBox/Devices/EFI/Firmware/VBoxPkg/VBoxPkg.dec
+++ b/src/VBox/Devices/EFI/Firmware/VBoxPkg/VBoxPkg.dec
@@ -38,6 +38,7 @@
gEfiAcpiDescriptionGuid = {0x3c699197, 0x093c, 0x4c69, {0xb0, 0x6b, 0x12, 0x8a, 0xe3, 0x48, 0x1d, 0xc9 }}
# gEfiFlashMapHobGuid = { 0xb091e7d2, 0x5a0, 0x4198, {0x94, 0xf0, 0x74, 0xb7, 0xb8, 0xc5, 0x54, 0x59 }}
gVBoxVgaPkgTokenSpaceGuid = { 0xa3a8ce56, 0x4a07, 0x441f, {0xa3, 0xf5, 0x6f, 0x53, 0xdb, 0x9c, 0xb7, 0xd8}}
+ gVBoxFsBlessedFileInfoGuid = { 0xcc49fefd, 0x41b7, 0x473f, {0x98, 0x23, 0x0e, 0x8e, 0xbf, 0x35, 0x67, 0x7d } }
#
# Various types of Platform Configuration Database (PCD) items.