]> git.proxmox.com Git - mirror_edk2.git/commitdiff
OvmfPkg: Allow runtime control of IPv4 and IPv6 support on QEMU
authorArd Biesheuvel <ardb@kernel.org>
Mon, 15 Aug 2022 09:17:12 +0000 (11:17 +0200)
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Sat, 10 Sep 2022 08:23:27 +0000 (08:23 +0000)
Wire up the newly added UefiDriverEntrypoint 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@kernel.org>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
OvmfPkg/NetworkComponents.dsc.inc

index 85a165391655ae2a49d53ffabfdfc9dd8a5093c1..713eec7dd1ce7a5633671e07f6ebc174c00f1265 100644 (file)
         NULL|OvmfPkg/Library/TlsAuthConfigLib/TlsAuthConfigLib.inf\r
     }\r
   !endif\r
+\r
+  !if $(NETWORK_IP4_ENABLE) == TRUE\r
+    NetworkPkg/Ip4Dxe/Ip4Dxe.inf {\r
+      <LibraryClasses>\r
+        UefiDriverEntryPoint|OvmfPkg/Library/UefiDriverEntryPointFwCfgOverrideLib/UefiDriverEntryPointFwCfgOverrideLib.inf\r
+      <PcdsFixedAtBuild>\r
+        gUefiOvmfPkgTokenSpaceGuid.PcdEntryPointOverrideFwCfgVarName|"opt/org.tianocore/IPv4Support"\r
+    }\r
+  !endif\r
+\r
+  !if $(NETWORK_IP6_ENABLE) == TRUE\r
+    NetworkPkg/Ip6Dxe/Ip6Dxe.inf {\r
+      <LibraryClasses>\r
+        UefiDriverEntryPoint|OvmfPkg/Library/UefiDriverEntryPointFwCfgOverrideLib/UefiDriverEntryPointFwCfgOverrideLib.inf\r
+      <PcdsFixedAtBuild>\r
+        gUefiOvmfPkgTokenSpaceGuid.PcdEntryPointOverrideFwCfgVarName|"opt/org.tianocore/IPv6Support"\r
+    }\r
+  !endif\r
 !endif\r