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
;
21 Function to get the filename with help context if HII will not be used.
23 @return The filename with help text in it.
27 ShellCommandGetManFileNameInstall1 (
35 Constructor for the Shell Level 1 Commands library.
37 Install the handlers for level 1 UEFI Shell 2.0 commands.
39 @param ImageHandle the image handle of the process
40 @param SystemTable the EFI System Table pointer
42 @retval EFI_SUCCESS the shell command handlers were installed sucessfully
43 @retval EFI_UNSUPPORTED the shell level required was not found.
47 ShellInstall1CommandsLibConstructor (
48 IN EFI_HANDLE ImageHandle
,
49 IN EFI_SYSTEM_TABLE
*SystemTable
53 // check our bit of the profiles mask
55 if ((PcdGet8(PcdShellProfileMask
) & BIT2
) == 0) {
59 gShellInstall1HiiHandle
= HiiAddPackages (&gShellInstall1HiiGuid
, gImageHandle
, UefiShellInstall1CommandsLibStrings
, NULL
);
60 if (gShellInstall1HiiHandle
== NULL
) {
61 return (EFI_DEVICE_ERROR
);
65 // install our shell command handlers that are always installed
67 ShellCommandRegisterCommandName(L
"bcfg", ShellCommandRunBcfgInstall
, ShellCommandGetManFileNameInstall1
, 0, L
"Install", FALSE
, gShellInstall1HiiHandle
, STRING_TOKEN(STR_GET_HELP_BCFG
));
73 Destructor for the library. free any resources.
75 @param ImageHandle The image handle of the process.
76 @param SystemTable The EFI System Table pointer.
80 ShellInstall1CommandsLibDestructor (
81 IN EFI_HANDLE ImageHandle
,
82 IN EFI_SYSTEM_TABLE
*SystemTable
85 if (gShellInstall1HiiHandle
!= NULL
) {
86 HiiRemovePackages(gShellInstall1HiiHandle
);