MdeModulePkg CapsuleApp: Add directory support

Current CapsuleApp only supports input/output file from rootdirectory.
If the CapsuleApp and related file are put into subdirectory,
below message will be shown when running the CapsuleApp in shell.

"CapsuleApp: capsule image (Capsule image file name) is not found."

This patch is to add directory support for CapsuleApp
by using shell protocol.

Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Feng Tian <feng.tian@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
This commit is contained in:
Star Zeng
2017-04-11 09:55:51 +08:00
parent 9c0e4db3db
commit 8b17683a27
3 changed files with 119 additions and 327 deletions

View File

@ -21,11 +21,7 @@
#include <Library/UefiRuntimeServicesTableLib.h>
#include <Library/UefiLib.h>
#include <Library/PrintLib.h>
#include <Protocol/LoadedImage.h>
#include <Protocol/SimpleFileSystem.h>
#include <Protocol/GraphicsOutput.h>
#include <Guid/FileInfo.h>
#include <Guid/Gpt.h>
#include <Guid/GlobalVariable.h>
#include <Guid/CapsuleReport.h>
#include <Guid/SystemResourceTable.h>
@ -117,7 +113,8 @@ DumpEsrtData (
@param[out] Buffer The file buffer
@retval EFI_SUCCESS Read file successfully
@retval EFI_NOT_FOUND File not found
@retval EFI_NOT_FOUND Shell protocol or file not found
@retval others Read file failed
**/
EFI_STATUS
ReadFileToBuffer (
@ -134,6 +131,8 @@ ReadFileToBuffer (
@param[in] Buffer The file buffer
@retval EFI_SUCCESS Write file successfully
@retval EFI_NOT_FOUND Shell protocol not found
@retval others Write file failed
**/
EFI_STATUS
WriteFileFromBuffer (