summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCorvin Köhne <c.koehne@beckhoff.com>2021-08-16 15:54:38 +0200
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2024-06-18 19:18:07 +0000
commitffce430d2b65d508a1604dc986ba16db3583943d (patch)
tree72ae35f8d055e05bd8bc7cdb69dc4af469174906
parentbfda27ddc89502190c79f74fc20cb81458d58449 (diff)
downloadedk2-ffce430d2b65d508a1604dc986ba16db3583943d.zip
edk2-ffce430d2b65d508a1604dc986ba16db3583943d.tar.gz
edk2-ffce430d2b65d508a1604dc986ba16db3583943d.tar.bz2
OvmfPkg/BhyvePkg: honor FwCfg when setting the bootorder
Bhyve has added support for the bootorder FwCfg file some time ago [1][2]. This FwCfg file is currently ignored by the OVMF and has no effect. Copy the relevant code from Qemu to Bhyve to make it usable. [1] https://github.com/freebsd/freebsd-src/commit/6632a0a4e3ab68b0e31b612e8aeca14de3fc8159 [2] https://github.com/freebsd/freebsd-src/commit/480bef9481f0c44b19ac4b2adb09f6c3191acd41 Signed-off-by: Corvin Köhne <c.koehne@beckhoff.com>
-rw-r--r--OvmfPkg/Bhyve/BhyveX64.dsc1
-rw-r--r--OvmfPkg/Library/PlatformBootManagerLibBhyve/BdsPlatform.c17
-rw-r--r--OvmfPkg/Library/PlatformBootManagerLibBhyve/PlatformBootManagerLibBhyve.inf1
3 files changed, 13 insertions, 6 deletions
diff --git a/OvmfPkg/Bhyve/BhyveX64.dsc b/OvmfPkg/Bhyve/BhyveX64.dsc
index 7805095..0689d64 100644
--- a/OvmfPkg/Bhyve/BhyveX64.dsc
+++ b/OvmfPkg/Bhyve/BhyveX64.dsc
@@ -358,6 +358,7 @@
!endif
PlatformBootManagerLib|OvmfPkg/Library/PlatformBootManagerLibBhyve/PlatformBootManagerLibBhyve.inf
PlatformBmPrintScLib|OvmfPkg/Library/PlatformBmPrintScLib/PlatformBmPrintScLib.inf
+ QemuBootOrderLib|OvmfPkg/Library/QemuBootOrderLib/QemuBootOrderLib.inf
CpuExceptionHandlerLib|UefiCpuPkg/Library/CpuExceptionHandlerLib/DxeCpuExceptionHandlerLib.inf
LockBoxLib|OvmfPkg/Library/LockBoxLib/LockBoxDxeLib.inf
!if $(SOURCE_DEBUG_ENABLE) == TRUE
diff --git a/OvmfPkg/Library/PlatformBootManagerLibBhyve/BdsPlatform.c b/OvmfPkg/Library/PlatformBootManagerLibBhyve/BdsPlatform.c
index ac9c02c..4489eaa 100644
--- a/OvmfPkg/Library/PlatformBootManagerLibBhyve/BdsPlatform.c
+++ b/OvmfPkg/Library/PlatformBootManagerLibBhyve/BdsPlatform.c
@@ -1433,7 +1433,8 @@ PlatformBdsConnectSequence (
VOID
)
{
- UINTN Index;
+ UINTN Index;
+ RETURN_STATUS Status;
DEBUG ((DEBUG_INFO, "PlatformBdsConnectSequence\n"));
@@ -1452,11 +1453,14 @@ PlatformBdsConnectSequence (
Index++;
}
- //
- // Just use the simple policy to connect all devices
- //
- DEBUG ((DEBUG_INFO, "EfiBootManagerConnectAll\n"));
- EfiBootManagerConnectAll ();
+ Status = ConnectDevicesFromQemu ();
+ if (RETURN_ERROR (Status)) {
+ //
+ // Just use the simple policy to connect all devices
+ //
+ DEBUG ((DEBUG_INFO, "EfiBootManagerConnectAll\n"));
+ EfiBootManagerConnectAll ();
+ }
}
/**
@@ -1581,6 +1585,7 @@ PlatformBootManagerAfterConsole (
);
RemoveStaleFvFileOptions ();
+ SetBootOrderFromQemu ();
PlatformBmPrintScRegisterHandler ();
}
diff --git a/OvmfPkg/Library/PlatformBootManagerLibBhyve/PlatformBootManagerLibBhyve.inf b/OvmfPkg/Library/PlatformBootManagerLibBhyve/PlatformBootManagerLibBhyve.inf
index c1fb511..abfe4f9 100644
--- a/OvmfPkg/Library/PlatformBootManagerLibBhyve/PlatformBootManagerLibBhyve.inf
+++ b/OvmfPkg/Library/PlatformBootManagerLibBhyve/PlatformBootManagerLibBhyve.inf
@@ -46,6 +46,7 @@
BootLogoLib
DevicePathLib
PciLib
+ QemuBootOrderLib
NvVarsFileLib
ReportStatusCodeLib
UefiLib