summaryrefslogtreecommitdiffstats
path: root/ShellPkg/DynamicCommand
Commit message (Collapse)AuthorAgeFilesLines
* ShellPkg/DynamicCommand: add HttpDynamicCommandVladimir Olovyannikov2020-09-307-0/+2430
| | | | | | | | | | | | | | | | | | | | | | | | | | Introduce an http client utilizing EDK2 HTTP protocol, to allow fast image downloading from http/https servers. HTTP download speed is usually faster than tftp. The client is based on the same approach as tftp dynamic command, and uses the same UEFI Shell command line parameters. This makes it easy integrating http into existing UEFI Shell scripts. Note that to enable HTTP download, feature Pcd gEfiNetworkPkgTokenSpaceGuid.PcdAllowHttpConnections must be set to TRUE. BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=2860 Signed-off-by: Vladimir Olovyannikov <vladimir.olovyannikov@broadcom.com> Cc: Samer El-Haj-Mahmoud <Samer.El-Haj-Mahmoud@arm.com> Cc: Laszlo Ersek <lersek@redhat.com> Cc: Zhichao Gao <zhichao.gao@intel.com> Cc: Maciej Rabeda <maciej.rabeda@linux.intel.com> Cc: Jiaxin Wu <jiaxin.wu@intel.com> Cc: Siyuan Fu <siyuan.fu@intel.com> Cc: Ray Ni <ray.ni@intel.com> Cc: Liming Gao <liming.gao@intel.com> Cc: Nd <nd@arm.com> Reviewed-by: Zhichao Gao <zhichao.gao@intel.com> Tested-by: Laszlo Ersek <lersek@redhat.com>
* ShellPkg/DynamicCommand: Fix various typosAntoine Coeur2020-02-109-16/+16
| | | | | | | | | | | | Fix various typos in comments and documentation. Cc: Ray Ni <ray.ni@intel.com> Cc: Zhichao Gao <zhichao.gao@intel.com> Signed-off-by: Antoine Coeur <coeur@gmx.fr> Reviewed-by: Philippe Mathieu-Daude <philmd@redhat.com> Reviewed-by: Zhichao Gao <zhichao.gao@intel.com> Signed-off-by: Philippe Mathieu-Daude <philmd@redhat.com> Message-Id: <20200207010831.9046-69-philmd@redhat.com>
* ShellPkg: stop using EFI_HANDLE in place of EFI_HII_HANDLELaszlo Ersek2019-10-094-10/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The UefiShell*CommandsLib instances have constructor functions that do something like: gHiiHandle = HiiAddPackages (...); ... ShellCommandRegisterCommandName (..., gHiiHandle, ...); and destructor functions that implement the following pattern: HiiRemovePackages (gHiiHandle); The -- semantic, not functional -- problem is that "gHiiHandle" is declared with type EFI_HANDLE, and not EFI_HII_HANDLE, in all of these library instances, even though HiiAddPackages() correctly returns EFI_HII_HANDLE, and HiiRemovePackages() takes EFI_HII_HANDLE. Once we fix the type of "gHiiHandle", it causes sort of a butterfly effect, because it is passed around widely. Track down and update all of those locations. The DynamicCommand lib instances use a similar pattern, so they are affected too. NOTE: in practice, this patch is a no-op, as both EFI_HII_HANDLE and EFI_HANDLE are typedefs to (VOID*). However, we shouldn't use EFI_HANDLE where semantically EFI_HII_HANDLE is passed around. Cc: Jaben Carsey <jaben.carsey@intel.com> Cc: Ray Ni <ray.ni@intel.com> Cc: Zhichao Gao <zhichao.gao@intel.com> Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Philippe Mathieu-Daude <philmd@redhat.com> Reviewed-by: Zhichao Gao <zhichao.gao@intel.com>
* ShellPkg: Add NetworkPkg/NetworkPkg.dec as the package dependencyLiming Gao2019-05-212-2/+4
| | | | | | | | | | | NetLib will be moved from MdeModulePkg and NetworkPkg. So, the module that consumes NetLib need to depend on NetworkPkg.dec. Signed-off-by: Liming Gao <liming.gao@intel.com> Cc: Zhichao Gao <zhichao.gao@intel.com> Cc: Ray Ni <ray.ni@intel.com> Cc: Jaben Carsey <jaben.carsey@intel.com> Reviewed-by: Zhichao Gao <zhichao.gao@intel.com>
* ShellPkg: Replace BSD License with BSD+Patent LicenseMichael D Kinney2019-04-0919-129/+19
| | | | | | | | | | | | | | | | | | | | | https://bugzilla.tianocore.org/show_bug.cgi?id=1373 Replace BSD 2-Clause License with BSD+Patent License. This change is based on the following emails: https://lists.01.org/pipermail/edk2-devel/2019-February/036260.html https://lists.01.org/pipermail/edk2-devel/2018-October/030385.html RFCs with detailed process for the license change: V3: https://lists.01.org/pipermail/edk2-devel/2019-March/038116.html V2: https://lists.01.org/pipermail/edk2-devel/2019-March/037669.html V1: https://lists.01.org/pipermail/edk2-devel/2019-March/037500.html Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com> Reviewed-by: Ray Ni <ray.ni@intel.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
* ShellPkg/TftpDynamicCommand: Return proper statusVladimir Olovyannikov via edk2-devel2019-01-251-0/+6
| | | | | | | | | | | | | | Tftp command always returned "SHELL_NOT_FOUND" which is treated as an error by callers. Add missing line to clean the ShellStatus on successful operation. If operation has failed, return the error status if available. REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1487 Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Vladimir Olovyannikov <vladimir.olovyannikov@broadcom.com> Reviewed-by: Songpeng Li <songpeng.li@intel.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
* ShellPkg/TftpDynamicCommand: Change file writing method in tftpSongpeng Li2019-01-111-90/+64
| | | | | | | | | | | | | | | | | | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1433 v2: Remove an unused variable. Current logic of shell tftp download was writing file after tftp download finished, when the file is large, it looks like the shell tftp command hanged after download was finished. To improve end-user experience, the solution is using split file writing instead. This patch update the code to open and close file inside DownloadFile(), and save each packet to file within callback function CheckPacket(). Since AllocatePage() is no-longer needed, This patch can also remove the memory limitation. The download file can be larger than system free memory now. Cc: Jaben Carsey <jaben.carsey@intel.com> Cc: Ruiyu Ni <ruiyu.ni@intel.com> Cc: Wu Jiaxin <jiaxin.wu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Songpeng Li <songpeng.li@intel.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com> Reviewed-by: Wu Jiaxin <jiaxin.wu@intel.com>
* ShellPkg/TftpDynamicCommand: Clarify the retry count option in command.Jiaxin Wu2018-11-062-2/+7
| | | | | | | | | | | | | | | [-c <retry count>] is to define the number of times to transmit request packets and wait for a response. The default value is 6. But it doesn't specify the behavior of zero value. Here, The patch is to clear that: Set to zero also means to use the default value. Cc: Carsey Jaben <jaben.carsey@intel.com> Cc: Ye Ting <ting.ye@intel.com> Cc: Fu Siyuan <siyuan.fu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Wu Jiaxin <jiaxin.wu@intel.com> Reviewed-by: Fu Siyuan <siyuan.fu@intel.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
* ShellPkg/TftpDynamicCommand: Correct comments to align with the input parameter.Jiaxin Wu2018-10-091-0/+2
| | | | | | | | | | | | | | Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=1230 Cc: Carsey Jaben <jaben.carsey@intel.com> Cc: Fu Siyuan <siyuan.fu@intel.com> Cc: Ye Ting <ting.ye@intel.com> Cc: Bi Dandan <dandan.bi@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Wu Jiaxin <jiaxin.wu@intel.com> Reviewed-by: Dandan Bi <dandan.bi@intel.com> Reviewed-by: Fu Siyuan <siyuan.fu@intel.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
* ShellPkg/DpDynamicCommand: Remove unused PCDsshenglei2018-09-302-5/+0
| | | | | | | | | | | | | | | The PCDs below are unused, so they have been removed from inf. gEfiMdePkgTokenSpaceGuid.PcdUefiLibMaxPrintBufferSize in DpApp.inf gEfiMdePkgTokenSpaceGuid.PcdUefiLibMaxPrintBufferSize in DpDynamicCommand.inf Cc: Jaben Carsey <jaben.carsey@intel.com> Cc: Ruiyu Ni <ruiyu.ni@intel.com> Cc: Laszlo Ersek <lersek@redhat.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: shenglei <shenglei.zhang@intel.com> Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
* ShellPkg/TftpDynamicCommand: Fix the potentially uninitialized local ↵Jiaxin Wu2018-09-281-1/+2
| | | | | | | | | | | | | | | | | variable used. Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=1217 Local variable 'Mtftp4Token' might be uninitialized when error happen. This patch is to resolve the issue. Cc: Ye Ting <ting.ye@intel.com> Cc: Fu Siyuan <siyuan.fu@intel.com> Cc: Carsey Jaben <jaben.carsey@intel.com> Cc: Zeng Star <star.zeng@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Wu Jiaxin <jiaxin.wu@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com>
* ShellPkg DpDynamicCommand: Use new EfiLocateFirstAcpiTable()Star Zeng2018-09-275-139/+3
| | | | | | | | | | | | | | | | | | | | | | https://bugzilla.tianocore.org/show_bug.cgi?id=967 Request to add a library function for GetAcpiTable() in order to get ACPI table using signature as input. After evaluation, we found there are many duplicated code to find ACPI table by signature in different modules. This patch updates DpDynamicCommand to use new EfiLocateFirstAcpiTable() and remove the duplicated code. Cc: Younas khan <pmdyounaskhan786@gmail.com> Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Liming Gao <liming.gao@intel.com> Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Ruiyu Ni <ruiyu.ni@intel.com> Cc: Dandan Bi <dandan.bi@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
* ShellPkg/TftpDynamicCommand: Add one option for tftp command to specify ↵Jiaxin Wu2018-09-272-12/+59
| | | | | | | | | | | | | | | | | | | | | | | windowsize. Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=886 This patch is to define one new option for TFTP shell command to specify the windowsize option as defined in RFC 7440. Valid range is between 1 and 64, default value is 1. Note that: RFC 7440 does not mention max window size value, but for the stability reason, the value is limited to 64. Cc: Ye Ting <ting.ye@intel.com> Cc: Fu Siyuan <siyuan.fu@intel.com> Cc: Carsey Jaben <jaben.carsey@intel.com> Cc: Shao Ming <ming.shao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Wu Jiaxin <jiaxin.wu@intel.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com> Reviewed-by: Fu Siyuan <siyuan.fu@intel.com> Reviewed-by: Ye Ting <ting.ye@intel.com>
* ShellPkg/Dp: Cumulate the perf data of "DB:Stop"Dandan Bi2018-07-261-1/+2
| | | | | | | | | | | | | | | Currently DP tool will cumulate the performance data for Driver Binding Support/Start, will count the number they appears, and record the maximum/minimum time value... Now add Driver Binding Stop performance data to the cumulative data to keep consistency. Cc: Liming Gao <liming.gao@intel.com> Cc: Jaben Carsey <jaben.carsey@intel.com> Cc: Ruiyu Ni <ruiyu.ni@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Dandan Bi <dandan.bi@intel.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
* ShellPkg/TftpDynamicCommand: Fix the potential assertion and memory leak issue.Jiaxin Wu2018-07-131-1/+2
| | | | | | | | | | | | | | | | | This patch is to fix the issue reported from https://bugzilla.tianocore.org/show_bug.cgi?id=925. DataSize variable was not assigned the value if ShellOpenFileByName returns error. In the such a case, it should not be used to FreePages. Instead, DataSize can be used to record the file size once DownloadFile successfully. Cc: Ye Ting <ting.ye@intel.com> Cc: Fu Siyuan <siyuan.fu@intel.com> Cc: Jaben Carsey <jaben.carsey@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Wu Jiaxin <jiaxin.wu@intel.com> Reviewed-by: Fu Siyuan <siyuan.fu@intel.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
* ShellPkg/dp: Correct case of included filedann frazier2018-06-281-1/+1
| | | | | | | | | | Cc: Dandan Bi <dandan.bi@intel.com> Cc: Liming Gao <liming.gao@intel.com> Cc: Ruiyu Ni <ruiyu.ni@intel.com> Fixes: f45dd2dd4f1d6fab4bb62bfd5f4e71cb7849897d Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: dann frazier <dannf@debian.org> Reviewed-by: Dandan Bi <dandan.bi@intel.com>
* ShellPkg/DP: Add more check for input parametersDandan Bi2018-06-282-34/+77
| | | | | | | | | | | | | | | New added checkers includes: 1. Too many invalid parameters 2. Too few parameter 3. Invalid number parameter for -n and -t flag 4. Conflict parameter of -A and -R. Cc: Liming Gao <liming.gao@intel.com> Cc: Ruiyu Ni <ruiyu.ni@intel.com> Cc: Jaben Carsey <jaben.carsey@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Dandan Bi <dandan.bi@intel.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
* ShellPkg: Clean up source filesLiming Gao2018-06-285-103/+103
| | | | | | | | | | 1. Do not use tab characters 2. No trailing white space in one line 3. All files must end with CRLF Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
* ShellPkg/dp: Update dp tool to parse new Perf recordBi, Dandan2018-06-265-12/+113
| | | | | | | | | | | | | | | Since performance library instances have been updated to create new FPDT records for new Perf macros. So enhance dp tool to parse the new FPDT records. Enhancement mainly includes: 1. parse the single records for PERF_EVENT macro 2. Parse the new added FPDT_DUAL_GUID_STRING_EVENT_RECORD Cc: Liming Gao <liming.gao@intel.com> Cc: Ruiyu Ni <ruiyu.ni@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Dandan Bi <dandan.bi@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* ShellPkg/Dp: Make the help info align with codeDandan Bi2018-06-127-233/+26
| | | | | | | | | | | | | | | | | | Currently in DP, the Trace mode is enabled by default. And the profile mode is not implemented. but the help info of DP tool doesn't match current implementation. Which will make user confused. So now remove the unused source code related to the profile mode and update the help information of DP tool. V2: Remove the unused code related to profile mode. Cc: Liming Gao <liming.gao@intel.com> Cc: Ruiyu Ni <ruiyu.ni@intel.com> Cc: Jaben Carsey <jaben.carsey@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Dandan Bi <dandan.bi@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* ShellPkg/Dp: Initialize summary date when run DPDandan Bi2018-06-121-0/+23
| | | | | | | | | | | | | | | | | | Issue: When run "dp -s" or ("dp -v") command in shell several times, the summary reuslts are different each time. The root cause is that the previous global data "SummaryData" is not cleaned when the dp command is callled next time. This patch initializes the global data "SummaryData" when the dp dymanic command is called. Cc: Liming Gao <liming.gao@intel.com> Cc: Ruiyu Ni <ruiyu.ni@intel.com> Cc: Jaben Carsey <jaben.carsey@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Dandan Bi <dandan.bi@intel.com> Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
* ShellPkg/Dp: make sure memory is freed before exitDandan Bi2018-06-121-33/+37
| | | | | | | | | | | | | | | | | | | | Run dp command now: Firstly it will get performance records from FPDT and then parse the DP command. And if encounter invalid parameters, it will exit directly. Thus the performance records got before are invalid. And what's worse is that the memory allocated in getting performance records phase is not freed. This patch update the code to parse the command firstly and then get the performance records. And make sure that all the clean work has been done before exiting. Cc: Liming Gao <liming.gao@intel.com> Cc: Ruiyu Ni <ruiyu.ni@intel.com> Cc: Jaben Carsey <jaben.carsey@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Dandan Bi <dandan.bi@intel.com> Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
* ShellPkg/DP: Update the error message infoDandan Bi2018-02-092-2/+4
| | | | | | | | | | Make the error message clearer if fail to get ACPI/FPDT table. Cc: Liming Gao <liming.gao@intel.com> Cc: Jiewen Yao <jiewen.yao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Dandan Bi <dandan.bi@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* ShellPkg/Dp: Add null pointer checkBi, Dandan2018-02-091-1/+1
| | | | | | | | Cc: Liming Gao <liming.gao@intel.com> Cc: Hao Wu <hao.a.wu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Dandan Bi <dandan.bi@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* ShellPkg/Dp: Updated to dump perf log based on FPDT tableDandan Bi2018-02-0811-127/+724
| | | | | | | | | | Cc: Liming Gao <liming.gao@intel.com> Cc: Star Zeng <star.zeng@intel.com> Cc: Ruiyu Ni <ruiyu.ni@intel.com> Cc: Jaben Carsey <jaben.carsey@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Dandan Bi <dandan.bi@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* ShellPkg/tftp: Correct file comments header of Tftp.uniRuiyu Ni2017-11-291-2/+2
| | | | | | Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
* ShellPkg/DynamicCommand: Fix bug that cannot start in bootRuiyu Ni2017-11-292-0/+2
| | | | | | | | | | | | | When dynamic command drivers are built into FV and start during boot, they fails. Because Shell protocol doesn't exist during boot. The patch sets Shell protocol and also set PcdShellLibAutoInitialize to FALSE to ensure that 1. Shell protocol check doesn't happen in driver's entry point. 2. Driver can get the Shell protocol in DynamicCommand.Handler(). Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
* ShellPkg/dp: Convert from NULL class library to Dynamic CommandRuiyu Ni2017-11-2814-0/+2873
| | | | | | | | | | | | | | | | | | | | | | UEFI Shell spec defines Shell Dynamic Command protocol which is just for the purpose to extend internal command. So dp command is changed from NULL class library to be a driver producing DynamicCommand protocol. The guideline is: 1. Only use NULL class library for Shell spec defined commands. 2. New commands can be provided as not only a standalone application but also a dynamic command. So it can be used either as an internal command, but also as a standalone application. DpApp.inf is to provide a standalone application. DpDynamicCommand.inf is to provide a standalone driver producing Dynamic Command protocol. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com> Cc: Michael D Kinney <michael.d.kinney@intel.com>
* ShellPkg/tftp: Convert from NULL class library to Dynamic CommandRuiyu Ni2017-11-287-0/+1582
UEFI Shell spec defines Shell Dynamic Command protocol which is just for the purpose to extend internal command. So tftp command is changed from NULL class library to be a driver producing DynamicCommand protocol. The guideline is: 1. Only use NULL class library for Shell spec defined commands. 2. New commands can be provided as not only a standalone application but also a dynamic command. So it can be used either as an internal command, but also as a standalone application. TftpApp.inf is to provide a standalone application. TftpDynamicCommand.inf is to provide a standalone driver producing Dynamic Command protocol. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com> Cc: Michael D Kinney <michael.d.kinney@intel.com>