Skip to content

Commit

Permalink
ArmVirtPkg: Use OvmfPkg/Include/*/Shell*.inc
Browse files Browse the repository at this point in the history
While fixing tianocore/edk2#6092 (the
fact that some OvmfPkg and ArmVirtPkg platforms included residual
NetworkPkg components even when compiled with -D NETWORK_ENABLE=0),
it was noted that OvmfPkg/Include/*/Shell*.inc files which apply
the required fix logic are available and already used in some
OvmfPkg platforms.

A previous commit applied these files consistently within OvmfPkg.
This commit applies these files within ArmVirtPkg.

This has the side effect that some platforms now include one or
more of HttpDynamicCommand, VariablePolicyDynamicCommand and
LinuxInitrdDynamicShellCommand when they previously did not.
It is believed that in all cases these changes are neutral (i.e.
not necessarily needed, but not harmful, and with the benefit of
now using shared code) or positive (i.e. they fix unintentional
drift between platforms, and provide additional shell commands
which may be useful in some cases).

Signed-off-by: Mike Beaton <mjsbeaton@gmail.com>
  • Loading branch information
mikebeaton committed Dec 21, 2024
1 parent 721fbd8 commit 689493e
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 73 deletions.
58 changes: 10 additions & 48 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 @@ -62,7 +68,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 @@ -388,53 +396,7 @@
#
MdeModulePkg/Universal/Disk/RamDiskDxe/RamDiskDxe.inf

!if $(NETWORK_ENABLE) == TRUE
ShellPkg/DynamicCommand/TftpDynamicCommand/TftpDynamicCommand.inf {
<PcdsFixedAtBuild>
gEfiShellPkgTokenSpaceGuid.PcdShellLibAutoInitialize|FALSE
}
ShellPkg/DynamicCommand/HttpDynamicCommand/HttpDynamicCommand.inf {
<PcdsFixedAtBuild>
gEfiShellPkgTokenSpaceGuid.PcdShellLibAutoInitialize|FALSE
}
!endif
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
!if $(NETWORK_ENABLE) == TRUE
!if $(NETWORK_IP4_ENABLE) == TRUE
NULL|ShellPkg/Library/UefiShellNetwork1CommandsLib/UefiShellNetwork1CommandsLib.inf
!endif
!if $(NETWORK_IP6_ENABLE) == TRUE
NULL|ShellPkg/Library/UefiShellNetwork2CommandsLib/UefiShellNetwork2CommandsLib.inf
!endif
!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
8 changes: 1 addition & 7 deletions ArmVirtPkg/ArmVirtCloudHv.fdf
Original file line number Diff line number Diff line change
Expand Up @@ -165,13 +165,7 @@ READ_LOCK_STATUS = TRUE
#
# UEFI application (Shell Embedded Boot Loader)
#
INF ShellPkg/Application/Shell/Shell.inf
!if $(NETWORK_ENABLE) == TRUE
INF ShellPkg/DynamicCommand/TftpDynamicCommand/TftpDynamicCommand.inf
INF ShellPkg/DynamicCommand/HttpDynamicCommand/HttpDynamicCommand.inf
!endif
INF ShellPkg/DynamicCommand/VariablePolicyDynamicCommand/VariablePolicyDynamicCommand.inf
INF OvmfPkg/LinuxInitrdDynamicShellCommand/LinuxInitrdDynamicShellCommand.inf
!include OvmfPkg/Include/Fdf/ShellDxe.fdf.inc

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

INF ShellPkg/Application/Shell/Shell.inf
!if $(NETWORK_ENABLE) == TRUE
INF ShellPkg/DynamicCommand/TftpDynamicCommand/TftpDynamicCommand.inf
!endif
!include OvmfPkg/Include/Fdf/ShellDxe.fdf.inc

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

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

#
# Bds
Expand Down
8 changes: 1 addition & 7 deletions ArmVirtPkg/ArmVirtXen.fdf
Original file line number Diff line number Diff line change
Expand Up @@ -176,13 +176,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
!if $(NETWORK_ENABLE) == TRUE
INF ShellPkg/DynamicCommand/TftpDynamicCommand/TftpDynamicCommand.inf
INF ShellPkg/DynamicCommand/HttpDynamicCommand/HttpDynamicCommand.inf
!endif
INF ShellPkg/DynamicCommand/VariablePolicyDynamicCommand/VariablePolicyDynamicCommand.inf
INF OvmfPkg/LinuxInitrdDynamicShellCommand/LinuxInitrdDynamicShellCommand.inf
!include OvmfPkg/Include/Fdf/ShellDxe.fdf.inc

#
# Bds
Expand Down

0 comments on commit 689493e

Please sign in to comment.