diff options
-rw-r--r-- | OvmfPkg/Library/PxeBcPcdProducerLib/PxeBcPcd.c | 39 | ||||
-rw-r--r-- | OvmfPkg/Library/PxeBcPcdProducerLib/PxeBcPcdProducerLib.inf | 33 | ||||
-rw-r--r-- | OvmfPkg/OvmfPkgIa32.dsc | 9 | ||||
-rw-r--r-- | OvmfPkg/OvmfPkgIa32X64.dsc | 10 | ||||
-rw-r--r-- | OvmfPkg/OvmfPkgX64.dsc | 9 |
5 files changed, 100 insertions, 0 deletions
diff --git a/OvmfPkg/Library/PxeBcPcdProducerLib/PxeBcPcd.c b/OvmfPkg/Library/PxeBcPcdProducerLib/PxeBcPcd.c new file mode 100644 index 0000000000..7ce236326f --- /dev/null +++ b/OvmfPkg/Library/PxeBcPcdProducerLib/PxeBcPcd.c @@ -0,0 +1,39 @@ +/** @file
+ Configure some PCDs dynamically for
+ "NetworkPkg/UefiPxeBcDxe/UefiPxeBcDxe.inf", from QEMU's fw_cfg.
+
+ Copyright (C) 2020, Red Hat, Inc.
+
+ SPDX-License-Identifier: BSD-2-Clause-Patent
+**/
+
+#include <Library/PcdLib.h>
+#include <Library/QemuFwCfgSimpleParserLib.h>
+
+RETURN_STATUS
+EFIAPI
+SetPxeBcPcds (
+ VOID
+ )
+{
+ BOOLEAN FwCfgBool;
+ RETURN_STATUS PcdStatus;
+
+ if (!RETURN_ERROR (QemuFwCfgParseBool ("opt/org.tianocore/IPv4PXESupport",
+ &FwCfgBool))) {
+ PcdStatus = PcdSet8S (PcdIPv4PXESupport, FwCfgBool);
+ if (RETURN_ERROR (PcdStatus)) {
+ return PcdStatus;
+ }
+ }
+
+ if (!RETURN_ERROR (QemuFwCfgParseBool ("opt/org.tianocore/IPv6PXESupport",
+ &FwCfgBool))) {
+ PcdStatus = PcdSet8S (PcdIPv6PXESupport, FwCfgBool);
+ if (RETURN_ERROR (PcdStatus)) {
+ return PcdStatus;
+ }
+ }
+
+ return RETURN_SUCCESS;
+}
diff --git a/OvmfPkg/Library/PxeBcPcdProducerLib/PxeBcPcdProducerLib.inf b/OvmfPkg/Library/PxeBcPcdProducerLib/PxeBcPcdProducerLib.inf new file mode 100644 index 0000000000..9481332281 --- /dev/null +++ b/OvmfPkg/Library/PxeBcPcdProducerLib/PxeBcPcdProducerLib.inf @@ -0,0 +1,33 @@ +## @file
+# Configure some PCDs dynamically for
+# "NetworkPkg/UefiPxeBcDxe/UefiPxeBcDxe.inf", from QEMU's fw_cfg.
+#
+# Copyright (C) 2020, Red Hat, Inc.
+#
+# SPDX-License-Identifier: BSD-2-Clause-Patent
+##
+
+[Defines]
+ INF_VERSION = 1.29
+ BASE_NAME = PxeBcPcdProducerLib
+ FILE_GUID = 1da2723f-52df-432a-8d03-6e8fa8acc107
+ MODULE_TYPE = BASE
+ VERSION_STRING = 1.0
+ LIBRARY_CLASS = NULL
+ CONSTRUCTOR = SetPxeBcPcds
+
+[Sources]
+ PxeBcPcd.c
+
+[Packages]
+ MdePkg/MdePkg.dec
+ NetworkPkg/NetworkPkg.dec
+ OvmfPkg/OvmfPkg.dec
+
+[LibraryClasses]
+ PcdLib
+ QemuFwCfgSimpleParserLib
+
+[Pcd]
+ gEfiNetworkPkgTokenSpaceGuid.PcdIPv4PXESupport ## SOMETIMES_PRODUCES
+ gEfiNetworkPkgTokenSpaceGuid.PcdIPv6PXESupport ## SOMETIMES_PRODUCES
diff --git a/OvmfPkg/OvmfPkgIa32.dsc b/OvmfPkg/OvmfPkgIa32.dsc index 5e29720631..fcd9779b5b 100644 --- a/OvmfPkg/OvmfPkgIa32.dsc +++ b/OvmfPkg/OvmfPkgIa32.dsc @@ -605,6 +605,10 @@ gEfiSecurityPkgTokenSpaceGuid.PcdTpmInstanceGuid|{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}
!endif
+ # IPv4 and IPv6 PXE Boot support.
+ gEfiNetworkPkgTokenSpaceGuid.PcdIPv4PXESupport|0x01
+ gEfiNetworkPkgTokenSpaceGuid.PcdIPv6PXESupport|0x01
+
[PcdsDynamicHii]
!if $(TPM_ENABLE) == TRUE && $(TPM_CONFIG_ENABLE) == TRUE
gEfiSecurityPkgTokenSpaceGuid.PcdTcgPhysicalPresenceInterfaceVer|L"TCG2_VERSION"|gTcg2ConfigFormSetGuid|0x0|"1.3"|NV,BS
@@ -822,6 +826,11 @@ #
!include NetworkPkg/NetworkComponents.dsc.inc
+ NetworkPkg/UefiPxeBcDxe/UefiPxeBcDxe.inf {
+ <LibraryClasses>
+ NULL|OvmfPkg/Library/PxeBcPcdProducerLib/PxeBcPcdProducerLib.inf
+ }
+
!if $(NETWORK_TLS_ENABLE) == TRUE
NetworkPkg/TlsAuthConfigDxe/TlsAuthConfigDxe.inf {
<LibraryClasses>
diff --git a/OvmfPkg/OvmfPkgIa32X64.dsc b/OvmfPkg/OvmfPkgIa32X64.dsc index 18e6909a33..1626d2415a 100644 --- a/OvmfPkg/OvmfPkgIa32X64.dsc +++ b/OvmfPkg/OvmfPkgIa32X64.dsc @@ -616,6 +616,11 @@ gEfiSecurityPkgTokenSpaceGuid.PcdTpmInstanceGuid|{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}
!endif
+[PcdsDynamicDefault.X64]
+ # IPv4 and IPv6 PXE Boot support.
+ gEfiNetworkPkgTokenSpaceGuid.PcdIPv4PXESupport|0x01
+ gEfiNetworkPkgTokenSpaceGuid.PcdIPv6PXESupport|0x01
+
[PcdsDynamicHii]
!if $(TPM_ENABLE) == TRUE && $(TPM_CONFIG_ENABLE) == TRUE
gEfiSecurityPkgTokenSpaceGuid.PcdTcgPhysicalPresenceInterfaceVer|L"TCG2_VERSION"|gTcg2ConfigFormSetGuid|0x0|"1.3"|NV,BS
@@ -834,6 +839,11 @@ #
!include NetworkPkg/NetworkComponents.dsc.inc
+ NetworkPkg/UefiPxeBcDxe/UefiPxeBcDxe.inf {
+ <LibraryClasses>
+ NULL|OvmfPkg/Library/PxeBcPcdProducerLib/PxeBcPcdProducerLib.inf
+ }
+
!if $(NETWORK_TLS_ENABLE) == TRUE
NetworkPkg/TlsAuthConfigDxe/TlsAuthConfigDxe.inf {
<LibraryClasses>
diff --git a/OvmfPkg/OvmfPkgX64.dsc b/OvmfPkg/OvmfPkgX64.dsc index 3d24cc4c1c..65cfe95776 100644 --- a/OvmfPkg/OvmfPkgX64.dsc +++ b/OvmfPkg/OvmfPkgX64.dsc @@ -615,6 +615,10 @@ gEfiSecurityPkgTokenSpaceGuid.PcdTpmInstanceGuid|{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}
!endif
+ # IPv4 and IPv6 PXE Boot support.
+ gEfiNetworkPkgTokenSpaceGuid.PcdIPv4PXESupport|0x01
+ gEfiNetworkPkgTokenSpaceGuid.PcdIPv6PXESupport|0x01
+
[PcdsDynamicHii]
!if $(TPM_ENABLE) == TRUE && $(TPM_CONFIG_ENABLE) == TRUE
gEfiSecurityPkgTokenSpaceGuid.PcdTcgPhysicalPresenceInterfaceVer|L"TCG2_VERSION"|gTcg2ConfigFormSetGuid|0x0|"1.3"|NV,BS
@@ -832,6 +836,11 @@ #
!include NetworkPkg/NetworkComponents.dsc.inc
+ NetworkPkg/UefiPxeBcDxe/UefiPxeBcDxe.inf {
+ <LibraryClasses>
+ NULL|OvmfPkg/Library/PxeBcPcdProducerLib/PxeBcPcdProducerLib.inf
+ }
+
!if $(NETWORK_TLS_ENABLE) == TRUE
NetworkPkg/TlsAuthConfigDxe/TlsAuthConfigDxe.inf {
<LibraryClasses>
|