2 Main file for NULL named library for install1 shell command functions.
4 Copyright (c) 2010 - 2011, Intel Corporation. All rights reserved.<BR>
5 This program and the accompanying materials
6 are licensed and made available under the terms and conditions of the BSD License
7 which accompanies this distribution. The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
15 #include "UefiShellInstall1CommandsLib.h"
17 STATIC CONST CHAR16 mFileName
[] = L
"ShellCommands";
18 EFI_HANDLE gShellInstall1HiiHandle
= NULL
;
19 CONST EFI_GUID gShellInstall1HiiGuid
= \
21 0x7d574d54, 0xd364, 0x4d4a, { 0x95, 0xe3, 0x49, 0x45, 0xdb, 0x7a, 0xd3, 0xee } \
25 Function to get the filename with help context if HII will not be used.
27 @return The filename with help text in it.
31 ShellCommandGetManFileNameInstall1 (
39 Constructor for the Shell Level 1 Commands library.
41 Install the handlers for level 1 UEFI Shell 2.0 commands.
43 @param ImageHandle the image handle of the process
44 @param SystemTable the EFI System Table pointer
46 @retval EFI_SUCCESS the shell command handlers were installed sucessfully
47 @retval EFI_UNSUPPORTED the shell level required was not found.
51 ShellInstall1CommandsLibConstructor (
52 IN EFI_HANDLE ImageHandle
,
53 IN EFI_SYSTEM_TABLE
*SystemTable
57 // check our bit of the profiles mask
59 if ((PcdGet8(PcdShellProfileMask
) & BIT2
) == 0) {
63 gShellInstall1HiiHandle
= HiiAddPackages (&gShellInstall1HiiGuid
, gImageHandle
, UefiShellInstall1CommandsLibStrings
, NULL
);
64 if (gShellInstall1HiiHandle
== NULL
) {
65 return (EFI_DEVICE_ERROR
);
69 // install our shell command handlers that are always installed
71 ShellCommandRegisterCommandName(L
"bcfg", ShellCommandRunBcfgInstall
, ShellCommandGetManFileNameInstall1
, 0, L
"Install", FALSE
, gShellInstall1HiiHandle
, STRING_TOKEN(STR_GET_HELP_BCFG
));
77 Destructor for the library. free any resources.
79 @param ImageHandle The image handle of the process.
80 @param SystemTable The EFI System Table pointer.
84 ShellInstall1CommandsLibDestructor (
85 IN EFI_HANDLE ImageHandle
,
86 IN EFI_SYSTEM_TABLE
*SystemTable
89 if (gShellInstall1HiiHandle
!= NULL
) {
90 HiiRemovePackages(gShellInstall1HiiHandle
);