From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-it0-x233.google.com (mail-it0-x233.google.com [IPv6:2607:f8b0:4001:c0b::233]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 1FC6681EB6 for ; Wed, 16 Nov 2016 08:13:32 -0800 (PST) Received: by mail-it0-x233.google.com with SMTP id b123so60504421itb.0 for ; Wed, 16 Nov 2016 08:13:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=semihalf-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=EJKvJAohbWoYhfDCdAYPGfAQWcemcg+Llf47yri+nE0=; b=dc9CkqvUAm86Rt2E/W8wyxU0HvSPWRfOjaDy2PIl3Jh4L+bTc+l16jIEVnZXTZu0Lz afkKFGo0yTlPrqWv8oxRAdmnwnN+XrsvMs4dDuHuU58m8brIdbR99HnMyFzEzHf82z59 tFCxd8vhwr4mGD6+VN2LKzsGyrf+C1uO9LyMmR6PHbzf6nxYGl4RfQ+uZf/i3hGXDTp5 nsErEHoHs5nbREutThkVGJ2bnGKGZkd0QyhRxqKDKyFLYxvlFnNQCt7sWJGH5ntwmf1V IRz8RHTF3elGE5yesbvGc+ZFXZC6+omek1KWOcOqMuGAlPQ0xjX+nmbBUw3He3RKr3te LNRw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=EJKvJAohbWoYhfDCdAYPGfAQWcemcg+Llf47yri+nE0=; b=h57Eu08qRMeNqwmattmpdM71twzMhBqo2WYfH7BCXabrjFVWCBg0voAX6Py3R1IYfZ v+iBU6Zwwvw/ohflzHSQ2Zjr+jTaDn1r8X01PkPn0Ju4AjmqhgDflfoqghZMenL+Isj8 X+nYSo/71z7HvVfauLs1dboVCc0GO7Al+lgilrKyWvvJ5rStulf0Ph46tpd639A6ZATH wYbggyJBUzhoRcsAJ/DbyIhHPGg9xQZ7DUnMa3GIZU3OoB428rvtXo2sxG5fgJW9IQ99 xwnkIPoojI4FeYZQhKB9GoxIISFZZxrbc2Gq91GxtRWznN/ofMnqlfrY/KAqz42z/ZWd u7cA== X-Gm-Message-State: ABUngvf/gopgLOml4WDqqPiAubhZmWT2Z7Yik4MvxRsvde6imYKJZLNZKM2Saa1hxNOjokaCW4IGD3ByYohRRA== X-Received: by 10.107.18.96 with SMTP id a93mr3543621ioj.144.1479312786347; Wed, 16 Nov 2016 08:13:06 -0800 (PST) MIME-Version: 1.0 Received: by 10.107.25.140 with HTTP; Wed, 16 Nov 2016 08:13:05 -0800 (PST) In-Reply-To: References: <1468110107-18979-1-git-send-email-mw@semihalf.com> <1468110107-18979-22-git-send-email-mw@semihalf.com> From: Marcin Wojtas Date: Wed, 16 Nov 2016 17:13:05 +0100 Message-ID: To: Ard Biesheuvel Cc: linaro-uefi , Leif Lindholm , Neta Zur Hershkovits , Yehuda Yitschak , Haim Boot , =?UTF-8?B?SmFuIETEhWJyb8Wb?= , Bartosz Szczepanek , edk2-devel-01 , "Carsey, Jaben" , ruiyu.ni@intel.com Subject: Re: [PATCH v6 21/23] Applications/FirmwareUpdate: Add 'fupdate' comand to shell X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Nov 2016 16:13:32 -0000 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable + Jaben, Ruiyu and edk2 list Hi Ard, Internal Shell header ("../../../ShellPkg/Application/Shell/Shell.h") was added ONLY for being able to execute shell commands (tftp and our custom SPI flash control) from within a new command. This is now done with: RunShellCommand (TftpCmd, &Status); And it works fine. Replacing above with: ShellExecute (&ImageHandle, TftpCmd, FALSE, NULL, &Status); allow to get rid of relative include and seems more appropriate, but there is completely no effect of calling it. I checked in edk2 sources and see no relation between above problem and registering our command with help of ShellDynamicCommand protocol. Unless I don't know something. Anyway, I'll apreciate any hint, how to solve the issue in a nice way. Best regards, Marcin 2016-11-15 17:09 GMT+01:00 Ard Biesheuvel : > On 10 July 2016 at 00:21, Marcin Wojtas wrote: >> From: Jan D=C4=85bro=C5=9B >> >> 'fupdate' command performs updating firmware from file placed on local >> filesystem or on TFTP server. >> It uses tftp and sf commands. >> >> Contributed-under: TianoCore Contribution Agreement 1.0 >> Signed-off-by: Jan Dabros >> Signed-off-by: Marcin Wojtas > > Please use the Shell dynamic command protocol to add commands to the > shell. This will remove the need for including internal Shell headers, > and even allow your commands to work with prebuilt Shell binaries. > > MdePkg/Include/Protocol/ShellDynamicCommand.h > > Thanks, > Ard. > > >> --- >> Applications/FirmwareUpdate/FUpdate.c | 448 +++++++++++++++++++++++++= +++++++ >> Applications/FirmwareUpdate/FUpdate.inf | 68 +++++ >> Applications/FirmwareUpdate/FUpdate.uni | Bin 0 -> 5838 bytes >> Platforms/Marvell/Marvell.dec | 1 + >> 4 files changed, 517 insertions(+) >> create mode 100644 Applications/FirmwareUpdate/FUpdate.c >> create mode 100644 Applications/FirmwareUpdate/FUpdate.inf >> create mode 100644 Applications/FirmwareUpdate/FUpdate.uni >> >> diff --git a/Applications/FirmwareUpdate/FUpdate.c b/Applications/Firmwa= reUpdate/FUpdate.c >> new file mode 100644 >> index 0000000..359a4ac >> --- /dev/null >> +++ b/Applications/FirmwareUpdate/FUpdate.c >> @@ -0,0 +1,448 @@ >> +/**********************************************************************= ********* >> +Copyright (C) 2016 Marvell International Ltd. >> + >> +Marvell BSD License Option >> + >> +If you received this File from Marvell, you may opt to use, redistribut= e and/or >> +modify this File under the following licensing terms. >> +Redistribution and use in source and binary forms, with or without modi= fication, >> +are permitted provided that the following conditions are met: >> + >> +* Redistributions of source code must retain the above copyright notice= , >> + this list of conditions and the following disclaimer. >> + >> +* Redistributions in binary form must reproduce the above copyright >> + notice, this list of conditions and the following disclaimer in the >> + documentation and/or other materials provided with the distribution. >> + >> +* Neither the name of Marvell nor the names of its contributors may be >> + used to endorse or promote products derived from this software withou= t >> + specific prior written permission. >> + >> +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS= IS" AND >> +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE I= MPLIED >> +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE >> +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LI= ABLE FOR >> +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL = DAMAGES >> +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERV= ICES; >> +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED= AND ON >> +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT >> +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE O= F THIS >> +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. >> + >> +***********************************************************************= ********/ >> +#include >> +#include >> + >> +#include >> +#include >> +#include >> +#include >> +#include >> +#include >> +#include >> +#include >> +#include >> +#include >> +#include >> +#include >> +#include >> +// FIXME: Remove including relative path >> +#include "../../../ShellPkg/Application/Shell/Shell.h" >> + >> +#define CMD_NAME_STRING L"fupdate" >> + >> +#define TFTP_CMD_STRING L"tftp " >> +#define SPACE_STRING L" " >> +#define SF_PROBE_CMD_STRING L"sf probe" >> +#define SF_WRITE_CMD_STRING L"sf updatefile " >> +#define SF_LOAD_ADDR_STRING L"0x0" >> + >> +#define MAIN_HDR_MAGIC 0xB105B002 >> + >> +typedef struct { >> + UINT32 Magic; // 0-3 >> + UINT32 PrologSize; // 4-7 >> + UINT32 PrologChecksum; // 8-11 >> + UINT32 BootImageSize; // 12-15 >> + UINT32 BootImageChecksum; // 16-19 >> + UINT32 Reserved0; // 20-23 >> + UINT32 LoadAddr; // 24-27 >> + UINT32 ExecAddr; // 28-31 >> + UINT8 UartConfig; // 32 >> + UINT8 Baudrate; // 33 >> + UINT8 ExtCount; // 34 >> + UINT8 AuxFlags; // 35 >> + UINT32 IoArg0; // 36-39 >> + UINT32 IoArg1; // 40-43 >> + UINT32 IoArg2; // 43-47 >> + UINT32 IoArg3; // 48-51 >> + UINT32 Reserved1; // 52-55 >> + UINT32 Reserved2; // 56-59 >> + UINT32 Reserved3; // 60-63 >> +} MV_IMAGE_HEADER; >> + >> +STATIC >> +UINT32 >> +CountChecksum ( >> + UINT32 *Start, >> + UINT32 Length >> + ) >> +{ >> + UINT32 Sum =3D 0; >> + UINT32 *Startp =3D Start; >> + >> + do { >> + Sum +=3D *Startp; >> + Startp++; >> + Length -=3D 4; >> + } while (Length > 0); >> + >> + return Sum; >> +} >> + >> +STATIC >> +EFI_STATUS >> +CheckImageHeader ( >> + IN VOID *ImageHeader >> + ) >> +{ >> + MV_IMAGE_HEADER *Header; >> + UINT32 HeaderLength, Checksum, ChecksumBackup; >> + >> + Header =3D (MV_IMAGE_HEADER *) ImageHeader; >> + HeaderLength =3D Header->PrologSize; >> + ChecksumBackup =3D Header->PrologChecksum; >> + >> + // Compare magic number >> + if (Header->Magic !=3D MAIN_HDR_MAGIC) { >> + Print (L"%s: Bad Image magic 0x%08x !=3D 0x%08x\n", CMD_NAME_STRING= , >> + Header->Magic, MAIN_HDR_MAGIC); >> + return EFI_DEVICE_ERROR; >> + } >> + >> + // The checksum field is discarded from calculation >> + Header->PrologChecksum =3D 0; >> + >> + Checksum =3D CountChecksum((UINT32 *)Header, HeaderLength); >> + if (Checksum !=3D ChecksumBackup) { >> + Print (L"%s: Bad Image checksum. 0x%x !=3D 0x%x\n", CMD_NAME_STRING= , Checksum, >> + ChecksumBackup); >> + return EFI_DEVICE_ERROR; >> + } >> + >> + // Restore checksum backup >> + Header->PrologChecksum =3D ChecksumBackup; >> + >> + return 0; >> +} >> + >> +STATIC >> +EFI_STATUS >> +CheckFirmwareImage ( >> + CONST CHAR16* FirmwareImage >> + ) >> +{ >> + EFI_STATUS Status; >> + VOID *FileBuffer; >> + UINT64 OpenMode; >> + UINTN FileSize; >> + SHELL_FILE_HANDLE FileHandle =3D NULL; >> + >> + OpenMode =3D EFI_FILE_MODE_READ; >> + >> + Status =3D ShellOpenFileByName (FirmwareImage, &FileHandle, OpenMode,= 0); >> + if (EFI_ERROR (Status)) { >> + Print (L"%s: Cannot open Image file\n", CMD_NAME_STRING); >> + return EFI_DEVICE_ERROR; >> + } >> + >> + Status =3D FileHandleGetSize (FileHandle, &FileSize); >> + if (EFI_ERROR (Status)) { >> + Print (L"%s: Cannot get Image file size\n", CMD_NAME_STRING); >> + } >> + >> + FileBuffer =3D AllocateZeroPool (FileSize); >> + >> + // Read Image header into buffer >> + Status =3D FileHandleRead (FileHandle, &FileSize, FileBuffer); >> + if (EFI_ERROR (Status)) { >> + Print (L"%s: Cannot read Image file header\n", CMD_NAME_STRING); >> + ShellCloseFile (&FileHandle); >> + FreePool (FileBuffer); >> + return EFI_DEVICE_ERROR; >> + } >> + >> + Status =3D CheckImageHeader (FileBuffer); >> + if (EFI_ERROR(Status)) { >> + return EFI_DEVICE_ERROR; >> + } >> + >> + FreePool (FileBuffer); >> + >> + return EFI_SUCCESS; >> +} >> + >> +STATIC >> +CONST CHAR16 * >> +FileNameFromFilePath ( >> + CONST CHAR16 *RemoteFilePath >> + ) >> +{ >> + CONST CHAR16 *Walker; >> + >> + // Gather FileName from FilePath >> + Walker =3D RemoteFilePath + StrLen (RemoteFilePath); >> + while ((--Walker) >=3D RemoteFilePath) { >> + if ((*Walker =3D=3D L'\\') || (*Walker =3D=3D L'/')) { >> + break; >> + } >> + } >> + >> + return (Walker + 1); >> +} >> + >> +STATIC >> +CONST CHAR16* >> +PrepareFile ( >> + LIST_ENTRY *CheckPackage >> + ) >> +{ >> + EFI_STATUS Status; >> + CONST CHAR16 *ValueStr; >> + >> + ValueStr =3D ShellCommandLineGetValue (CheckPackage, L"-f"); >> + if (ValueStr =3D=3D NULL) { >> + Print (L"%s: No LocalFilePath parameter!\n", CMD_NAME_STRING); >> + return NULL; >> + } else { >> + Status =3D ShellIsFile (ValueStr); >> + if (EFI_ERROR(Status)) { >> + Print (L"%s: Wrong LocalFilePath parameter!\n", CMD_NAME_STRING); >> + return NULL; >> + } >> + } >> + return ValueStr; >> +} >> + >> +CONST CHAR16 gShellFUpdateFileName[] =3D L"ShellCommand"; >> +EFI_HANDLE gShellFUpdateHiiHandle =3D NULL; >> +EFI_HANDLE gShellFUpdateHiiHandle; >> + >> +STATIC CONST SHELL_PARAM_ITEM ParamList[] =3D { >> + {L"help", TypeFlag}, >> + {L"-t", TypeFlag}, >> + {L"-f", TypeValue}, >> + {NULL , TypeMax} >> + }; >> + >> +/** >> + Return the file name of the help text file if not using HII. >> + >> + @return The string pointer to the file name. >> +**/ >> +CONST CHAR16* >> +EFIAPI >> +ShellCommandGetManFileNameFUpdate ( >> + VOID >> + ) >> +{ >> + >> + return gShellFUpdateFileName; >> +} >> + >> +VOID >> +FUpdateUsage ( >> + VOID >> + ) >> +{ >> + Print (L"\nFirmware update command\n" >> + "fupdate [-f ] [-t ]\n\n= " >> + "LocalFilePath - path to local firmware image file\n" >> + "Host - IP number of TFTP server\n" >> + "RemoteFilePath - path to firmware image file on TFTP server\n= " >> + "Examples:\n" >> + "Update firmware from file fs2:Uefi.img\n" >> + " fupdate -f fs2:Uefi.img\n" >> + "Update firmware from file path/Uefi.img TFTP server with IP " >> + "address 10.0.0.200\n" >> + " fupdate -t 10.0.0.200 path/Uefi.img\n" >> + ); >> +} >> + >> +SHELL_STATUS >> +EFIAPI >> +ShellCommandRunFUpdate ( >> + IN EFI_HANDLE ImageHandle, >> + IN EFI_SYSTEM_TABLE *SystemTable >> + ) >> +{ >> + EFI_STATUS Status; >> + LIST_ENTRY *CheckPackage; >> + CHAR16 *ProblemParam, *TftpCmd =3D NULL, *SfCmd =3D NULL; >> + CONST CHAR16 *RemoteFilePath, *Host, *FileToWrite; >> + UINT8 CmdLen; >> + BOOLEAN FileFlag, TftpFlag; >> + >> + Status =3D ShellInitialize (); >> + if (EFI_ERROR (Status)) { >> + Print (L"%s: Error while initializinf Shell\n", CMD_NAME_STRING); >> + ASSERT_EFI_ERROR (Status); >> + return SHELL_ABORTED; >> + } >> + >> + Status =3D ShellCommandLineParse (ParamList, &CheckPackage, &ProblemP= aram, >> + TRUE); >> + if (EFI_ERROR (Status)) { >> + Print (L"Parse error!\n"); >> + } >> + >> + if (ShellCommandLineGetFlag (CheckPackage, L"help")) { >> + FUpdateUsage(); >> + return EFI_SUCCESS; >> + } >> + >> + FileFlag =3D ShellCommandLineGetFlag (CheckPackage, L"-f"); >> + TftpFlag =3D ShellCommandLineGetFlag (CheckPackage, L"-t"); >> + >> + if (!FileFlag && !TftpFlag) { >> + Print (L"%s: Please specify -f or -t flag\n", CMD_NAME_STRING); >> + return SHELL_ABORTED; >> + } else if (FileFlag && !TftpFlag) { >> + // Prepare local file to be burned into flash >> + FileToWrite =3D PrepareFile (CheckPackage); >> + if (FileToWrite =3D=3D NULL) { >> + Print (L"%s: Error while preparing file for burn\n", CMD_NAME_STR= ING); >> + return SHELL_ABORTED; >> + } >> + } else if (TftpFlag && !FileFlag) { >> + Host =3D ShellCommandLineGetRawValue (CheckPackage, 1); >> + if (Host =3D=3D NULL) { >> + Print (L"%s: No Host parameter!\n", CMD_NAME_STRING); >> + return SHELL_ABORTED; >> + } >> + >> + RemoteFilePath =3D ShellCommandLineGetRawValue (CheckPackage, 2); >> + if (RemoteFilePath =3D=3D NULL) { >> + Print (L"%s: No remote_file_path parameter!\n", CMD_NAME_STRING); >> + return SHELL_ABORTED; >> + } >> + >> + // Gather firmware image name from remote filepath >> + FileToWrite =3D FileNameFromFilePath (RemoteFilePath); >> + >> + // Allocate buffer for tftp command string >> + CmdLen =3D StrSize (TFTP_CMD_STRING) + StrSize (SPACE_STRING) + >> + StrSize (Host) + StrSize (RemoteFilePath); >> + TftpCmd =3D (CHAR16 *) AllocateZeroPool (CmdLen + sizeof(CHAR16)); >> + if (TftpCmd =3D=3D NULL) { >> + Print (L"%s: Cannot allocate memory\n", CMD_NAME_STRING); >> + return SHELL_ABORTED; >> + } >> + >> + // Concatenate parameters and form tftp command string >> + StrCatS (TftpCmd, CmdLen / sizeof(CHAR16), TFTP_CMD_STRING); >> + StrCatS (TftpCmd, CmdLen / sizeof(CHAR16), (CHAR16 *)Host); >> + // Insert space >> + StrCatS (TftpCmd, CmdLen / sizeof(CHAR16), SPACE_STRING); >> + StrCatS (TftpCmd, CmdLen / sizeof(CHAR16), (CHAR16 *)RemoteFilePath= ); >> + >> + RunShellCommand (TftpCmd, &Status); >> + FreePool (TftpCmd); >> + if (EFI_ERROR(Status)) { >> + Print (L"%s: Error while performing tftp command\n", CMD_NAME_STR= ING); >> + return SHELL_ABORTED; >> + } >> + >> + } else { >> + Print (L"%s: Both -f and -t flag specified, please choose one\n", >> + CMD_NAME_STRING); >> + return SHELL_ABORTED; >> + } >> + >> + // Check image checksum and magic >> + Status =3D CheckFirmwareImage (FileToWrite); >> + if (EFI_ERROR(Status)) { >> + Print (L"%s: Wrong firmware Image\n", CMD_NAME_STRING); >> + return SHELL_ABORTED; >> + } >> + >> + // Probe spi bus >> + RunShellCommand (SF_PROBE_CMD_STRING, &Status); >> + if (EFI_ERROR(Status)) { >> + Print (L"%s: Error while performing sf probe\n", CMD_NAME_STRING); >> + return SHELL_ABORTED; >> + } >> + >> + // Allocate buffer for sf command string >> + CmdLen =3D StrSize (SF_WRITE_CMD_STRING) + StrSize (FileToWrite) + >> + StrSize (SPACE_STRING) + StrSize (SF_LOAD_ADDR_STRING); >> + SfCmd =3D (CHAR16 *) AllocateZeroPool (CmdLen + sizeof(CHAR16)); >> + if (SfCmd =3D=3D NULL) { >> + Print (L"%s: Cannot allocate memory\n"); >> + return SHELL_ABORTED; >> + } >> + >> + // Concatenate parameters and form command string >> + StrCatS (SfCmd, CmdLen / sizeof(CHAR16), SF_WRITE_CMD_STRING); >> + StrCatS (SfCmd, CmdLen / sizeof(CHAR16), (CHAR16 *)FileToWrite); >> + StrCatS (SfCmd, CmdLen / sizeof(CHAR16), SPACE_STRING); >> + StrCatS (SfCmd, CmdLen / sizeof(CHAR16), SF_LOAD_ADDR_STRING); >> + >> + // Update firmware image in flash >> + RunShellCommand (SfCmd, &Status); >> + FreePool (SfCmd); >> + if (EFI_ERROR(Status)) { >> + Print (L"%s: Error while performing sf update\n", CMD_NAME_STRING); >> + return SHELL_ABORTED; >> + } >> + >> + return EFI_SUCCESS; >> +} >> + >> +EFI_STATUS >> +EFIAPI >> +ShellFUpdateCommandConstructor ( >> + IN EFI_HANDLE ImageHandle, >> + IN EFI_SYSTEM_TABLE *SystemTable >> + ) >> +{ >> + EFI_STATUS Status; >> + >> + gShellFUpdateHiiHandle =3D NULL; >> + >> + gShellFUpdateHiiHandle =3D HiiAddPackages ( >> + &gShellFUpdateHiiGuid, gImageHandle, >> + UefiShellFUpdateCommandLibStrings, NULL >> + ); >> + if (gShellFUpdateHiiHandle =3D=3D NULL) { >> + Print (L"%s: Cannot add Hii package\n", CMD_NAME_STRING); >> + return EFI_DEVICE_ERROR; >> + } >> + >> + Status =3D ShellCommandRegisterCommandName ( >> + CMD_NAME_STRING, ShellCommandRunFUpdate, ShellCommandGetManFileNam= eFUpdate, >> + 0, CMD_NAME_STRING, TRUE , gShellFUpdateHiiHandle, >> + STRING_TOKEN (STR_GET_HELP_FUPDATE) >> + ); >> + if (EFI_ERROR(Status)) { >> + Print (L"%s: Error while registering command\n", CMD_NAME_STRING); >> + return SHELL_ABORTED; >> + } >> + >> + return EFI_SUCCESS; >> +} >> + >> +EFI_STATUS >> +EFIAPI >> +ShellFUpdateCommandDestructor ( >> + IN EFI_HANDLE ImageHandle, >> + IN EFI_SYSTEM_TABLE *SystemTable >> + ) >> +{ >> + >> + if (gShellFUpdateHiiHandle !=3D NULL) { >> + HiiRemovePackages (gShellFUpdateHiiHandle); >> + } >> + return EFI_SUCCESS; >> +} >> diff --git a/Applications/FirmwareUpdate/FUpdate.inf b/Applications/Firm= wareUpdate/FUpdate.inf >> new file mode 100644 >> index 0000000..53b5305 >> --- /dev/null >> +++ b/Applications/FirmwareUpdate/FUpdate.inf >> @@ -0,0 +1,68 @@ >> +# >> +# Marvell BSD License Option >> +# >> +# If you received this File from Marvell, you may opt to use, redistrib= ute >> +# and/or modify this File under the following licensing terms. >> +# Redistribution and use in source and binary forms, with or without >> +# modification, are permitted provided that the following conditions ar= e met: >> +# >> +# * Redistributions of source code must retain the above copyright noti= ce, >> +# this list of conditions and the following disclaimer. >> +# >> +# * Redistributions in binary form must reproduce the above copyright >> +# notice, this list of conditions and the following disclaimer in the >> +# documentation and/or other materials provided with the distribution. >> +# >> +# * Neither the name of Marvell nor the names of its contributors may b= e >> +# used to endorse or promote products derived from this software withou= t >> +# specific prior written permission. >> +# >> +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "= AS IS" >> +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,= THE >> +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PU= RPOSE ARE >> +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE = LIABLE >> +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUE= NTIAL >> +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOO= DS OR >> +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HO= WEVER >> +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LI= ABILITY, >> +# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF= THE USE >> +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. >> +# >> + >> +[Defines] >> + INF_VERSION =3D 0x00010006 >> + BASE_NAME =3D UefiShellFUpdateCommandLib >> + FILE_GUID =3D 470292b2-926b-4ed8-8080-be7a260db627 >> + MODULE_TYPE =3D UEFI_APPLICATION >> + VERSION_STRING =3D 0.1 >> + LIBRARY_CLASS =3D NULL|UEFI_APPLICATION UEFI_DRIVER >> + CONSTRUCTOR =3D ShellFUpdateCommandConstructor >> + DESTRUCTOR =3D ShellFUpdateCommandDestructor >> + >> +[Sources] >> + FUpdate.c >> + FUpdate.uni >> + >> +[Packages] >> + MdePkg/MdePkg.dec >> + ShellPkg/ShellPkg.dec >> + MdeModulePkg/MdeModulePkg.dec >> + OpenPlatformPkg/Platforms/Marvell/Marvell.dec >> + >> +[LibraryClasses] >> + UefiLib >> + UefiBootServicesTableLib >> + MemoryAllocationLib >> + BaseLib >> + BaseMemoryLib >> + DebugLib >> + ShellCommandLib >> + ShellLib >> + UefiLib >> + UefiRuntimeServicesTableLib >> + PcdLib >> + HiiLib >> + FileHandleLib >> + >> +[Guids] >> + gShellFUpdateHiiGuid >> diff --git a/Applications/FirmwareUpdate/FUpdate.uni b/Applications/Firm= wareUpdate/FUpdate.uni >> new file mode 100644 >> index 0000000000000000000000000000000000000000..6143c0580f1d1ef8ce4fe619= a1df1ce380adf2c0 >> GIT binary patch >> literal 5838 >> zcmd6r?N1v=3D5XSd&rTz~m@+FOuK&z@BXdB5G6OhbHeI_(&s)*P?EX6>LDdL}R`}}4Y >> z_Fim)B2|h`_TBEy&OYG4X_hAGEPYJ#RHUcs{Z98E >> z(pvgH{iLVebS#O#(@FZIt4KTPT#_g1JJ*}J#$MPH@A_(w)60Z*e$BBPsZ5(DH%TMu >> zI8RslFVenngr*p~lTP*KR@$$1pGl4p6GJjq&s>Nn8egO>-9MS0Q^{SVsru?OKUYs^ >> znhN!;+Src8b3GNB10=3D{X)7Ui6^*l)*^bUIqjXT$yRmsoHx~ZO!JT-lb@LbynxN^K` >> zIn^kbyht}1doJb+wK5;k=3DNwOk%lRBE#O3Six&4tFo-prWGG9T> zSq~;Gfgeyu8$GaiCW&nJZN~Bn~_GrJG$Ij >> zd>%7RrE8wn?<20zyXy5!t%sOH*M&t|ohxPqCl(VMpv1PhX2wGq^RXfXyO3p6Go#Mc >> z2Xdm> zEYC> zET8D> z<&j#gnvCR4)Z7mbaOf4-W15N#lkkcLM+avfRa7Cb$<-)x6l5)Rn~X$TUK4VTk?W_@ >> za3fp1Vg<`y=3Daxm`l~uNpw4drXy2AteUMrc`D;^ahSHUaU(DczTZEGzpC0A> zlsc+aJ@t71fm-|Njar-P-BkZZdaHj%BGuK~1N96f@mhUD^=3D+%KZ}J1v-I3oJiR_*v >> zkljd!dfL}Bv#)4Y?##KOyN`eYo|vzfe%Cx8D@~G-$nUDRue)P&^aC3;wBFKIlpSg5 >> zO72iNcz$iYj)AD$H{9si)o*yG4ScM|VQYOh&@Gyeoy3+#?Mll)vu@v^>B#0C!#XsJ >> zf|V_saqr%;En@`^3fYD?u%s*OeQVKssNMs~l^TU4ynqMmO0%@1ClG9^+QQSG{;?A# >> z-{^-Q@H*)Fy0VpvJi0GSK?vv0{BmDzNRD0Djx=3DxRPRnho`V*v}?g|GSgK$w_S8s?s >> z@PZWCQnoXa8N7$+=3D-tHvY`itODpHvGO}x1#A6ZCqN25B52jU8RPYubJ$BO3*-oiRO >> z;7of=3Dl> zcx*8~`ic3{Y>Z5Td2kGL9g117k*Dmy$>bxwBVzD> zat46)NHg>_BmbVy#A%ML&V78q8Fhnr$-sRWMZ >> zNblhn9*8MgUOOV6qBc> z;HuY_9BtH}dYtDK`s+R&t{O-1w3>cRPwrb!Y%j@~g;kdG85b+{3yV!w6Iy3>qPfzZ >> zX{9ojT`eo5pLsm0-dh|D(|hxLUpeqz+>;BQS42nq$~dmIf}d&5CJLW-MHLu-u?x7? >> zdOVi2?;F}aO8dtoo~QX}3;{+%qy`l;i@HPx)wdSBPauAx3( >> z>^nf%KE)1&a40S~$+4?pPs1L58H!T5z)Evq`BJvzidIjPmp|l5{Q8S>lszr`Qdr`A >> zePHZ;Os~?Pl0b59lG~ERx38?lX)E?;i$*TP4(h0Xk3mjUJT#X_%?n8_X0gin<(*~h >> zvDtgF@4S(hIi(+~mG|D+OX0buJ?&^+)>Dm0=3D76ngbhQ19reJ%S)> zGY6%`kVg`g?m$uXqa?6%tocvmOTIZQvTJ!v1RCa!I0-gk(Id$@uiD7@iqnDTaIo8+ >> zyV>(n7Ls@DKFB> zo^g-W@FnOXzE@lLs*zExG5O1n$4E0i3Vj`1la=3Dw~d*Rw6t)*%#8qJA``utI=3D&gXax >> z|FhF$H#bn-d!tC;obk9gsE#aZW7`pd*NC^C^!K$wv6t-H-o^KX5&g~k(7qbL-AH!% >> z2@qzF6)k>Vp2}uwYkVd1H)P>oTCvDQf3r9rtC-mFvyX}sR8P6g7q^*ax)F|8UHrt% >> QHyJ;b`f6NX>FQbZ9}*T`00000 >> >> literal 0 >> HcmV?d00001 >> >> diff --git a/Platforms/Marvell/Marvell.dec b/Platforms/Marvell/Marvell.d= ec >> index e63add4..f9d2660 100644 >> --- a/Platforms/Marvell/Marvell.dec >> +++ b/Platforms/Marvell/Marvell.dec >> @@ -54,6 +54,7 @@ >> >> gShellEepromHiiGuid =3D { 0xb2f4c714, 0x147f, 0x4ff7, { 0x82, 0x1b, 0= xce, 0x7b, 0x91, 0x7f, 0x5f, 0x2f } } >> gShellSfHiiGuid =3D { 0x03a67756, 0x8cde, 0x4638, { 0x82, 0x34, 0x4a,= 0x0f, 0x6d, 0x58, 0x81, 0x39 } } >> + gShellFUpdateHiiGuid =3D { 0x9b5d2176, 0x590a, 0x49db, { 0x89, 0x5d, = 0x4a, 0x70, 0xfe, 0xad, 0xbe, 0x24 } } >> >> [PcdsFixedAtBuild.common] >> #MPP >> -- >> 1.8.3.1 >>