[PATCH 2/2] OvmfPkg/OvmfPkgX64: Allow runtime control of IPv4 and IPv6 support


Ard Biesheuvel
 

Wire up the newly added DriverLoadInhibitorLib in a way that ties
dispatch of the Ip4Dxe and Ip6Dxe drivers to QEMU fw_cfg variables
'opt/org.tianocore/IPv4Support' and 'opt/org.tianocore/IPv6Support'
respectively.

Setting both variables to 'n' disables IP based networking entirely,
without the need for additional code changes at the NIC driver or
network boot protocol level.

Signed-off-by: Ard Biesheuvel <ardb@...>
---
OvmfPkg/OvmfPkgX64.dsc | 14 ++++++++++++++
1 file changed, 14 insertions(+)

diff --git a/OvmfPkg/OvmfPkgX64.dsc b/OvmfPkg/OvmfPkgX64.dsc
index 6e68f60dc90f..0c0ded88f86e 100644
--- a/OvmfPkg/OvmfPkgX64.dsc
+++ b/OvmfPkg/OvmfPkgX64.dsc
@@ -947,6 +947,20 @@ [Components]
NULL|OvmfPkg/Library/PxeBcPcdProducerLib/PxeBcPcdProducerLib.inf=0D
}=0D
=0D
+ NetworkPkg/Ip4Dxe/Ip4Dxe.inf {=0D
+ <LibraryClasses>=0D
+ NULL|OvmfPkg/Library/DriverLoadInhibitorLib/DriverLoadInhibitorLib.i=
nf=0D
+ <PcdsFixedAtBuild>=0D
+ gUefiOvmfPkgTokenSpaceGuid.PcdDriverInhibitorFwCfgVarName|"opt/org.t=
ianocore/IPv4Support"=0D
+ }=0D
+=0D
+ NetworkPkg/Ip6Dxe/Ip6Dxe.inf {=0D
+ <LibraryClasses>=0D
+ NULL|OvmfPkg/Library/DriverLoadInhibitorLib/DriverLoadInhibitorLib.i=
nf=0D
+ <PcdsFixedAtBuild>=0D
+ gUefiOvmfPkgTokenSpaceGuid.PcdDriverInhibitorFwCfgVarName|"opt/org.t=
ianocore/IPv6Support"=0D
+ }=0D
+=0D
!if $(NETWORK_TLS_ENABLE) =3D=3D TRUE=0D
NetworkPkg/TlsAuthConfigDxe/TlsAuthConfigDxe.inf {=0D
<LibraryClasses>=0D
--=20
2.35.1

Join devel@edk2.groups.io to automatically receive all group messages.