Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable additional network components when most are disabled, in all platforms in OvmfPkg and ArmVirtPkg #6092

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 10 additions & 42 deletions ArmVirtPkg/ArmVirt.dsc.inc
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@
#

[Defines]

#
# Shell can be useful for debugging but should not be enabled for production
#
DEFINE BUILD_SHELL = TRUE

DEFINE DEBUG_PRINT_ERROR_LEVEL = 0x8000004F

!if $(TARGET) != NOOPT
Expand Down Expand Up @@ -66,7 +72,9 @@
HiiLib|MdeModulePkg/Library/UefiHiiLib/UefiHiiLib.inf
UefiHiiServicesLib|MdeModulePkg/Library/UefiHiiServicesLib/UefiHiiServicesLib.inf
SortLib|MdeModulePkg/Library/UefiSortLib/UefiSortLib.inf
ShellLib|ShellPkg/Library/UefiShellLib/UefiShellLib.inf

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

ShellCEntryLib|ShellPkg/Library/UefiShellCEntryLib/UefiShellCEntryLib.inf
FileHandleLib|MdePkg/Library/UefiFileHandleLib/UefiFileHandleLib.inf

Expand Down Expand Up @@ -394,47 +402,7 @@
#
MdeModulePkg/Universal/Disk/RamDiskDxe/RamDiskDxe.inf

ShellPkg/DynamicCommand/TftpDynamicCommand/TftpDynamicCommand.inf {
<PcdsFixedAtBuild>
gEfiShellPkgTokenSpaceGuid.PcdShellLibAutoInitialize|FALSE
}
ShellPkg/DynamicCommand/HttpDynamicCommand/HttpDynamicCommand.inf {
<PcdsFixedAtBuild>
gEfiShellPkgTokenSpaceGuid.PcdShellLibAutoInitialize|FALSE
}
ShellPkg/DynamicCommand/VariablePolicyDynamicCommand/VariablePolicyDynamicCommand.inf {
<PcdsFixedAtBuild>
gEfiShellPkgTokenSpaceGuid.PcdShellLibAutoInitialize|FALSE
}
OvmfPkg/LinuxInitrdDynamicShellCommand/LinuxInitrdDynamicShellCommand.inf {
<PcdsFixedAtBuild>
gEfiShellPkgTokenSpaceGuid.PcdShellLibAutoInitialize|FALSE
}
ShellPkg/Application/Shell/Shell.inf {
<LibraryClasses>
ShellCommandLib|ShellPkg/Library/UefiShellCommandLib/UefiShellCommandLib.inf
NULL|ShellPkg/Library/UefiShellLevel2CommandsLib/UefiShellLevel2CommandsLib.inf
NULL|ShellPkg/Library/UefiShellLevel1CommandsLib/UefiShellLevel1CommandsLib.inf
NULL|ShellPkg/Library/UefiShellLevel3CommandsLib/UefiShellLevel3CommandsLib.inf
NULL|ShellPkg/Library/UefiShellDriver1CommandsLib/UefiShellDriver1CommandsLib.inf
NULL|ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.inf
!if $(ACPIVIEW_ENABLE) == TRUE
NULL|ShellPkg/Library/UefiShellAcpiViewCommandLib/UefiShellAcpiViewCommandLib.inf
!endif
NULL|ShellPkg/Library/UefiShellInstall1CommandsLib/UefiShellInstall1CommandsLib.inf
NULL|ShellPkg/Library/UefiShellNetwork1CommandsLib/UefiShellNetwork1CommandsLib.inf
!if $(NETWORK_IP6_ENABLE) == TRUE
NULL|ShellPkg/Library/UefiShellNetwork2CommandsLib/UefiShellNetwork2CommandsLib.inf
!endif
HandleParsingLib|ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.inf
PrintLib|MdePkg/Library/BasePrintLib/BasePrintLib.inf
BcfgCommandLib|ShellPkg/Library/UefiShellBcfgCommandLib/UefiShellBcfgCommandLib.inf

<PcdsFixedAtBuild>
gEfiMdePkgTokenSpaceGuid.PcdDebugPropertyMask|0xFF
gEfiShellPkgTokenSpaceGuid.PcdShellLibAutoInitialize|FALSE
gEfiMdePkgTokenSpaceGuid.PcdUefiLibMaxPrintBufferSize|8000
}
!include OvmfPkg/Include/Dsc/ShellComponents.dsc.inc

[Components.AARCH64]
#
Expand Down
6 changes: 1 addition & 5 deletions ArmVirtPkg/ArmVirtCloudHv.fdf
Original file line number Diff line number Diff line change
Expand Up @@ -166,11 +166,7 @@ READ_LOCK_STATUS = TRUE
#
# UEFI application (Shell Embedded Boot Loader)
#
INF ShellPkg/Application/Shell/Shell.inf
INF ShellPkg/DynamicCommand/TftpDynamicCommand/TftpDynamicCommand.inf
INF ShellPkg/DynamicCommand/HttpDynamicCommand/HttpDynamicCommand.inf
INF ShellPkg/DynamicCommand/VariablePolicyDynamicCommand/VariablePolicyDynamicCommand.inf
INF OvmfPkg/LinuxInitrdDynamicShellCommand/LinuxInitrdDynamicShellCommand.inf
!include OvmfPkg/Include/Fdf/ShellDxe.fdf.inc

#
# Bds
Expand Down
3 changes: 1 addition & 2 deletions ArmVirtPkg/ArmVirtKvmTool.fdf
Original file line number Diff line number Diff line change
Expand Up @@ -173,8 +173,7 @@ READ_LOCK_STATUS = TRUE
INF OvmfPkg/VirtioScsiDxe/VirtioScsi.inf
INF OvmfPkg/VirtioRngDxe/VirtioRng.inf

INF ShellPkg/Application/Shell/Shell.inf
INF ShellPkg/DynamicCommand/TftpDynamicCommand/TftpDynamicCommand.inf
mikebeaton marked this conversation as resolved.
Show resolved Hide resolved
!include OvmfPkg/Include/Fdf/ShellDxe.fdf.inc

#
# Bds
Expand Down
2 changes: 2 additions & 0 deletions ArmVirtPkg/ArmVirtQemu.dsc
Original file line number Diff line number Diff line change
Expand Up @@ -504,6 +504,7 @@
#
!include NetworkPkg/NetworkComponents.dsc.inc

!if $(NETWORK_ENABLE) == TRUE
NetworkPkg/UefiPxeBcDxe/UefiPxeBcDxe.inf {
<LibraryClasses>
NULL|OvmfPkg/Library/PxeBcPcdProducerLib/PxeBcPcdProducerLib.inf
Expand All @@ -514,6 +515,7 @@
<LibraryClasses>
NULL|OvmfPkg/Library/TlsAuthConfigLib/TlsAuthConfigLib.inf
}
!endif
!endif

#
Expand Down
6 changes: 1 addition & 5 deletions ArmVirtPkg/ArmVirtQemuFvMain.fdf.inc
Original file line number Diff line number Diff line change
Expand Up @@ -101,11 +101,7 @@ READ_LOCK_STATUS = TRUE
INF OvmfPkg/VirtioRngDxe/VirtioRng.inf
INF OvmfPkg/VirtioSerialDxe/VirtioSerial.inf

INF ShellPkg/Application/Shell/Shell.inf
INF ShellPkg/DynamicCommand/TftpDynamicCommand/TftpDynamicCommand.inf
INF ShellPkg/DynamicCommand/HttpDynamicCommand/HttpDynamicCommand.inf
INF ShellPkg/DynamicCommand/VariablePolicyDynamicCommand/VariablePolicyDynamicCommand.inf
INF OvmfPkg/LinuxInitrdDynamicShellCommand/LinuxInitrdDynamicShellCommand.inf
!include OvmfPkg/Include/Fdf/ShellDxe.fdf.inc

#
# Bds
Expand Down
2 changes: 2 additions & 0 deletions ArmVirtPkg/ArmVirtQemuKernel.dsc
Original file line number Diff line number Diff line change
Expand Up @@ -412,6 +412,7 @@
#
!include NetworkPkg/NetworkComponents.dsc.inc

!if $(NETWORK_ENABLE) == TRUE
NetworkPkg/UefiPxeBcDxe/UefiPxeBcDxe.inf {
<LibraryClasses>
NULL|OvmfPkg/Library/PxeBcPcdProducerLib/PxeBcPcdProducerLib.inf
Expand All @@ -422,6 +423,7 @@
<LibraryClasses>
NULL|OvmfPkg/Library/TlsAuthConfigLib/TlsAuthConfigLib.inf
}
!endif
!endif

#
Expand Down
6 changes: 1 addition & 5 deletions ArmVirtPkg/ArmVirtXen.fdf
Original file line number Diff line number Diff line change
Expand Up @@ -177,11 +177,7 @@ READ_LOCK_STATUS = TRUE
INF MdeModulePkg/Universal/Disk/UnicodeCollation/EnglishDxe/EnglishDxe.inf
INF MdeModulePkg/Universal/Disk/UdfDxe/UdfDxe.inf

INF ShellPkg/Application/Shell/Shell.inf
INF ShellPkg/DynamicCommand/TftpDynamicCommand/TftpDynamicCommand.inf
INF ShellPkg/DynamicCommand/HttpDynamicCommand/HttpDynamicCommand.inf
INF ShellPkg/DynamicCommand/VariablePolicyDynamicCommand/VariablePolicyDynamicCommand.inf
INF OvmfPkg/LinuxInitrdDynamicShellCommand/LinuxInitrdDynamicShellCommand.inf
!include OvmfPkg/Include/Fdf/ShellDxe.fdf.inc

#
# Bds
Expand Down
16 changes: 14 additions & 2 deletions ArmVirtPkg/PlatformCI/PlatformBuildLib.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
# SPDX-License-Identifier: BSD-2-Clause-Patent
##
import os
import shutil
import logging
import io

Expand Down Expand Up @@ -206,7 +207,8 @@ def PlatformPostBuild(self):
def FlashRomImage(self):
VirtualDrive = os.path.join(self.env.GetValue(
"BUILD_OUTPUT_BASE"), "VirtualDrive")
os.makedirs(VirtualDrive, exist_ok=True)
VirtualDriveBoot = os.path.join(VirtualDrive, "EFI", "BOOT")
os.makedirs(VirtualDriveBoot, exist_ok=True)
OutputPath_FV = os.path.join(
self.env.GetValue("BUILD_OUTPUT_BASE"), "FV")
Built_FV = os.path.join(OutputPath_FV, "QEMU_EFI.fd")
Expand All @@ -217,7 +219,17 @@ def FlashRomImage(self):
additional = b'\0' * ((64 * 1024 * 1024)-fvfile.tell())
fvfile.write(additional)

# QEMU must be on that path
# copy shell to VirtualDrive
for arch in self.env.GetValue("TARGET_ARCH").split():
src = os.path.join(self.env.GetValue(
"BUILD_OUTPUT_BASE"), arch, "Shell.efi")
dst = os.path.join(VirtualDriveBoot,
f'BOOT{"AA64" if arch == "AARCH64" else arch}.EFI')
if os.path.exists(src):
logging.info("copy %s -> %s", src, dst)
shutil.copyfile(src, dst)

# QEMU must be on the path

# Unique Command and Args parameters per ARCH
if (self.env.GetValue("TARGET_ARCH").upper() == "AARCH64"):
Expand Down
37 changes: 8 additions & 29 deletions OvmfPkg/Bhyve/BhyveX64.dsc
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@

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

#
# Shell can be useful for debugging but should not be enabled for production
#
DEFINE BUILD_SHELL = TRUE

#
# Network definition
#
Expand Down Expand Up @@ -223,7 +228,8 @@
TlsLib|CryptoPkg/Library/TlsLib/TlsLib.inf
!endif

ShellLib|ShellPkg/Library/UefiShellLib/UefiShellLib.inf
!include OvmfPkg/Include/Dsc/ShellLibs.dsc.inc

ShellCEntryLib|ShellPkg/Library/UefiShellCEntryLib/UefiShellCEntryLib.inf
S3BootScriptLib|MdeModulePkg/Library/PiDxeS3BootScriptLib/DxeS3BootScriptLib.inf
SmbusLib|MdePkg/Library/BaseSmbusLibNull/BaseSmbusLibNull.inf
Expand Down Expand Up @@ -764,34 +770,7 @@
MdeModulePkg/Bus/Usb/UsbKbDxe/UsbKbDxe.inf
MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMassStorageDxe.inf

!if $(TOOL_CHAIN_TAG) != "XCODE5"
ShellPkg/DynamicCommand/TftpDynamicCommand/TftpDynamicCommand.inf {
<PcdsFixedAtBuild>
gEfiShellPkgTokenSpaceGuid.PcdShellLibAutoInitialize|FALSE
}
!endif
ShellPkg/Application/Shell/Shell.inf {
<LibraryClasses>
ShellCommandLib|ShellPkg/Library/UefiShellCommandLib/UefiShellCommandLib.inf
NULL|ShellPkg/Library/UefiShellLevel2CommandsLib/UefiShellLevel2CommandsLib.inf
NULL|ShellPkg/Library/UefiShellLevel1CommandsLib/UefiShellLevel1CommandsLib.inf
NULL|ShellPkg/Library/UefiShellLevel3CommandsLib/UefiShellLevel3CommandsLib.inf
NULL|ShellPkg/Library/UefiShellDriver1CommandsLib/UefiShellDriver1CommandsLib.inf
NULL|ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.inf
NULL|ShellPkg/Library/UefiShellInstall1CommandsLib/UefiShellInstall1CommandsLib.inf
NULL|ShellPkg/Library/UefiShellNetwork1CommandsLib/UefiShellNetwork1CommandsLib.inf
!if $(NETWORK_IP6_ENABLE) == TRUE
NULL|ShellPkg/Library/UefiShellNetwork2CommandsLib/UefiShellNetwork2CommandsLib.inf
!endif
HandleParsingLib|ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.inf
PrintLib|MdePkg/Library/BasePrintLib/BasePrintLib.inf
BcfgCommandLib|ShellPkg/Library/UefiShellBcfgCommandLib/UefiShellBcfgCommandLib.inf

<PcdsFixedAtBuild>
gEfiMdePkgTokenSpaceGuid.PcdDebugPropertyMask|0xFF
gEfiShellPkgTokenSpaceGuid.PcdShellLibAutoInitialize|FALSE
gEfiMdePkgTokenSpaceGuid.PcdUefiLibMaxPrintBufferSize|8000
}
!include OvmfPkg/Include/Dsc/ShellComponents.dsc.inc

!if $(SECURE_BOOT_ENABLE) == TRUE
SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfigDxe.inf
Expand Down
5 changes: 1 addition & 4 deletions OvmfPkg/Bhyve/BhyveX64.fdf
Original file line number Diff line number Diff line change
Expand Up @@ -269,10 +269,7 @@ INF MdeModulePkg/Universal/Acpi/BootGraphicsResourceTableDxe/BootGraphicsResour
INF FatPkg/EnhancedFatDxe/Fat.inf
INF MdeModulePkg/Universal/Disk/UdfDxe/UdfDxe.inf

!if $(TOOL_CHAIN_TAG) != "XCODE5"
INF ShellPkg/DynamicCommand/TftpDynamicCommand/TftpDynamicCommand.inf
!endif
INF ShellPkg/Application/Shell/Shell.inf
mikebeaton marked this conversation as resolved.
Show resolved Hide resolved
!include OvmfPkg/Include/Fdf/ShellDxe.fdf.inc

INF MdeModulePkg/Logo/LogoDxe.inf

Expand Down
49 changes: 8 additions & 41 deletions OvmfPkg/CloudHv/CloudHvX64.dsc
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@

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

#
# Shell can be useful for debugging but should not be enabled for production
#
DEFINE BUILD_SHELL = TRUE

#
# Network definition
#
Expand Down Expand Up @@ -234,7 +239,8 @@
TlsLib|CryptoPkg/Library/TlsLib/TlsLib.inf
!endif

ShellLib|ShellPkg/Library/UefiShellLib/UefiShellLib.inf
!include OvmfPkg/Include/Dsc/ShellLibs.dsc.inc

ShellCEntryLib|ShellPkg/Library/UefiShellCEntryLib/UefiShellCEntryLib.inf
S3BootScriptLib|MdeModulePkg/Library/PiDxeS3BootScriptLib/DxeS3BootScriptLib.inf
SmbusLib|MdePkg/Library/BaseSmbusLibNull/BaseSmbusLibNull.inf
Expand Down Expand Up @@ -838,46 +844,7 @@

OvmfPkg/VirtioNetDxe/VirtioNet.inf

!if $(TOOL_CHAIN_TAG) != "XCODE5"
ShellPkg/DynamicCommand/TftpDynamicCommand/TftpDynamicCommand.inf {
<PcdsFixedAtBuild>
gEfiShellPkgTokenSpaceGuid.PcdShellLibAutoInitialize|FALSE
}
ShellPkg/DynamicCommand/HttpDynamicCommand/HttpDynamicCommand.inf {
<PcdsFixedAtBuild>
gEfiShellPkgTokenSpaceGuid.PcdShellLibAutoInitialize|FALSE
}
ShellPkg/DynamicCommand/VariablePolicyDynamicCommand/VariablePolicyDynamicCommand.inf {
<PcdsFixedAtBuild>
gEfiShellPkgTokenSpaceGuid.PcdShellLibAutoInitialize|FALSE
}
OvmfPkg/LinuxInitrdDynamicShellCommand/LinuxInitrdDynamicShellCommand.inf {
<PcdsFixedAtBuild>
gEfiShellPkgTokenSpaceGuid.PcdShellLibAutoInitialize|FALSE
}
!endif
ShellPkg/Application/Shell/Shell.inf {
<LibraryClasses>
ShellCommandLib|ShellPkg/Library/UefiShellCommandLib/UefiShellCommandLib.inf
NULL|ShellPkg/Library/UefiShellLevel2CommandsLib/UefiShellLevel2CommandsLib.inf
NULL|ShellPkg/Library/UefiShellLevel1CommandsLib/UefiShellLevel1CommandsLib.inf
NULL|ShellPkg/Library/UefiShellLevel3CommandsLib/UefiShellLevel3CommandsLib.inf
NULL|ShellPkg/Library/UefiShellDriver1CommandsLib/UefiShellDriver1CommandsLib.inf
NULL|ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.inf
NULL|ShellPkg/Library/UefiShellInstall1CommandsLib/UefiShellInstall1CommandsLib.inf
NULL|ShellPkg/Library/UefiShellNetwork1CommandsLib/UefiShellNetwork1CommandsLib.inf
!if $(NETWORK_IP6_ENABLE) == TRUE
NULL|ShellPkg/Library/UefiShellNetwork2CommandsLib/UefiShellNetwork2CommandsLib.inf
!endif
HandleParsingLib|ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.inf
PrintLib|MdePkg/Library/BasePrintLib/BasePrintLib.inf
BcfgCommandLib|ShellPkg/Library/UefiShellBcfgCommandLib/UefiShellBcfgCommandLib.inf

<PcdsFixedAtBuild>
gEfiMdePkgTokenSpaceGuid.PcdDebugPropertyMask|0xFF
gEfiShellPkgTokenSpaceGuid.PcdShellLibAutoInitialize|FALSE
gEfiMdePkgTokenSpaceGuid.PcdUefiLibMaxPrintBufferSize|8000
}
!include OvmfPkg/Include/Dsc/ShellComponents.dsc.inc

!if $(SECURE_BOOT_ENABLE) == TRUE
SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfigDxe.inf
Expand Down
7 changes: 1 addition & 6 deletions OvmfPkg/CloudHv/CloudHvX64.fdf
Original file line number Diff line number Diff line change
Expand Up @@ -288,12 +288,7 @@ INF FatPkg/EnhancedFatDxe/Fat.inf
INF MdeModulePkg/Universal/Disk/UdfDxe/UdfDxe.inf
INF OvmfPkg/VirtioFsDxe/VirtioFsDxe.inf

!if $(TOOL_CHAIN_TAG) != "XCODE5"
INF ShellPkg/DynamicCommand/TftpDynamicCommand/TftpDynamicCommand.inf
INF ShellPkg/DynamicCommand/HttpDynamicCommand/HttpDynamicCommand.inf
INF OvmfPkg/LinuxInitrdDynamicShellCommand/LinuxInitrdDynamicShellCommand.inf
!endif
INF ShellPkg/Application/Shell/Shell.inf
!include OvmfPkg/Include/Fdf/ShellDxe.fdf.inc

INF MdeModulePkg/Logo/LogoDxe.inf

Expand Down
3 changes: 3 additions & 0 deletions OvmfPkg/Include/Dsc/ShellComponents.dsc.inc
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@
NULL|ShellPkg/Library/UefiShellLevel3CommandsLib/UefiShellLevel3CommandsLib.inf
NULL|ShellPkg/Library/UefiShellDriver1CommandsLib/UefiShellDriver1CommandsLib.inf
NULL|ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.inf
!if $(ACPIVIEW_ENABLE) == TRUE
NULL|ShellPkg/Library/UefiShellAcpiViewCommandLib/UefiShellAcpiViewCommandLib.inf
!endif
NULL|ShellPkg/Library/UefiShellInstall1CommandsLib/UefiShellInstall1CommandsLib.inf
!if $(NETWORK_ENABLE) == TRUE
!if $(NETWORK_IP4_ENABLE) == TRUE
Expand Down
4 changes: 4 additions & 0 deletions OvmfPkg/Include/Fdf/ShellDxe.fdf.inc
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
# SPDX-License-Identifier: BSD-2-Clause-Patent
##

#
# Built shell can be useful even when not included here, and is used in CI:
# https://github.com/tianocore/edk2/commit/bc982869dd3e69ffd374fd968d378b5d954f66e8
#
!if $(BUILD_SHELL) == TRUE && $(SECURE_BOOT_ENABLE) == FALSE

!if $(TOOL_CHAIN_TAG) != "XCODE5"
Expand Down
Loading
Loading