Qiu Shumin 8d4eec6d97 ShellPkg: Support finding help message embedded in resource section.
UEFI Shell scandalizes the help message in spec level so that a standalone
UEFI shell application can never get "-?" switch, instead the Shell core
(interpreter) detects the "-?" and finds .MAN file for that shell
application in certain spec defined paths, then show the help extracted
from that .MAN file.

But it means distributing a UEFI shell application not only means
distributing a .EFI file but also distributing a .MAN file. If the text
formatted .MAN file is corrupted (edited by user by mistake), or is
missing (deleted by user by mistake), no help will be shown to user.

So this patch enhance the Shell to make it support finding help message
imbedded in resource section of application image.

Cc: Jaben Carsey <jaben.carsey@intel.com>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Qiu Shumin <shumin.qiu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
2016-02-24 15:11:14 +08:00

120 lines
4.5 KiB
INI

## @file
# This is the shell application
#
# (C) Copyright 2013 Hewlett-Packard Development Company, L.P.<BR>
# Copyright (c) 2009 - 2016, Intel Corporation. All rights reserved.<BR>
#
# 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 = Shell
FILE_GUID = 7C04A583-9E3E-4f1c-AD65-E05268D0B4D1
MODULE_TYPE = UEFI_APPLICATION
VERSION_STRING = 1.0
ENTRY_POINT = UefiMain
#
# The following information is for reference only and not required by the build tools.
#
# VALID_ARCHITECTURES = IA32 X64 IPF EBC
#
[Sources]
Shell.c
Shell.h
ShellParametersProtocol.c
ShellParametersProtocol.h
ShellProtocol.c
ShellProtocol.h
FileHandleWrappers.c
FileHandleWrappers.h
FileHandleInternal.h
ShellEnvVar.c
ShellEnvVar.h
ShellManParser.c
ShellManParser.h
Shell.uni
ConsoleLogger.c
ConsoleLogger.h
ConsoleWrappers.c
ConsoleWrappers.h
[Packages]
MdePkg/MdePkg.dec
ShellPkg/ShellPkg.dec
MdeModulePkg/MdeModulePkg.dec
[LibraryClasses]
BaseLib
UefiApplicationEntryPoint
UefiLib
DebugLib
MemoryAllocationLib
ShellCommandLib
UefiRuntimeServicesTableLib
UefiBootServicesTableLib
DevicePathLib
BaseMemoryLib
PcdLib
FileHandleLib
PrintLib
HiiLib
SortLib
HandleParsingLib
UefiHiiServicesLib
[Guids]
gShellVariableGuid ## CONSUMES ## GUID
gShellMapGuid ## CONSUMES ## GUID
gShellAliasGuid ## CONSUMES ## GUID
[Protocols]
gEfiShellProtocolGuid ## PRODUCES
## SOMETIMES_CONSUMES
gEfiShellParametersProtocolGuid ## PRODUCES
## SOMETIMES_CONSUMES
# gEfiShellEnvironment2Guid ## SOMETIMES_PRODUCES
# gEfiShellInterfaceGuid ## SOMETIMES_PRODUCES
gEfiSimpleTextInputExProtocolGuid ## CONSUMES
gEfiSimpleTextInProtocolGuid ## CONSUMES
gEfiSimpleTextOutProtocolGuid ## CONSUMES
gEfiSimpleFileSystemProtocolGuid ## CONSUMES
gEfiLoadedImageProtocolGuid ## CONSUMES
gEfiComponentName2ProtocolGuid ## CONSUMES
gEfiUnicodeCollation2ProtocolGuid ## CONSUMES
gEfiDevicePathProtocolGuid ## CONSUMES
gEfiHiiPackageListProtocolGuid ## SOMETIMES_PRODUCES
[Pcd]
gEfiShellPkgTokenSpaceGuid.PcdShellSupportLevel ## CONSUMES
gEfiShellPkgTokenSpaceGuid.PcdShellSupportOldProtocols ## CONSUMES
gEfiShellPkgTokenSpaceGuid.PcdShellRequireHiiPlatform ## CONSUMES
gEfiShellPkgTokenSpaceGuid.PcdShellSupportFrameworkHii ## CONSUMES
gEfiShellPkgTokenSpaceGuid.PcdShellPageBreakDefault ## CONSUMES
gEfiShellPkgTokenSpaceGuid.PcdShellLibAutoInitialize ## CONSUMES
gEfiShellPkgTokenSpaceGuid.PcdShellInsertModeDefault ## CONSUMES
gEfiShellPkgTokenSpaceGuid.PcdShellScreenLogCount ## CONSUMES
gEfiShellPkgTokenSpaceGuid.PcdShellMapNameLength ## CONSUMES
gEfiShellPkgTokenSpaceGuid.PcdShellPrintBufferSize ## CONSUMES
gEfiShellPkgTokenSpaceGuid.PcdShellForceConsole ## CONSUMES
gEfiShellPkgTokenSpaceGuid.PcdShellSupplier ## CONSUMES
gEfiShellPkgTokenSpaceGuid.PcdShellMaxHistoryCommandCount ## CONSUMES
[BuildOptions.AARCH64]
# The tiny code model used by AARCH64 only supports binaries of up to 1 MB in
# size. Since the Shell application exceeds that when built in DEBUG mode,
# make sure we build it using the small code model instead.
GCC:DEBUG_*_*_CC_FLAGS = -mcmodel=small
GCC:DEBUG_*_*_DLINK_FLAGS = -z common-page-size=0x1000