Skip to content

Commit

Permalink
ArmVirtPkg: Use OvmfPkg/Include/*/Shell*.inc
Browse files Browse the repository at this point in the history
While fixing (#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 already
applied this fix logic are available and already used in some
OvmfPkg platforms.

This commit applies these files within ArmVirtPkg.

This has the side effects that:

 - Some platforms now include one or more of HttpDynamicCommand,
   VariablePolicyDynamicCommand and LinuxInitrdDynamicShellCommand
   when they previously did not
 - Whether the UEFI Shell is included (by ShellDxe.fdf.inc) depends
   on whether Secure Boot is enabled (on those platforms which support
   enabling secure boot)

To address the second issue, in a related commit to OvmfPkg
we have added ShellDefines.dsc.inc, which is also applied here,
which defaults BUILD_SHELL to FALSE when SECURE_BOOT_ENABLE is TRUE and
vice versa, and then modified ShellDxe.fdf.inc so that it conditionally
includes shell components only depending on BUILD_SHELL. We additionally
enable UEFI Shell in the CI matrix for those tests which rely on
UEFI Shell being present with Secure Boot enabled.

Signed-off-by: Mike Beaton <[email protected]>
  • Loading branch information
mikebeaton committed Sep 12, 2024
1 parent 591760f commit bd25067
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 76 deletions.
55 changes: 7 additions & 48 deletions ArmVirtPkg/ArmVirt.dsc.inc
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
#

[Defines]

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

DEFINE DEBUG_PRINT_ERROR_LEVEL = 0x8000004F

!if $(TARGET) != NOOPT
Expand Down Expand Up @@ -66,7 +69,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 @@ -393,53 +398,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 @@ -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
Expand Down
5 changes: 1 addition & 4 deletions ArmVirtPkg/ArmVirtKvmTool.fdf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 1 addition & 7 deletions ArmVirtPkg/ArmVirtQemuFvMain.fdf.inc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 1 addition & 7 deletions ArmVirtPkg/ArmVirtXen.fdf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions ArmVirtPkg/PlatformCI/.azurepipelines/Ubuntu-GCC5.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,21 +32,21 @@ jobs:
QEMU_AARCH64_DEBUG:
Build.File: "$(package)/PlatformCI/QemuBuild.py"
Build.Arch: "AARCH64"
Build.Flags: "BLD_*_SECURE_BOOT_ENABLE=1 BLD_*_TPM2_ENABLE=1 BLD_*_NETWORK_TLS_ENABLE=1 BLD_*_NETWORK_IP6_ENABLE=1 BLD_*_NETWORK_HTTP_BOOT_ENABLE=1"
Build.Flags: "BLD_*_SECURE_BOOT_ENABLE=1 BLD_*_BUILD_SHELL=1 BLD_*_TPM2_ENABLE=1 BLD_*_NETWORK_TLS_ENABLE=1 BLD_*_NETWORK_IP6_ENABLE=1 BLD_*_NETWORK_HTTP_BOOT_ENABLE=1"
Build.Target: "DEBUG"
Run.Flags: $(run_flags)
Run: $(should_run)
QEMU_AARCH64_RELEASE:
Build.File: "$(package)/PlatformCI/QemuBuild.py"
Build.Arch: "AARCH64"
Build.Flags: "BLD_*_SECURE_BOOT_ENABLE=1 BLD_*_TPM2_ENABLE=1 BLD_*_NETWORK_TLS_ENABLE=1 BLD_*_NETWORK_IP6_ENABLE=1 BLD_*_NETWORK_HTTP_BOOT_ENABLE=1"
Build.Flags: "BLD_*_SECURE_BOOT_ENABLE=1 BLD_*_BUILD_SHELL=1 BLD_*_TPM2_ENABLE=1 BLD_*_NETWORK_TLS_ENABLE=1 BLD_*_NETWORK_IP6_ENABLE=1 BLD_*_NETWORK_HTTP_BOOT_ENABLE=1"
Build.Target: "RELEASE"
Run.Flags: $(run_flags)
Run: $(should_run)
QEMU_AARCH64_NOOPT:
Build.File: "$(package)/PlatformCI/QemuBuild.py"
Build.Arch: "AARCH64"
Build.Flags: "BLD_*_SECURE_BOOT_ENABLE=1 BLD_*_TPM2_ENABLE=1 BLD_*_NETWORK_TLS_ENABLE=1 BLD_*_NETWORK_IP6_ENABLE=1 BLD_*_NETWORK_HTTP_BOOT_ENABLE=1"
Build.Flags: "BLD_*_SECURE_BOOT_ENABLE=1 BLD_*_BUILD_SHELL=1 BLD_*_TPM2_ENABLE=1 BLD_*_NETWORK_TLS_ENABLE=1 BLD_*_NETWORK_IP6_ENABLE=1 BLD_*_NETWORK_HTTP_BOOT_ENABLE=1"
Build.Target: "NOOPT"
Run.Flags: $(run_flags)
Run: $(should_run)
Expand Down

0 comments on commit bd25067

Please sign in to comment.