From 6bed108c15c9238451a1415988a5a43ed6db068c Mon Sep 17 00:00:00 2001 From: Mike Beaton Date: Fri, 13 Sep 2024 09:28:39 +0100 Subject: [PATCH] ArmVirtPkg: Use OvmfPkg/Include/*/Shell*.inc While fixing https://github.com/tianocore/edk2/pull/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 --- ArmVirtPkg/ArmVirt.dsc.inc | 58 +++++----------------------- ArmVirtPkg/ArmVirtCloudHv.fdf | 8 +--- ArmVirtPkg/ArmVirtKvmTool.fdf | 5 +-- ArmVirtPkg/ArmVirtQemuFvMain.fdf.inc | 8 +--- ArmVirtPkg/ArmVirtXen.fdf | 8 +--- 5 files changed, 14 insertions(+), 73 deletions(-) diff --git a/ArmVirtPkg/ArmVirt.dsc.inc b/ArmVirtPkg/ArmVirt.dsc.inc index 05e83a2e19b9..199f71082aa2 100644 --- a/ArmVirtPkg/ArmVirt.dsc.inc +++ b/ArmVirtPkg/ArmVirt.dsc.inc @@ -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 @@ -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 @@ -394,53 +402,7 @@ # MdeModulePkg/Universal/Disk/RamDiskDxe/RamDiskDxe.inf -!if $(NETWORK_ENABLE) == TRUE - ShellPkg/DynamicCommand/TftpDynamicCommand/TftpDynamicCommand.inf { - - gEfiShellPkgTokenSpaceGuid.PcdShellLibAutoInitialize|FALSE - } - ShellPkg/DynamicCommand/HttpDynamicCommand/HttpDynamicCommand.inf { - - gEfiShellPkgTokenSpaceGuid.PcdShellLibAutoInitialize|FALSE - } -!endif - ShellPkg/DynamicCommand/VariablePolicyDynamicCommand/VariablePolicyDynamicCommand.inf { - - gEfiShellPkgTokenSpaceGuid.PcdShellLibAutoInitialize|FALSE - } - OvmfPkg/LinuxInitrdDynamicShellCommand/LinuxInitrdDynamicShellCommand.inf { - - gEfiShellPkgTokenSpaceGuid.PcdShellLibAutoInitialize|FALSE - } - ShellPkg/Application/Shell/Shell.inf { - - 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 - - - gEfiMdePkgTokenSpaceGuid.PcdDebugPropertyMask|0xFF - gEfiShellPkgTokenSpaceGuid.PcdShellLibAutoInitialize|FALSE - gEfiMdePkgTokenSpaceGuid.PcdUefiLibMaxPrintBufferSize|8000 - } +!include OvmfPkg/Include/Dsc/ShellComponents.dsc.inc [Components.AARCH64] # diff --git a/ArmVirtPkg/ArmVirtCloudHv.fdf b/ArmVirtPkg/ArmVirtCloudHv.fdf index 77005c71472c..ef39ccb87766 100644 --- a/ArmVirtPkg/ArmVirtCloudHv.fdf +++ b/ArmVirtPkg/ArmVirtCloudHv.fdf @@ -166,13 +166,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 diff --git a/ArmVirtPkg/ArmVirtKvmTool.fdf b/ArmVirtPkg/ArmVirtKvmTool.fdf index ed2804fc5464..1ca388084e90 100644 --- a/ArmVirtPkg/ArmVirtKvmTool.fdf +++ b/ArmVirtPkg/ArmVirtKvmTool.fdf @@ -173,10 +173,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 diff --git a/ArmVirtPkg/ArmVirtQemuFvMain.fdf.inc b/ArmVirtPkg/ArmVirtQemuFvMain.fdf.inc index b97a2c706bbd..5720bd28c805 100644 --- a/ArmVirtPkg/ArmVirtQemuFvMain.fdf.inc +++ b/ArmVirtPkg/ArmVirtQemuFvMain.fdf.inc @@ -101,13 +101,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 diff --git a/ArmVirtPkg/ArmVirtXen.fdf b/ArmVirtPkg/ArmVirtXen.fdf index 5e15cd070e44..15efa07813fd 100644 --- a/ArmVirtPkg/ArmVirtXen.fdf +++ b/ArmVirtPkg/ArmVirtXen.fdf @@ -177,13 +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 -!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