Skip to content

Commit

Permalink
Add Dynamic command support to AdvancedLogDumper Application (#513)
Browse files Browse the repository at this point in the history
## Description

- Added support to invoke AdvlogDump as in-built UEFI Shell application
using EFI_SHELL_DYNAMIC_COMMAND_PROTOCOL

- Created new INF file to add this support

- [x] Impacts functionality?
- **Functionality** - Does the change ultimately impact how firmware
functions?
- Examples: Add a new library, publish a new PPI, update an algorithm,
...
- [x ] Impacts security?
- **Security** - Does the change have a direct security impact on an
application,
    flow, or firmware?
  - Examples: Crypto algorithm change, buffer overflow fix, parameter
    validation improvement, ...
- [ ] Breaking change?
- **Breaking change** - Will anyone consuming this change experience a
break
    in build or boot behavior?
- Examples: Add a new library class, move a module to a different repo,
call
    a function in a new library class in a pre-existing module, ...
- [ ] Includes tests?
  - **Tests** - Does the change include any explicit test code?
  - Examples: Unit tests, integration tests, robot tests, ...
- [ ] Includes documentation?
- **Documentation** - Does the change contain explicit documentation
additions
    outside direct code modifications (and comments)?
- Examples: Update readme file, add feature readme file, link to
documentation
    on an a separate Web page, ...

## How This Was Tested

- Invoked "Advlogdump" from UEFI Shell and verified LogDumper
functionality
## Integration Instructions

## Integration

Add the following to DSC file

AdvLoggerPkg/Application/AdvancedLogDumper/AdvancedLogDumperDynamicCommand.inf
{
   <PcdsFixedAtBuild>
      gEfiShellPkgTokenSpaceGuid.PcdShellLibAutoInitialize|FALSE
  } 

in FDF file

INF
AdvLoggerPkg/Application/AdvancedLogDumper/AdvancedLogDumperDynamicCommand.inf

---------

Signed-off-by: Sureshkumar Ponnusamy <[email protected]>
Co-authored-by: Sureshkumar Ponnusamy <[email protected]>
Co-authored-by: Oliver Smith-Denny <[email protected]>
Co-authored-by: kuqin12 <[email protected]>
Co-authored-by: Michael Kubacki <[email protected]>
  • Loading branch information
5 people authored Jul 10, 2024
1 parent b5aefd3 commit 005cfdd
Show file tree
Hide file tree
Showing 8 changed files with 602 additions and 266 deletions.
12 changes: 9 additions & 3 deletions AdvLoggerPkg/AdvLoggerPkg.dsc
Original file line number Diff line number Diff line change
Expand Up @@ -62,15 +62,16 @@
MmUnblockMemoryLib|MdePkg/Library/MmUnblockMemoryLib/MmUnblockMemoryLibNull.inf
NULL|MdePkg/Library/StackCheckLibNull/StackCheckLibNull.inf

ShellLib|ShellPkg/Library/UefiShellLib/UefiShellLib.inf
FileHandleLib|MdePkg/Library/UefiFileHandleLib/UefiFileHandleLib.inf
AdvancedLoggerAccessLib|AdvLoggerPkg/Library/AdvancedLoggerAccessLib/AdvancedLoggerAccessLib.inf

[LibraryClasses.common.UEFI_APPLICATION]
UnitTestPersistenceLib|UnitTestFrameworkPkg/Library/UnitTestPersistenceLibSimpleFileSystem/UnitTestPersistenceLibSimpleFileSystem.inf
UnitTestResultReportLib|XmlSupportPkg/Library/UnitTestResultReportJUnitFormatLib/UnitTestResultReportLib.inf
ShellLib|ShellPkg/Library/UefiShellLib/UefiShellLib.inf
FileHandleLib|MdePkg/Library/UefiFileHandleLib/UefiFileHandleLib.inf

[LibraryClasses.X64]
SynchronizationLib|MdePkg/Library/BaseSynchronizationLib/BaseSynchronizationLib.inf
AdvancedLoggerAccessLib|AdvLoggerPkg/Library/AdvancedLoggerAccessLib/AdvancedLoggerAccessLib.inf
AdvancedLoggerLib|AdvLoggerPkg/Library/AdvancedLoggerLib/Dxe/AdvancedLoggerLib.inf
AdvancedLoggerHdwPortLib|AdvLoggerPkg/Library/AdvancedLoggerHdwPortLib/AdvancedLoggerHdwPortLib.inf
AssertLib|AdvLoggerPkg/Library/AssertLib/AssertLib.inf
Expand Down Expand Up @@ -152,6 +153,11 @@
AdvLoggerPkg/Library/AssertTelemetryLib/AssertLib.inf
AdvLoggerPkg/UnitTests/LineParser/LineParserTestApp.inf
AdvLoggerPkg/UnitTests/AdvancedLoggerWrapper/AdvancedLoggerWrapperTestApp.inf
AdvLoggerPkg/Application/AdvancedLogDumper/AdvancedLogDumperDynamicCommand.inf {
<PcdsFixedAtBuild>
gEfiShellPkgTokenSpaceGuid.PcdShellLibAutoInitialize|FALSE
}


[BuildOptions]
#force deprecated interfaces off
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
MODULE_TYPE = UEFI_APPLICATION
VERSION_STRING = 1.0
ENTRY_POINT = EntryPoint
UEFI_HII_RESOURCE_SECTION = TRUE

#
# The following information is for reference only and not required by the build tools.
Expand All @@ -21,7 +22,9 @@

[Sources]
LogDumper.c
LogDumperCommon.c
LogDumper.h
LogDumper.uni

[Packages]
MdePkg/MdePkg.dec
Expand All @@ -35,6 +38,9 @@
[Pcd]
gEfiMdeModulePkgTokenSpaceGuid.PcdMaxVariableSize

[Protocols]
gEfiHiiPackageListProtocolGuid ## CONSUMES

[LibraryClasses]
AdvancedLoggerAccessLib
DebugLib
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
## @file
# UEFI driver that adds the AdvLogDump command support to UEFI Shell
# The command helps to dump the advanced logger to a bin file or a text file
#
# Copyright (c) Microsoft Corporation
# SPDX-License-Identifier: BSD-2-Clause-Patent
##

[Defines]
INF_VERSION = 0x00010006
BASE_NAME = AdvancedLogDumperDynamicCommand
FILE_GUID = DFC593A6-7236-46F8-AB79-751D259D17D3
MODULE_TYPE = DXE_DRIVER
VERSION_STRING = 1.0
ENTRY_POINT = AdvancedLogDumperEntryPoint
UNLOAD_IMAGE = AdvancedLogDumperUnload
UEFI_HII_RESOURCE_SECTION = TRUE

#
# The following information is for reference only and not required by the build tools.
#
# VALID_ARCHITECTURES = IA32 X64 AARCH64
#

[Sources]
LogDumperDynamicCommand.c
LogDumperCommon.c
LogDumper.h
LogDumper.uni

[Packages]
MdePkg/MdePkg.dec
MdeModulePkg/MdeModulePkg.dec
AdvLoggerPkg/AdvLoggerPkg.dec
ShellPkg/ShellPkg.dec

[Guids]
gAdvLoggerAccessGuid ## CONSUMES

[Pcd]
gEfiMdeModulePkgTokenSpaceGuid.PcdMaxVariableSize

[LibraryClasses]
AdvancedLoggerAccessLib
DebugLib
MemoryAllocationLib
PcdLib
PrintLib
ShellLib
UefiLib
UefiRuntimeServicesTableLib
UefiBootServicesTableLib
UefiDriverEntryPoint
HiiLib

[Protocols]
gEfiHiiPackageListProtocolGuid ## CONSUMES
gEfiShellDynamicCommandProtocolGuid ## PRODUCES

[Depex]
TRUE
Loading

0 comments on commit 005cfdd

Please sign in to comment.