From 4e4db0c4b54ee5d5377fca0e4c2330286b1b0b41 Mon Sep 17 00:00:00 2001 From: Guo Mang Date: Thu, 22 Dec 2016 17:06:43 +0800 Subject: ShellPkg: Move to new location Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Guo Mang --- .../UefiShellInstall1CommandsLib.c | 59 ++++++++++++++++++++++ .../UefiShellInstall1CommandsLib.inf | 51 +++++++++++++++++++ 2 files changed, 110 insertions(+) create mode 100644 Core/ShellPkg/Library/UefiShellInstall1CommandsLib/UefiShellInstall1CommandsLib.c create mode 100644 Core/ShellPkg/Library/UefiShellInstall1CommandsLib/UefiShellInstall1CommandsLib.inf (limited to 'Core/ShellPkg/Library/UefiShellInstall1CommandsLib') diff --git a/Core/ShellPkg/Library/UefiShellInstall1CommandsLib/UefiShellInstall1CommandsLib.c b/Core/ShellPkg/Library/UefiShellInstall1CommandsLib/UefiShellInstall1CommandsLib.c new file mode 100644 index 0000000000..e26a86283e --- /dev/null +++ b/Core/ShellPkg/Library/UefiShellInstall1CommandsLib/UefiShellInstall1CommandsLib.c @@ -0,0 +1,59 @@ +/** @file + Main file for NULL named library for install1 shell command functions. + + Copyright (c) 2010 - 2011, Intel Corporation. All rights reserved.
+ This program and the accompanying materials + are licensed and made available under the terms and conditions of the BSD License + which accompanies this distribution. The full text of the license may be found at + http://opensource.org/licenses/bsd-license.php + + THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, + WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. + +**/ + +#include + +/** + Constructor for the Shell Level 1 Commands library. + + Install the handlers for level 1 UEFI Shell 2.0 commands. + + @param ImageHandle the image handle of the process + @param SystemTable the EFI System Table pointer + + @retval EFI_SUCCESS the shell command handlers were installed sucessfully + @retval EFI_UNSUPPORTED the shell level required was not found. +**/ +EFI_STATUS +EFIAPI +ShellInstall1CommandsLibConstructor ( + IN EFI_HANDLE ImageHandle, + IN EFI_SYSTEM_TABLE *SystemTable + ) +{ + // + // check our bit of the profiles mask + // + if ((PcdGet8(PcdShellProfileMask) & BIT2) == 0) { + return (EFI_SUCCESS); + } + + return (BcfgLibraryRegisterBcfgCommand(ImageHandle, SystemTable, L"Install1")); +} + +/** + Destructor for the library. free any resources. + + @param ImageHandle The image handle of the process. + @param SystemTable The EFI System Table pointer. +**/ +EFI_STATUS +EFIAPI +ShellInstall1CommandsLibDestructor ( + IN EFI_HANDLE ImageHandle, + IN EFI_SYSTEM_TABLE *SystemTable + ) +{ + return (BcfgLibraryUnregisterBcfgCommand(ImageHandle, SystemTable)); +} diff --git a/Core/ShellPkg/Library/UefiShellInstall1CommandsLib/UefiShellInstall1CommandsLib.inf b/Core/ShellPkg/Library/UefiShellInstall1CommandsLib/UefiShellInstall1CommandsLib.inf new file mode 100644 index 0000000000..dc1b6223e7 --- /dev/null +++ b/Core/ShellPkg/Library/UefiShellInstall1CommandsLib/UefiShellInstall1CommandsLib.inf @@ -0,0 +1,51 @@ +## @file +# Provides shell install1 functions +# +# Copyright (c) 2010 - 2015, Intel Corporation. All rights reserved.
+# +# This program and the accompanying materials +# are licensed and made available under the terms and conditions of the BSD License +# which accompanies this distribution. The full text of the license may be found at +# http://opensource.org/licenses/bsd-license.php +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +# +# +## +[Defines] + INF_VERSION = 0x00010006 + BASE_NAME = UefiShellInstall1CommandsLib + FILE_GUID = D250E364-51C6-49ed-AEBF-6D83F5130F74 + MODULE_TYPE = UEFI_DRIVER + VERSION_STRING = 1.0 + LIBRARY_CLASS = NULL|UEFI_APPLICATION UEFI_DRIVER + CONSTRUCTOR = ShellInstall1CommandsLibConstructor + DESTRUCTOR = ShellInstall1CommandsLibDestructor + +[Sources.common] + UefiShellInstall1CommandsLib.c + +[Packages] + MdePkg/MdePkg.dec + ShellPkg/ShellPkg.dec + MdeModulePkg/MdeModulePkg.dec + +[LibraryClasses] + MemoryAllocationLib + BaseLib + BaseMemoryLib + DebugLib + ShellCommandLib + ShellLib + UefiLib + UefiRuntimeServicesTableLib + UefiBootServicesTableLib + SortLib + PrintLib + BcfgCommandLib + +[Pcd] + gEfiShellPkgTokenSpaceGuid.PcdShellProfileMask ## CONSUMES + +[Guids] + gShellInstall1HiiGuid ## UNDEFINED -- cgit v1.2.3