diff options
author | Qiu Shumin <shumin.qiu@intel.com> | 2016-05-20 12:48:44 +0800 |
---|---|---|
committer | Hao Wu <hao.a.wu@intel.com> | 2016-07-13 20:43:33 +0800 |
commit | 1efc09857e20a29ec3533d95e83981f5b207ca25 (patch) | |
tree | 177abaf89857b248ba797197d3fdd354c5146413 /ShellPkg/Library | |
parent | a0c2cbfec609560d49e578ea2904ef7e598487f7 (diff) | |
download | edk2-platforms-1efc09857e20a29ec3533d95e83981f5b207ca25.tar.xz |
ShellPkg/Bcfg: Add support for 'addp' command.
Until now the 'addp' command has been handled in the same way as 'add'.
Just copy the DevicePath starting from the Hard Drive node when 'addp'
is used.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Marvin Haeuser <Marvin.Haeuser@outlook.com>
Reviewed-by: Qiu Shumin <shumin.qiu@intel.com>
(cherry picked from commit f86a5c346578a9503f7383c6eb77ce256f33b605)
Diffstat (limited to 'ShellPkg/Library')
-rw-r--r-- | ShellPkg/Library/UefiShellBcfgCommandLib/UefiShellBcfgCommandLib.c | 18 |
1 files changed, 5 insertions, 13 deletions
diff --git a/ShellPkg/Library/UefiShellBcfgCommandLib/UefiShellBcfgCommandLib.c b/ShellPkg/Library/UefiShellBcfgCommandLib/UefiShellBcfgCommandLib.c index b407608d31..bf35a35b98 100644 --- a/ShellPkg/Library/UefiShellBcfgCommandLib/UefiShellBcfgCommandLib.c +++ b/ShellPkg/Library/UefiShellBcfgCommandLib/UefiShellBcfgCommandLib.c @@ -310,6 +310,7 @@ BcfgAdd( {
EFI_STATUS Status;
EFI_DEVICE_PATH_PROTOCOL *DevicePath;
+ EFI_DEVICE_PATH_PROTOCOL *DevPath;
EFI_DEVICE_PATH_PROTOCOL *FilePath;
CHAR16 *Str;
UINT8 *TempByteBuffer;
@@ -462,9 +463,9 @@ BcfgAdd( ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_BCFG_FILE_DP), gShellBcfgHiiHandle, L"bcfg", Arg->FullName);
ShellStatus = SHELL_UNSUPPORTED;
} else {
-/*
if (UsePath) {
- DevPath = DevicePath;
+ DevPath = DevicePath;
+ ShellStatus = SHELL_INVALID_PARAMETER;
while (!IsDevicePathEnd(DevPath)) {
if ((DevicePathType(DevPath) == MEDIA_DEVICE_PATH) &&
(DevicePathSubType(DevPath) == MEDIA_HARDDRIVE_DP)) {
@@ -472,24 +473,15 @@ BcfgAdd( //
// If we find it use it instead
//
- DevicePath = DevPath;
+ ShellStatus = SHELL_SUCCESS;
+ FilePath = DuplicateDevicePath (DevPath);
break;
}
DevPath = NextDevicePathNode(DevPath);
}
- //
- // append the file
- //
- for(StringWalker=Arg->FullName; *StringWalker != CHAR_NULL && *StringWalker != ':'; StringWalker++);
- FileNode = FileDevicePath(NULL, StringWalker+1);
- FilePath = AppendDevicePath(DevicePath, FileNode);
- FreePool(FileNode);
} else {
-*/
FilePath = DuplicateDevicePath(DevicePath);
-/*
}
-*/
FreePool(DevicePath);
}
}
|