ShellPkg/DynamicCommand: Fix bug that cannot start in boot

When dynamic command drivers are built into FV and start during
boot, they fails. Because Shell protocol doesn't exist during boot.
The patch sets Shell protocol and also set PcdShellLibAutoInitialize
to FALSE to ensure that
1. Shell protocol check doesn't happen in driver's entry point.
2. Driver can get the Shell protocol in DynamicCommand.Handler().

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
This commit is contained in:
Ruiyu Ni 2017-11-28 19:43:16 +08:00
parent 68b07ebae5
commit ff5a4bcff3
3 changed files with 8 additions and 1 deletions
ShellPkg
DynamicCommand
DpDynamicCommand
TftpDynamicCommand
ShellPkg.dsc

@ -38,6 +38,7 @@ DpCommandHandler (
)
{
gEfiShellParametersProtocol = ShellParameters;
gEfiShellProtocol = Shell;
return RunDp (gImageHandle, SystemTable);
}

@ -39,6 +39,7 @@ TftpCommandHandler (
)
{
gEfiShellParametersProtocol = ShellParameters;
gEfiShellProtocol = Shell;
return RunTftp (gImageHandle, SystemTable);
}

@ -120,9 +120,14 @@
!endif #$(NO_SHELL_PROFILES)
}
ShellPkg/DynamicCommand/TftpDynamicCommand/TftpDynamicCommand.inf
ShellPkg/DynamicCommand/TftpDynamicCommand/TftpDynamicCommand.inf {
<PcdsFixedAtBuild>
gEfiShellPkgTokenSpaceGuid.PcdShellLibAutoInitialize|FALSE
}
ShellPkg/DynamicCommand/TftpDynamicCommand/TftpApp.inf
ShellPkg/DynamicCommand/DpDynamicCommand/DpDynamicCommand.inf {
<PcdsFixedAtBuild>
gEfiShellPkgTokenSpaceGuid.PcdShellLibAutoInitialize|FALSE
<LibraryClasses>
PerformanceLib|MdeModulePkg/Library/DxeSmmPerformanceLib/DxeSmmPerformanceLib.inf
}