From 1d8d64b17b0d192f1a5211475f036094e37d4737 Mon Sep 17 00:00:00 2001 From: Mike Beaton Date: Sat, 24 Aug 2024 09:25:09 +0100 Subject: [PATCH] ArmVirtPkg: Fix unable to build with -D NETWORK_ENABLE=0 https://bugzilla.tianocore.org/show_bug.cgi?id=4829 7f17a15 (2024/02/22) "OvmfPkg: Shell*.inc: allow building without network support" breaks building OVMF with `-D NETWORK_ENABLE=0`. Before this commit we could build OVMF e.g. with the following command in the OvmfPkg directory: ./build.sh -D NETWORK_ENABLE=0 After the commit the same command fails early with: /home/user/OpenSource/edk2/OvmfPkg/OvmfPkgX64.dsc(15): error F001: Pcd (gEfiNetworkPkgTokenSpaceGuid.PcdAllowHttpConnections) defined in DSC is not declared in DEC files referenced in INF files in FDF. Arch: ['X64'] This problem also applies in the ArmVirtPkg platforms which are modified here, but is currently masked by another issue, namely that these platforms incorrectly still include some network packages when most are disabled. (A fix for this was previously applied, for OvmfPkg Intel platforms only, by d933ec1 followed by 7f17a15 .) This commit was created at the same time as the commits resolving this issue in NetworkPkg and OvmfPkg. It makes conditional the Pcd references in ArmVirtPkg platforms which will become references to undefined Pcds as and when the other issue mentioned above is fixed. Signed-off-by: Mike Beaton --- ArmVirtPkg/ArmVirtQemu.dsc | 2 ++ ArmVirtPkg/ArmVirtQemuKernel.dsc | 2 ++ 2 files changed, 4 insertions(+) diff --git a/ArmVirtPkg/ArmVirtQemu.dsc b/ArmVirtPkg/ArmVirtQemu.dsc index 0b3cbfbadd..10a1fd58c6 100644 --- a/ArmVirtPkg/ArmVirtQemu.dsc +++ b/ArmVirtPkg/ArmVirtQemu.dsc @@ -292,11 +292,13 @@ gEfiMdeModulePkgTokenSpaceGuid.PcdSmbiosDocRev|0x0 gUefiOvmfPkgTokenSpaceGuid.PcdQemuSmbiosValidated|FALSE +!if $(NETWORK_ENABLE) == TRUE # # IPv4 and IPv6 PXE Boot support. # gEfiNetworkPkgTokenSpaceGuid.PcdIPv4PXESupport|0x01 gEfiNetworkPkgTokenSpaceGuid.PcdIPv6PXESupport|0x01 +!endif # whether to use HVC or SMC to issue monitor calls - this typically depends # on the exception level at which the UEFI system firmware executes diff --git a/ArmVirtPkg/ArmVirtQemuKernel.dsc b/ArmVirtPkg/ArmVirtQemuKernel.dsc index 5a40ff334f..98a11a2872 100644 --- a/ArmVirtPkg/ArmVirtQemuKernel.dsc +++ b/ArmVirtPkg/ArmVirtQemuKernel.dsc @@ -257,11 +257,13 @@ gEfiMdeModulePkgTokenSpaceGuid.PcdSmbiosDocRev|0x0 gUefiOvmfPkgTokenSpaceGuid.PcdQemuSmbiosValidated|FALSE +!if $(NETWORK_ENABLE) == TRUE # # IPv4 and IPv6 PXE Boot support. # gEfiNetworkPkgTokenSpaceGuid.PcdIPv4PXESupport|0x01 gEfiNetworkPkgTokenSpaceGuid.PcdIPv6PXESupport|0x01 +!endif ################################################################################ #