summaryrefslogtreecommitdiffstats
path: root/MdeModulePkg/Application
diff options
context:
space:
mode:
authorZhang, Chao B <chao.b.zhang@intel.com>2019-06-21 10:24:10 +0800
committerZhang, Chao B <chao.b.zhang@intel.com>2019-06-21 10:25:25 +0800
commit57ec204e69138f5ff46cf6712692213332a8599b (patch)
tree28e8380f0cc18ca5151e4e313d26316260ed5465 /MdeModulePkg/Application
parent425d8d487fe20e76281fd7da074592508d03f9c0 (diff)
downloadedk2-57ec204e69138f5ff46cf6712692213332a8599b.tar.gz
edk2-57ec204e69138f5ff46cf6712692213332a8599b.tar.bz2
edk2-57ec204e69138f5ff46cf6712692213332a8599b.zip
Revert "Capsule-on-Disk entire Patch
This reverts commit 0d4aa276d1f6e0cb9d71a7fb88b30c416ba6d5a3, 6470a43160183cd48cad8901c912a48811f18b13, fd7286089542ee7a98cfea00be45ceb3561e0b20, 7837d1249807b4248079699097bc993254235d7a, 6b32af2e105f9b5454a55b581f2dc365c5eb6397, 8636f70b5a763ed1c03b292708f9c5543e531ea9, f17935321a5b818a66e999632ef371b374b98f0c due to incorrect review process. Cc: Wei6 Xu <wei6.xu@intel.com> Cc: Hao A Wu <hao.a.wu@intel.com> Signed-off-by: Zhang, Chao B <chao.b.zhang@intel.com> Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
Diffstat (limited to 'MdeModulePkg/Application')
-rw-r--r--MdeModulePkg/Application/CapsuleApp/CapsuleApp.c41
-rw-r--r--MdeModulePkg/Application/CapsuleApp/CapsuleDump.c4
-rw-r--r--MdeModulePkg/Application/CapsuleApp/CapsuleOnDisk.c56
3 files changed, 24 insertions, 77 deletions
diff --git a/MdeModulePkg/Application/CapsuleApp/CapsuleApp.c b/MdeModulePkg/Application/CapsuleApp/CapsuleApp.c
index 0b5f7c8684..e3c591dbf3 100644
--- a/MdeModulePkg/Application/CapsuleApp/CapsuleApp.c
+++ b/MdeModulePkg/Application/CapsuleApp/CapsuleApp.c
@@ -849,7 +849,7 @@ PrintUsage (
Print(L"Parameter:\n");
Print(L" -NR: No reset will be triggered for the capsule\n");
Print(L" with CAPSULE_FLAGS_PERSIST_ACROSS_RESET and without CAPSULE_FLAGS_INITIATE_RESET.\n");
- Print(L" -OD: Delivery of Capsules via file on Mass Storage device.\n");
+ Print(L" -OD: Delivery of Capsules via file on Mass Storage device.");
Print(L" -S: Dump capsule report variable (EFI_CAPSULE_REPORT_GUID),\n");
Print(L" which is defined in UEFI specification.\n");
Print(L" -C: Clear capsule report variable (EFI_CAPSULE_REPORT_GUID),\n");
@@ -1020,39 +1020,40 @@ UefiMain (
}
}
- if (ParaOdIndex > ParaNrIndex) {
- if (ParaNrIndex != 0) {
- CapsuleLastIndex = ParaNrIndex - 1;
- } else {
- CapsuleLastIndex = ParaOdIndex - 1;
- }
-
- if (ParaOdIndex == Argc -1) {
+ if (ParaOdIndex != 0) {
+ if (ParaOdIndex == Argc - 1) {
MapFsStr = NULL;
} else if (ParaOdIndex == Argc - 2) {
MapFsStr = Argv[Argc-1];
} else {
- Print (L"CapsuleApp: Cannot specify more than one FS mapping!\n");
+ Print (L"CapsuleApp: Invalid Position for -OD Options\n");
Status = EFI_INVALID_PARAMETER;
goto Done;
}
- } else if (ParaOdIndex < ParaNrIndex) {
- if (ParaOdIndex != 0) {
- CapsuleLastIndex = ParaOdIndex - 1;
- if (ParaOdIndex == ParaNrIndex - 1) {
- MapFsStr = NULL;
- } else if (ParaOdIndex == ParaNrIndex - 2) {
- MapFsStr = Argv[ParaOdIndex + 1];
+
+ if (ParaNrIndex != 0) {
+ if (ParaNrIndex + 1 == ParaOdIndex) {
+ CapsuleLastIndex = ParaNrIndex - 1;
} else {
- Print (L"CapsuleApp: Cannot specify more than one FS mapping!\n");
+ Print (L"CapsuleApp: Invalid Position for -NR Options\n");
Status = EFI_INVALID_PARAMETER;
goto Done;
}
} else {
- CapsuleLastIndex = ParaNrIndex - 1;
+ CapsuleLastIndex = ParaOdIndex - 1;
}
} else {
- CapsuleLastIndex = Argc - 1;
+ if (ParaNrIndex != 0) {
+ if (ParaNrIndex == Argc -1) {
+ CapsuleLastIndex = ParaNrIndex - 1;
+ } else {
+ Print (L"CapsuleApp: Invalid Position for -NR Options\n");
+ Status = EFI_INVALID_PARAMETER;
+ goto Done;
+ }
+ } else {
+ CapsuleLastIndex = Argc - 1;
+ }
}
CapsuleNum = CapsuleLastIndex - CapsuleFirstIndex + 1;
diff --git a/MdeModulePkg/Application/CapsuleApp/CapsuleDump.c b/MdeModulePkg/Application/CapsuleApp/CapsuleDump.c
index 0e0c566702..b81c5b7b3a 100644
--- a/MdeModulePkg/Application/CapsuleApp/CapsuleDump.c
+++ b/MdeModulePkg/Application/CapsuleApp/CapsuleDump.c
@@ -812,8 +812,8 @@ DumpCapsuleFromDisk (
//
// Get file count first
//
- Status = FileHandleFindFirstFile (DirHandle, &FileInfo);
do {
+ Status = FileHandleFindFirstFile (DirHandle, &FileInfo);
if (EFI_ERROR (Status) || FileInfo == NULL) {
Print (L"Get File Info Fail. Status = %r\n", Status);
goto Done;
@@ -846,8 +846,8 @@ DumpCapsuleFromDisk (
//
// Get all file info
//
- Status = FileHandleFindFirstFile (DirHandle, &FileInfo);
do {
+ Status = FileHandleFindFirstFile (DirHandle, &FileInfo);
if (EFI_ERROR (Status) || FileInfo == NULL) {
Print (L"Get File Info Fail. Status = %r\n", Status);
goto Done;
diff --git a/MdeModulePkg/Application/CapsuleApp/CapsuleOnDisk.c b/MdeModulePkg/Application/CapsuleApp/CapsuleOnDisk.c
index df43a436f2..a11683d66c 100644
--- a/MdeModulePkg/Application/CapsuleApp/CapsuleOnDisk.c
+++ b/MdeModulePkg/Application/CapsuleApp/CapsuleOnDisk.c
@@ -23,8 +23,6 @@
#include <Guid/GlobalVariable.h>
#include <Guid/Gpt.h>
-#define MAX_CAPSULE_NUM 10
-
EFI_GUID mCapsuleOnDiskBootOptionGuid = { 0x4CC29BB7, 0x2413, 0x40A2, { 0xB0, 0x6D, 0x25, 0x3E, 0x37, 0x10, 0xF5, 0x32 } };
/**
@@ -747,41 +745,6 @@ SetCapsuleStatusVariable (
}
/**
- Check if Capsule On Disk is supported.
-
- @retval TRUE Capsule On Disk is supported.
- @retval FALSE Capsule On Disk is not supported.
-
-**/
-BOOLEAN
-IsCapsuleOnDiskSupported (
- VOID
- )
-{
- EFI_STATUS Status;
- UINT64 OsIndicationsSupported;
- UINTN DataSize;
-
- DataSize = sizeof(UINT64);
- Status = gRT->GetVariable (
- L"OsIndicationsSupported",
- &gEfiGlobalVariableGuid,
- NULL,
- &DataSize,
- &OsIndicationsSupported
- );
- if (EFI_ERROR (Status)) {
- return FALSE;
- }
-
- if (OsIndicationsSupported & EFI_OS_INDICATIONS_FILE_CAPSULE_DELIVERY_SUPPORTED) {
- return TRUE;
- }
-
- return FALSE;
-}
-
-/**
Process Capsule On Disk.
@param[in] CapsuleBuffer An array of pointer to capsule images
@@ -807,16 +770,6 @@ ProcessCapsuleOnDisk (
UINT16 BootNext;
EFI_SIMPLE_FILE_SYSTEM_PROTOCOL *Fs;
BOOLEAN UpdateBootNext;
- CHAR16 *FileName[MAX_CAPSULE_NUM];
- UINTN Index;
-
- //
- // Check if Capsule On Disk is supported
- //
- if (!IsCapsuleOnDiskSupported ()) {
- Print (L"CapsuleApp: Capsule On Disk is not supported.\n");
- return EFI_UNSUPPORTED;
- }
//
// Get a valid file system from boot path
@@ -830,16 +783,9 @@ ProcessCapsuleOnDisk (
}
//
- // Get file name from file path
- //
- for (Index = 0; Index < CapsuleNum; Index ++) {
- FileName[Index] = GetFileNameFromPath (FilePath[Index]);
- }
-
- //
// Copy capsule image to '\efi\UpdateCapsule\'
//
- Status = WriteUpdateFile (CapsuleBuffer, CapsuleBufferSize, FileName, CapsuleNum, Fs);
+ Status = WriteUpdateFile (CapsuleBuffer, CapsuleBufferSize, FilePath, CapsuleNum, Fs);
if (EFI_ERROR (Status)) {
Print (L"CapsuleApp: capsule image could not be copied for update.\n");
return Status;