Commit Graph

570 Commits

Author SHA1 Message Date
Samer El-Haj-Mahmoud 2c328aca1d ShellPkg: Fix smbiosview decode of PCIe Extended Capabilities
Fix SMBIOSVIEW decode of the HeaderLog fields of the PCIe
AER structure . The PCIe 2.1 Base Specification, section 7.10, lists
this as 16 bytes, or 4 DWORDs.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Samer El-Haj-Mahmoud <elhaj@hpe.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
2016-03-04 11:07:50 -08:00
Jiaxin Wu 913ba15120 ShellPkg: Update 'ifconfig -r' implementation
This patch is used to update ifconfig -r implementation
to sync with UEFI Shell 2.2.

option -r means to reconfigure all or specified interface,
and set DHCP policy. If specified interface is already set
to DHCP, then refresh the IPv4 configuration.

If the interface name is specified
with '-r', DHCP DORA process will be triggered by the policy
transition (static -> dhcp).

Cc: Ye Ting <ting.ye@intel.com>
Cc: Fu Siyuan <siyuan.fu@intel.com>
Cc: Carsey Jaben <jaben.carsey@intel.com>
Cc: El-Haj-Mahmoud Samer <samer.el-haj-mahmoud@hpe.com>
Cc: Subramanian Sriram <sriram-s@hpe.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jiaxin Wu <jiaxin.wu@intel.com>
Reviewed-by: Sriram Subramanian <sriram-s@hpe.com>
Reviewed-by: Jaben Carsey <Jaben.carsey@intel.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
2016-03-03 15:27:24 +08:00
Jiaxin Wu db54ae0845 ShellPkg: Revert git 'd6cf1af9' fix
'd6cf1af9' is associated with '3d0a49ad' commit. So, this patch is
used to respond the revert for '3d0a49ad' to adapt the Ipv4 config
policy update.

Cc: Subramanian Sriram <sriram-s@hpe.com>
Cc: El-Haj-Mahmoud Samer <samer.el-haj-mahmoud@hpe.com>
Cc: Ye Ting <ting.ye@intel.com>
Cc: Fu Siyuan <siyuan.fu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jiaxin Wu <jiaxin.wu@intel.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
Reviewed-by: Ye Ting <ting.ye@intel.com>
2016-03-02 15:43:58 +08:00
Qiu Shumin fb9dd83225 ShellPkg: Fix unexpected behavior of mouse cursor in Editor.
USB mouse cursor cannot move unless the left button is down. The patch
refresh the FileBuffer of Editor every time when the 'MainEditorRefresh'
is called to fix this bug.

Cc: Jaben Carsey <jaben.carsey@intel.com>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Qiu Shumin <shumin.qiu@intel.com>
2016-02-27 14:49:07 +08:00
Qiu Shumin e3b76f3b5e ShellPkg: Do NULL pointer check before the pointer is used.
Do NULL pointer check before the pointer is used to avoid dereferenced.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Qiu Shumin <shumin.qiu@intel.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
2016-02-23 10:44:36 +08:00
Qiu Shumin f79d7b62ba ShellPkg: Fix the last command doesn't work in a script.
When the last line in a script file is not an empty line the Shell
will not execute the command in the last line. The patch refine the
logic in function 'ShellFileHandleReturnLine' and fix the issue.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Qiu Shumin <shumin.qiu@intel.com>
2016-02-19 15:00:57 +08:00
Cinnamon Shia 64c51ed181 ShellPkg/UefiDpLib: Refine the code of locating all handles in DpTrace.c.
Replace gBS->LocateHandle with gBS->LocateHandleBuffer

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Cinnamon Shia <cinnamon.shia@hpe.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Samer El-Haj-Mahmoud <elhaj@hpe.com>
2016-02-18 09:40:30 +08:00
Jim Dailey 1095b4323d ShellPkg: complete previous incomplete patch
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jim Dailey <Jim_Dailey@Dell.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
2016-02-10 13:17:56 -08:00
Jaben Carsey 3a01358bdb Merge branch 'master' of https://github.com/tianocore/edk2 2016-02-10 08:56:33 -08:00
Jim Dailey 2dda8a1232 ShellPkg: ShellFileHandleReadLine must return UCS2 lines.
An earlier change had this function returning the type of lines that were in
the file being read (ASCII or UCS2). The way it is used, UCS2 output is
expected, even when the file being read is ASCII. This change restores that
behavior and documents it.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jim Dailey <Jim_Dailey@Dell.com>
Tested-by: Ryan Harkin <ryan.harkin@linaro.org>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
2016-02-10 08:54:15 -08:00
jaben carsey 9ed21946c7 ShellPkg: Fix ASCII and UNICODE file pipes.
Fix various errors when piping a UNICODE or ASCII file to a simple shell application that reads standard input and writes it to standard output.

1) When the memory file is created by CreateFileInferfaceMem() to capture the pipe output, no UNICODE BOM is written to the memory file. Later, when the memory file is read by the application using ShellFileHandleReadLine(), the function indicates that the file is ASCII because there is no BOM.

2) If the file is piped as ASCII, the ASCII memory image is not correctly created by FileInterfaceMemWrite() as each ASCII character is followed by '\0' in the image (when the ASCII data is written to the memory image, the file position should only be incremented by half the buffer size).

3) ShellFileHandleReadLine() does not read ASCII files correctly (writes to Buffer need to be cast as CHAR8*).

4) FileInterfaceMemRead() and FileInterfaceMemWrite() as somewhat hard to read and difficult to debug with certain tools due to the typecasting of This. Added a local variable (MemFile) of the correct type to these functions and used it instead of This.

Enhancement: ShellFileHandleReadLine() now returns EFI_END_OF_FILE when appropriate.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jim Dailey <jim_dailey@dell.com>
reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
2016-02-09 13:22:14 -08:00
jaben carsey d2a0d2e6ac ShellPkg: Fix ASCII and UNICODE file pipes.
Fix various errors when piping a UNICODE or ASCII file to a simple shell application that reads standard input and writes it to standard output.

1) When the memory file is created by CreateFileInferfaceMem() to capture the pipe output, no UNICODE BOM is written to the memory file. Later, when the memory file is read by the application using ShellFileHandleReadLine(), the function indicates that the file is ASCII because there is no BOM.

2) If the file is piped as ASCII, the ASCII memory image is not correctly created by FileInterfaceMemWrite() as each ASCII character is followed by '\0' in the image (when the ASCII data is written to the memory image, the file position should only be incremented by half the buffer size).

3) ShellFileHandleReadLine() does not read ASCII files correctly (writes to Buffer need to be cast as CHAR8*).

4) FileInterfaceMemRead() and FileInterfaceMemWrite() as somewhat hard to read and difficult to debug with certain tools due to the typecasting of This. Added a local variable (MemFile) of the correct type to these functions and used it instead of This.

Enhancement: ShellFileHandleReadLine() now returns EFI_END_OF_FILE when appropriate.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jim Dailey <jim_dailey@dell.com>
reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
2016-02-08 15:59:04 -08:00
Qiu Shumin aed8c66dac ShellPkg: Refine the code to avoid use a constant number as offset.
Refine the code to use 'sizeof(EFI_LOAD_OPTION)' as offset in buffer to get 'description' instead of using a constant number.
This change makes the code more readable.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Qiu Shumin <shumin.qiu@intel.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19746 6f19259b-4bc3-4df7-8a09-765794883524
2016-01-26 08:17:19 +00:00
Laszlo Ersek af3e209f93 ShellPkg: UefiShellBcfgCommandLib: bump VERSION_STRING
The changes due to the previous patches should be reflected in a higher
minor version number.

Cc: Jaben Carsey <jaben.carsey@intel.com>
Cc: Ryan Harkin <ryan.harkin@linaro.org>
Suggested-by: Jaben Carsey <jaben.carsey@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19719 6f19259b-4bc3-4df7-8a09-765794883524
2016-01-21 18:40:48 +00:00
Laszlo Ersek 2de293cd96 ShellPkg: BcfgDisplayDump(): print optional data with DumpHex()
The DumpHex() function produces very friendly output (known from DMPSTORE,
for example); let's use it with "BCFG -v" as well.

Cc: Jaben Carsey <jaben.carsey@intel.com>
Cc: Ryan Harkin <ryan.harkin@linaro.org>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19718 6f19259b-4bc3-4df7-8a09-765794883524
2016-01-21 18:40:44 +00:00
Laszlo Ersek 3bd8960362 ShellPkg: elevate DumpHex() from Debug1-internal to generic-internal
The UEFI Shell specification classifies shell commands into various shell
levels / profiles.

Currently the DumpHex() internal function is only used by commands that
belong to the Debug1 profile exclusively (i.e., they are not required to
be present in other than Debug1 profiles):
- SMBIOSVIEW
- PCI
- DMPSTORE
- DMEM
- DBLK

In the next patch, we'd like to call DumpHex() from BCFG as well. However,
BCFG is not only required to be present in the Debug1 profile; the
Install1 profile contains BCFG as well. For this reason, move DumpHex()
from UefiShellDebug1CommandsLib to the more generic UefiShellCommandLib,
which "Provides interface to shell internal functions for shell commands".
The matching header file is "ShellPkg/Include/Library/ShellCommandLib.h".

Cc: Jaben Carsey <jaben.carsey@intel.com>
Cc: Ryan Harkin <ryan.harkin@linaro.org>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19717 6f19259b-4bc3-4df7-8a09-765794883524
2016-01-21 18:40:40 +00:00
Laszlo Ersek cf3c9b1884 ShellPkg: BcfgDisplayDump(): fix ShellPrintEx() call site
This is likely a copy & paste error from the preceding ShellPrintHiiEx()
function call. ShellPrintEx() takes no Language parameter, so remove the
NULL argument, which is currently misinterpreted as a format string.

This bug prevents the hexdump of optional data even when -v is passed to
BCFG, and optional data exist.

Cc: Jaben Carsey <jaben.carsey@intel.com>
Cc: Ryan Harkin <ryan.harkin@linaro.org>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19716 6f19259b-4bc3-4df7-8a09-765794883524
2016-01-21 18:40:35 +00:00
Laszlo Ersek 8989625304 ShellPkg: BcfgDisplayDump(): fix reporting of OptionalData
In this cleaned up form of BcfgDisplayDump(), it is easier to see that the

  OptionalDataOffset <= BufferSize

expression, used to report whether optional data are *absent*, is
incorrect. For any well-formed EFI_LOAD_OPTION, this inequality always
holds.

Optional data are present exactly if

  OptionalDataOffset < BufferSize

therefore the absence condition is the negation of the above,

  OptionalDataOffset >= BufferSize

This patch fixes the bug where BCFG always reports "Optional- N", even if
optional data exist.

Cc: Jaben Carsey <jaben.carsey@intel.com>
Cc: Ryan Harkin <ryan.harkin@linaro.org>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19715 6f19259b-4bc3-4df7-8a09-765794883524
2016-01-21 18:40:30 +00:00
Laszlo Ersek 5a5a659092 ShellPkg: BcfgDisplayDump(): calculate OptionalDataOffset explicitly
Eliminate some more repeated pointer arithmetic.

This patch too is only refactoring.

Cc: Jaben Carsey <jaben.carsey@intel.com>
Cc: Ryan Harkin <ryan.harkin@linaro.org>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19714 6f19259b-4bc3-4df7-8a09-765794883524
2016-01-21 18:40:26 +00:00
Laszlo Ersek 40de6483ec ShellPkg: BcfgDisplayDump(): eliminate FilePathList duplication
Copying and releasing each EFI_LOAD_OPTION.FilePathList under the name
DevPath is wasteful -- we only need FilePathList for a single conversion
to text. Do it directly from the EFI_LOAD_OPTION object.

This patch is not supposed to change observable behavior.

Cc: Jaben Carsey <jaben.carsey@intel.com>
Cc: Ryan Harkin <ryan.harkin@linaro.org>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19713 6f19259b-4bc3-4df7-8a09-765794883524
2016-01-21 18:40:22 +00:00
Laszlo Ersek 5dc03ade6a ShellPkg: BcfgDisplayDump(): call Description[Size] by name
Introduce two more helper variables to avoid repeated pointer arithmetic.

This patch is not supposed to change behavior.

Cc: Jaben Carsey <jaben.carsey@intel.com>
Cc: Ryan Harkin <ryan.harkin@linaro.org>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19712 6f19259b-4bc3-4df7-8a09-765794883524
2016-01-21 18:40:17 +00:00
Laszlo Ersek 3b6b1105cf ShellPkg: BcfgDisplayDump(): address FilePathListLength by name
The Buffer variable points at the beginning of an EFI_LOAD_OPTION
structure. We might as well address the "FilePathListLength" member by
name, rather than with *(UINT16*)(Buffer+4).

This patch is not supposed to change behavior.

Cc: Jaben Carsey <jaben.carsey@intel.com>
Cc: Ryan Harkin <ryan.harkin@linaro.org>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19711 6f19259b-4bc3-4df7-8a09-765794883524
2016-01-21 18:40:13 +00:00
Laszlo Ersek e5945ef784 ShellPkg: BcfgDisplayDump(): enforce minimum size for Boot#### and co.
"3.1.1 Boot Manager Programming" in the UEFI 2.5 spec mandates that
Boot#### and similar options contain EFI_LOAD_OPTION structures. The
EFI_LOAD_OPTION structure encodes the fixed initial part of the payload,
and we can (and should) use it to enforce a minimum size for variable
contents.

This patch is meant as a safety improvement.

Cc: Jaben Carsey <jaben.carsey@intel.com>
Cc: Ryan Harkin <ryan.harkin@linaro.org>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19710 6f19259b-4bc3-4df7-8a09-765794883524
2016-01-21 18:40:09 +00:00
Laszlo Ersek 8f2c09f8b2 ShellPkg: BcfgDisplayDump(): accumulate errors
Don't exit the command immediately when a variable access fails; continue
processing after printing the error message. Let the final return status
reflect any encountered errors.

This patch is intended as a functional improvement.

Cc: Jaben Carsey <jaben.carsey@intel.com>
Cc: Ryan Harkin <ryan.harkin@linaro.org>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19709 6f19259b-4bc3-4df7-8a09-765794883524
2016-01-21 18:40:05 +00:00
Laszlo Ersek 43da602cb4 ShellPkg: BcfgDisplayDump(): hoist NULL-init of DevPath[String]
It will help with error handling if we move these initializations near the
top of the loop body.

This patch is not supposed to change behavior.

Cc: Jaben Carsey <jaben.carsey@intel.com>
Cc: Ryan Harkin <ryan.harkin@linaro.org>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19708 6f19259b-4bc3-4df7-8a09-765794883524
2016-01-21 18:40:00 +00:00
Laszlo Ersek c7e97f6d44 ShellPkg: UefiShellBcfgCommandLib: drop unused string tokens
STR_GEN_PROBLEM_VAL, STR_GEN_TOO_MANY, and STR_BCFG_LOCATION_RANGE are not
used in the C source code. Remove them to decrease clutter.

Cc: Jaben Carsey <jaben.carsey@intel.com>
Cc: Ryan Harkin <ryan.harkin@linaro.org>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19707 6f19259b-4bc3-4df7-8a09-765794883524
2016-01-21 18:39:56 +00:00
Laszlo Ersek 15f8a738dd ShellPkg: BcfgDisplayDump(): update whitespace & layout
This patch incurs no functional changes, it just modifies some whitespace,
so we can separate these non-functional changes from the functional
changes in the next patches.

Cc: Jaben Carsey <jaben.carsey@intel.com>
Cc: Ryan Harkin <ryan.harkin@linaro.org>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19706 6f19259b-4bc3-4df7-8a09-765794883524
2016-01-21 18:39:52 +00:00
Star Zeng 3b672240e6 ShellPkg UefiDpLib: Use Image->FilePath to get name for SMM drivers
This enhancement is to use the FilePath field in the loaded image
protocol to find the name of an image as a fallback for when the
loaded image device path protocol is not installed on the image handle.
This is necessary because the SMM core does not install the loaded
image device path protocol, so DP was displaying "Unknown Driver Name"
for every SMM driver.

Cc: Liming Gao <liming.gao@intel.com>
Cc: Jaben Carsey <jaben.carsey@intel.com>
Cc: Shumin Qiu <shumin.qiu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19683 6f19259b-4bc3-4df7-8a09-765794883524
2016-01-19 09:19:37 +00:00
Tapan Shah ccdf8bcfe4 ShellPkg: Update 'dh' command to reflect correct driver handle information
'dh' command shows Supported EFI Specification Version value as DriverVersion. Changing it to 'SupportedEfiSpecVersion' to provide more accurate information.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Tapan Shah <tapandshah@hpe.com>
Reviewed-by: Samer El-Haj-Mahmoud <elhaj@hpe.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19648 6f19259b-4bc3-4df7-8a09-765794883524
2016-01-15 17:05:18 +00:00
Tapan Shah e49ecad0fa ShellPkg: Clean-up 'map' command error message handling
Refactor 'map' command error handling code and add standard error message

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Tapan Shah <tapandshah@hpe.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19616 6f19259b-4bc3-4df7-8a09-765794883524
2016-01-07 22:01:28 +00:00
Laszlo Ersek bdc063e134 Revert "ShellPkg : Add UEFI_APPLICATION module type to UefiShellInstall1CommandsLib.inf"
SVN r19585 broke the OVMF build:

> ShellPkg/Library/UefiShellInstall1CommandsLib/UefiShellInstall1CommandsLib.inf(20):
> error 3001: MODULE_TYPE UEFI_DRIVER UEFI_APPLICATION is not supported
> for EDK II, valid values are:
>  BASE SEC PEI_CORE PEIM DXE_CORE DXE_DRIVER DXE_RUNTIME_DRIVER
>  DXE_SAL_DRIVER DXE_SMM_DRIVER UEFI_DRIVER UEFI_APPLICATION USER_DEFINED
>  SMM_CORE

Revert the patch.

Reported-by: Laszlo Ersek <lersek@redhat.com>
Suggested-by: "El-Haj-Mahmoud, Samer" <samer.el-haj-mahmoud@hpe.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19610 6f19259b-4bc3-4df7-8a09-765794883524
2016-01-06 16:23:20 +00:00
Qiu Shumin 7f9c4a515a ShellPkg: Make 'alias' can display a single alias name.
When we run command "alias cat" Shell print out "alias: Too few arguments". This patch makes value of single alias name can be displayed.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Qiu Shumin <shumin.qiu@intel.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19608 6f19259b-4bc3-4df7-8a09-765794883524
2016-01-06 07:43:58 +00:00
Qiu Shumin 10e547ac2d ShellPkg: Fix Shell assert when mv a file to a NULL target.
When run command 'mv file ' the Shell assert. The patch refined the length of the buffer to fix this bug.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Qiu Shumin <shumin.qiu@intel.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19607 6f19259b-4bc3-4df7-8a09-765794883524
2016-01-06 07:40:56 +00:00
Samer El-Haj-Mahmoud 76f9e333b4 ShellPkg : Add UEFI_APPLICATION module type to UefiShellInstall1CommandsLib.inf
Using UEFI_APPLICATION for all Shell app and libraries allows the use of
different compiler flags for the Shell application itself and for other
applications that are built separately that use Shell libraries.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Samer El-Haj-Mahmoud <elhaj@hpe.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19585 6f19259b-4bc3-4df7-8a09-765794883524
2016-01-05 23:17:18 +00:00
Yao Jiewen 990046ca42 ShellPkg: Fix memory leak in function'ShellCommandConsistMappingInitialize'.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Yao Jiewen <Jiewen.Yao@intel.com>
Reviewed-by: Qiu Shumin <shumin.qiu@intel.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19528 6f19259b-4bc3-4df7-8a09-765794883524
2015-12-25 01:46:02 +00:00
Yao Jiewen c8cfd83ae8 ShellPkg: Fix memory leak in function 'ShellCommandCreateInitialMappingsAndPaths'.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Yao Jiewen <Jiewen.Yao@intel.com>
Reviewed-by: Qiu Shumin <shumin.qiu@intel.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19527 6f19259b-4bc3-4df7-8a09-765794883524
2015-12-25 01:41:38 +00:00
Yao Jiewen 5b77132c8f ShellPkg: Fix memory leak in function'ShellCommandRunHelp'.
When run help command Shell may have memory leak. This patch fix this bug.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Yao Jiewen <Jiewen.Yao@intel.com>
Reviewed-by: Qiu Shumin <shumin.qiu@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19526 6f19259b-4bc3-4df7-8a09-765794883524
2015-12-25 01:33:53 +00:00
Yao Jiewen dd17e3feb7 ShellPkg: Fix memory leak in 'ShellOpenFileByName'.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Yao Jiewen <Jiewen.Yao@intel.com>
Reviewed-by: Qiu Shumin <shumin.qiu@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19524 6f19259b-4bc3-4df7-8a09-765794883524
2015-12-25 01:24:16 +00:00
Samer El-Haj-Mahmoud 256aa6d04a ShellPkg: Add AIP IPv6 UNDI support to Shell dh
Update Shell DH command to decode and print the value of gEfiAdapterInfoUndiIpv6SupportGuid AIP instance.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Samer El-Haj-Mahmoud <elhaj@hpe.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19437 6f19259b-4bc3-4df7-8a09-765794883524
2015-12-22 02:13:18 +00:00
Qiu Shumin 3c8b6a5479 ShellPkg: Fix the 'bcfg' command ASSERT when use some invalid parameters.
'bcfg boot mv xx yy' command will ASSET when xx is larger than the count of boot options.
This patch correct the order of ShellPrintHiiEx parameters to fix the bugs.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Qiu Shumin <shumin.qiu@intel.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>


git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19295 6f19259b-4bc3-4df7-8a09-765794883524
2015-12-16 03:18:02 +00:00
Samer El-Haj-Mahmoud 0465b25e2a ShellPkg: Use %p for smbiosview SMBIOS table addresses.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Samer El-Haj-Mahmoud <elhaj@hpe.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19293 6f19259b-4bc3-4df7-8a09-765794883524
2015-12-16 02:58:05 +00:00
Samer El-Haj-Mahmoud 65e5838287 ShellPkg: Fix a bug in smbiosview PowerSupply Characteristics.
Fix bit shifting when isolating the Characteristics of Power Supply information.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Samer El-Haj-Mahmoud <elhaj@hpe.com>
Reviewed-by: Qiu Shumin <shumin.qiu@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19291 6f19259b-4bc3-4df7-8a09-765794883524
2015-12-16 02:14:05 +00:00
Michael Kinney f87b742ab4 ShellPkg/Mm: Fix build warnings
Fix build warnings for potentially uninitialized local variables
in the functions ShellMmLocateIoProtocol() and ShellCommandRunMm()
in the Shell implementation of the 'mm' command.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Michael Kinney <michael.d.kinney@intel.com>
Reviewed-by: Feng Tian <feng.tian@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19233 6f19259b-4bc3-4df7-8a09-765794883524
2015-12-14 06:03:58 +00:00
Qiu Shumin 02d3482574 ShellPkg: Initialize the local pointer to avoid potential suspicious dereference.
1. Initialize the local pointer 'HandleBuffer'.
2. When 'LocateHandleBuffer' return error 'HandleBuffer' is expected unchanged, add code make sure this.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Qiu Shumin <shumin.qiu@intel.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19229 6f19259b-4bc3-4df7-8a09-765794883524
2015-12-13 08:44:49 +00:00
Jiaxin Wu d1baf355b1 ShellPkg: Fix ifconfig hang issue with incomplete parameters
This patch is used to fix ifconfig hang issue with incomplete
parameters. In addition, some error related output information
is added to increase the interactivity.

Cc: Leekha Shaveta <shaveta@freescale.com>
Cc: Carsey Jaben <jaben.carsey@intel.com>
Cc: Ye Ting <ting.ye@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jiaxin Wu <jiaxin.wu@intel.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
Tested-by: Leekha Shaveta <shaveta@freescale.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19212 6f19259b-4bc3-4df7-8a09-765794883524
2015-12-10 10:59:29 +00:00
Ruiyu Ni 304316f430 ShellPkg/mm: Fix mm to support multiple root bridge platform
In multiple root bridge platforms, different root bridges may
share the same segment but occupy different range of buses,
or may occupy different segments.
The fix is to find the correct root bridge IO instance by
comparing not only the segment but also the bus ranges.
It tries to access the MMIO and IO in the following order:
PciRootBridgeIo, CpuIo and direct IO.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Michael Kinney <michael.d.kinney@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19181 6f19259b-4bc3-4df7-8a09-765794883524
2015-12-10 04:18:35 +00:00
Ruiyu Ni 25e34a2df4 ShellPkg/mm: Fix the help message to align to implementation and spec
The implementation is already aligned to spec.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19180 6f19259b-4bc3-4df7-8a09-765794883524
2015-12-10 04:17:59 +00:00
Jaben Carsey c2788f1c2b ShellPkg: Make 'dh' support showing all spec defined protocols.
When using 'dh' to dump all protocols installed on a handle, some of
them are shown as 'UnknownDevice'.

Device patch make 'dh' support all spec defined protocols.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Qiu Shumin <shumin.qiu@intel.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Samer El-Haj-Mahmoud <samer.el-haj-mahmoud@hpe.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19177 6f19259b-4bc3-4df7-8a09-765794883524
2015-12-09 23:08:07 +00:00
Jordan Justen e329f98b86 ShellPkg: Convert all .uni files to utf-8
To convert these files I ran:

$ python3 BaseTools/Scripts/ConvertUni.py ShellPkg

Cc: Jaben Carsey <jaben.carsey@intel.com>
Cc: Shumin Qiu <shumin.qiu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19176 6f19259b-4bc3-4df7-8a09-765794883524
2015-12-09 23:07:58 +00:00
Qiu Shumin e9fc538781 ShellPkg: Refine the code to reduce time cost of 'map -r'
In some platform 'map -r' may cost more than 1 min. This patch filter the target handles by
BlockIO and SimpleFileSystem protocol to reduce the time cost.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Qiu Shumin <shumin.qiu@intel.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19149 6f19259b-4bc3-4df7-8a09-765794883524
2015-12-08 02:00:16 +00:00