Skip to content

Commit

Permalink
OvmfPkg, ArmVirtPkg: Fix unable to build OVMF with -D NETWORK_ENABLE=0
Browse files Browse the repository at this point in the history
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']

The same problem applies in ArmVirtPkg.

Additionally, the commit before this one causes the same
problem in various other Ovmf packages, because it fixes
the issue that these where incorrectly including some
network packages when most were disabled. Now they do not.

This commit resolves these issues.

Signed-off-by: Mike Beaton <[email protected]>
  • Loading branch information
mikebeaton committed Aug 22, 2024
1 parent f4e8c3a commit 994132b
Show file tree
Hide file tree
Showing 10 changed files with 19 additions and 1 deletion.
2 changes: 2 additions & 0 deletions ArmVirtPkg/ArmVirtQemu.dsc
Original file line number Diff line number Diff line change
Expand Up @@ -299,11 +299,13 @@
gEfiMdeModulePkgTokenSpaceGuid.PcdSmbiosDocRev|0x0
gUefiOvmfPkgTokenSpaceGuid.PcdQemuSmbiosValidated|FALSE

!if $(NETWORK_ENABLE) == TRUE
#
# IPv4 and IPv6 PXE Boot support.
#
gEfiNetworkPkgTokenSpaceGuid.PcdIPv4PXESupport|0x01
gEfiNetworkPkgTokenSpaceGuid.PcdIPv6PXESupport|0x01
!endif

#
# TPM2 support
Expand Down
2 changes: 2 additions & 0 deletions ArmVirtPkg/ArmVirtQemuKernel.dsc
Original file line number Diff line number Diff line change
Expand Up @@ -260,11 +260,13 @@
gEfiMdeModulePkgTokenSpaceGuid.PcdSmbiosDocRev|0x0
gUefiOvmfPkgTokenSpaceGuid.PcdQemuSmbiosValidated|FALSE

!if $(NETWORK_ENABLE) == TRUE
#
# IPv4 and IPv6 PXE Boot support.
#
gEfiNetworkPkgTokenSpaceGuid.PcdIPv4PXESupport|0x01
gEfiNetworkPkgTokenSpaceGuid.PcdIPv6PXESupport|0x01
!endif

################################################################################
#
Expand Down
2 changes: 1 addition & 1 deletion NetworkPkg/NetworkPcds.dsc.inc
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@
#
##

!if $(NETWORK_ALLOW_HTTP_CONNECTIONS) == TRUE
!if ($(NETWORK_ENABLE) == TRUE) AND ($(NETWORK_ALLOW_HTTP_CONNECTIONS) == TRUE)
gEfiNetworkPkgTokenSpaceGuid.PcdAllowHttpConnections|TRUE
!endif
2 changes: 2 additions & 0 deletions OvmfPkg/CloudHv/CloudHvX64.dsc
Original file line number Diff line number Diff line change
Expand Up @@ -632,9 +632,11 @@

!include OvmfPkg/Include/Dsc/OvmfTpmPcds.dsc.inc

!if $(NETWORK_ENABLE) == TRUE
# IPv4 and IPv6 PXE Boot support.
gEfiNetworkPkgTokenSpaceGuid.PcdIPv4PXESupport|0x01
gEfiNetworkPkgTokenSpaceGuid.PcdIPv6PXESupport|0x01
!endif

# Set ConfidentialComputing defaults
gEfiMdePkgTokenSpaceGuid.PcdConfidentialComputingGuestAttr|0
Expand Down
2 changes: 2 additions & 0 deletions OvmfPkg/LoongArchVirt/LoongArchVirtQemu.dsc
Original file line number Diff line number Diff line change
Expand Up @@ -417,8 +417,10 @@
#
# IPv4 and IPv6 PXE Boot support.
#
!if $(NETWORK_ENABLE) == TRUE
gEfiNetworkPkgTokenSpaceGuid.PcdIPv4PXESupport | 0x01
gEfiNetworkPkgTokenSpaceGuid.PcdIPv6PXESupport | 0x01
!endif

#
# SMBIOS entry point version
Expand Down
2 changes: 2 additions & 0 deletions OvmfPkg/Microvm/MicrovmX64.dsc
Original file line number Diff line number Diff line change
Expand Up @@ -647,9 +647,11 @@

gEfiSecurityPkgTokenSpaceGuid.PcdOptionRomImageVerificationPolicy|0x00

!if $(NETWORK_ENABLE) == TRUE
# IPv4 and IPv6 PXE Boot support.
gEfiNetworkPkgTokenSpaceGuid.PcdIPv4PXESupport|0x01
gEfiNetworkPkgTokenSpaceGuid.PcdIPv6PXESupport|0x01
!endif

# Set ConfidentialComputing defaults
gEfiMdePkgTokenSpaceGuid.PcdConfidentialComputingGuestAttr|0
Expand Down
2 changes: 2 additions & 0 deletions OvmfPkg/OvmfPkgIa32.dsc
Original file line number Diff line number Diff line change
Expand Up @@ -658,9 +658,11 @@

!include OvmfPkg/Include/Dsc/OvmfTpmPcds.dsc.inc

!if $(NETWORK_ENABLE) == TRUE
# IPv4 and IPv6 PXE Boot support.
gEfiNetworkPkgTokenSpaceGuid.PcdIPv4PXESupport|0x01
gEfiNetworkPkgTokenSpaceGuid.PcdIPv6PXESupport|0x01
!endif

# Set ConfidentialComputing defaults
gEfiMdePkgTokenSpaceGuid.PcdConfidentialComputingGuestAttr|0
Expand Down
2 changes: 2 additions & 0 deletions OvmfPkg/OvmfPkgIa32X64.dsc
Original file line number Diff line number Diff line change
Expand Up @@ -676,9 +676,11 @@
gEfiMdePkgTokenSpaceGuid.PcdFSBClock|1000000000

[PcdsDynamicDefault.X64]
!if $(NETWORK_ENABLE) == TRUE
# IPv4 and IPv6 PXE Boot support.
gEfiNetworkPkgTokenSpaceGuid.PcdIPv4PXESupport|0x01
gEfiNetworkPkgTokenSpaceGuid.PcdIPv6PXESupport|0x01
!endif

[PcdsDynamicHii]
!include OvmfPkg/Include/Dsc/OvmfTpmPcdsHii.dsc.inc
Expand Down
2 changes: 2 additions & 0 deletions OvmfPkg/OvmfPkgX64.dsc
Original file line number Diff line number Diff line change
Expand Up @@ -690,9 +690,11 @@

!include OvmfPkg/Include/Dsc/OvmfTpmPcds.dsc.inc

!if $(NETWORK_ENABLE) == TRUE
# IPv4 and IPv6 PXE Boot support.
gEfiNetworkPkgTokenSpaceGuid.PcdIPv4PXESupport|0x01
gEfiNetworkPkgTokenSpaceGuid.PcdIPv6PXESupport|0x01
!endif

# Set ConfidentialComputing defaults
gEfiMdePkgTokenSpaceGuid.PcdConfidentialComputingGuestAttr|0
Expand Down
2 changes: 2 additions & 0 deletions OvmfPkg/RiscVVirt/RiscVVirtQemu.dsc
Original file line number Diff line number Diff line change
Expand Up @@ -217,11 +217,13 @@
gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingBase|0
gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareBase|0

!if $(NETWORK_ENABLE) == TRUE
#
# IPv4 and IPv6 PXE Boot support.
#
gEfiNetworkPkgTokenSpaceGuid.PcdIPv4PXESupport|0x01
gEfiNetworkPkgTokenSpaceGuid.PcdIPv6PXESupport|0x01
!endif

#
# TPM2 support
Expand Down

0 comments on commit 994132b

Please sign in to comment.