]> git.proxmox.com Git - mirror_edk2.git/commitdiff
ShellPkg/Bcfg: Add support for 'addp' command.
authorQiu Shumin <shumin.qiu@intel.com>
Fri, 20 May 2016 04:48:44 +0000 (12:48 +0800)
committerQiu Shumin <shumin.qiu@intel.com>
Fri, 20 May 2016 06:16:49 +0000 (14:16 +0800)
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>
ShellPkg/Library/UefiShellBcfgCommandLib/UefiShellBcfgCommandLib.c

index b407608d315405790484aef380f9a5aa9ce74914..bf35a35b985d00e32af4e4aa5d1cb285c7e9a014 100644 (file)
@@ -310,6 +310,7 @@ BcfgAdd(
 {\r
   EFI_STATUS                Status;\r
   EFI_DEVICE_PATH_PROTOCOL  *DevicePath;\r
+  EFI_DEVICE_PATH_PROTOCOL  *DevPath;\r
   EFI_DEVICE_PATH_PROTOCOL  *FilePath;\r
   CHAR16                    *Str;\r
   UINT8                     *TempByteBuffer;\r
@@ -462,9 +463,9 @@ BcfgAdd(
           ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_BCFG_FILE_DP), gShellBcfgHiiHandle, L"bcfg", Arg->FullName);  \r
           ShellStatus = SHELL_UNSUPPORTED;\r
         } else {\r
-/*\r
           if (UsePath) {\r
-            DevPath = DevicePath;\r
+            DevPath     = DevicePath;\r
+            ShellStatus = SHELL_INVALID_PARAMETER;\r
             while (!IsDevicePathEnd(DevPath)) {\r
               if ((DevicePathType(DevPath) == MEDIA_DEVICE_PATH) &&\r
                 (DevicePathSubType(DevPath) == MEDIA_HARDDRIVE_DP)) {\r
@@ -472,24 +473,15 @@ BcfgAdd(
                 //\r
                 // If we find it use it instead\r
                 //\r
-                DevicePath = DevPath;\r
+                ShellStatus = SHELL_SUCCESS;\r
+                FilePath    = DuplicateDevicePath (DevPath);\r
                 break;\r
               }\r
               DevPath = NextDevicePathNode(DevPath);\r
             }\r
-            //\r
-            // append the file\r
-            //\r
-            for(StringWalker=Arg->FullName; *StringWalker != CHAR_NULL && *StringWalker != ':'; StringWalker++);\r
-            FileNode = FileDevicePath(NULL, StringWalker+1);\r
-            FilePath = AppendDevicePath(DevicePath, FileNode);\r
-            FreePool(FileNode);\r
           } else {\r
-*/\r
             FilePath = DuplicateDevicePath(DevicePath);\r
-/*\r
           }\r
-*/\r
           FreePool(DevicePath);\r
         }\r
       }\r