summaryrefslogtreecommitdiff
path: root/ShellPkg/Application
diff options
context:
space:
mode:
Diffstat (limited to 'ShellPkg/Application')
-rw-r--r--ShellPkg/Application/Shell/Shell.c62
-rw-r--r--ShellPkg/Application/Shell/Shell.inf2
-rw-r--r--ShellPkg/Application/Shell/Shell.unibin4588 -> 4938 bytes
-rw-r--r--ShellPkg/Application/Shell/ShellParametersProtocol.c6
-rw-r--r--ShellPkg/Application/Shell/ShellProtocol.c38
5 files changed, 58 insertions, 50 deletions
diff --git a/ShellPkg/Application/Shell/Shell.c b/ShellPkg/Application/Shell/Shell.c
index 3019c7d41..e5a648833 100644
--- a/ShellPkg/Application/Shell/Shell.c
+++ b/ShellPkg/Application/Shell/Shell.c
@@ -297,11 +297,28 @@ UefiMain (
0,
gST->ConOut->Mode->CursorRow,
NULL,
- STRING_TOKEN (STR_VER_OUTPUT_MAIN),
+ STRING_TOKEN (STR_VER_OUTPUT_MAIN_SHELL),
ShellInfoObject.HiiHandle,
SupportLevel[PcdGet8(PcdShellSupportLevel)],
gEfiShellProtocol->MajorVersion,
- gEfiShellProtocol->MinorVersion,
+ gEfiShellProtocol->MinorVersion
+ );
+
+ ShellPrintHiiEx (
+ -1,
+ -1,
+ NULL,
+ STRING_TOKEN (STR_VER_OUTPUT_MAIN_SUPPLIER),
+ ShellInfoObject.HiiHandle,
+ (CHAR16 *) PcdGetPtr (PcdShellSupplier)
+ );
+
+ ShellPrintHiiEx (
+ -1,
+ -1,
+ NULL,
+ STRING_TOKEN (STR_VER_OUTPUT_MAIN_UEFI),
+ ShellInfoObject.HiiHandle,
(gST->Hdr.Revision&0xffff0000)>>16,
(gST->Hdr.Revision&0x0000ffff),
gST->FirmwareVendor,
@@ -840,12 +857,12 @@ DoStartupScript(
//
// print out our warning and see if they press a key
//
- for ( Status = EFI_UNSUPPORTED, Delay = ShellInfoObject.ShellInitSettings.Delay * 10
+ for ( Status = EFI_UNSUPPORTED, Delay = ShellInfoObject.ShellInitSettings.Delay
; Delay != 0 && EFI_ERROR(Status)
; Delay--
){
- ShellPrintHiiEx(0, gST->ConOut->Mode->CursorRow, NULL, STRING_TOKEN (STR_SHELL_STARTUP_QUESTION), ShellInfoObject.HiiHandle, Delay/10);
- gBS->Stall (100000);
+ ShellPrintHiiEx(0, gST->ConOut->Mode->CursorRow, NULL, STRING_TOKEN (STR_SHELL_STARTUP_QUESTION), ShellInfoObject.HiiHandle, Delay);
+ gBS->Stall (1000000);
if (!ShellInfoObject.ShellInitSettings.BitUnion.Bits.NoConsoleIn) {
Status = gST->ConIn->ReadKeyStroke (gST->ConIn, &Key);
}
@@ -1396,13 +1413,32 @@ RunCommand(
if (CleanOriginal == NULL) {
return (EFI_OUT_OF_RESOURCES);
}
- while (CleanOriginal[StrLen(CleanOriginal)-1] == L' ') {
- CleanOriginal[StrLen(CleanOriginal)-1] = CHAR_NULL;
- }
+
+ //
+ // Remove any spaces at the beginning of the string.
+ //
while (CleanOriginal[0] == L' ') {
CopyMem(CleanOriginal, CleanOriginal+1, StrSize(CleanOriginal) - sizeof(CleanOriginal[0]));
}
+ //
+ // Handle case that passed in command line is just 1 or more " " characters.
+ //
+ if (StrLen (CleanOriginal) == 0) {
+ if (CleanOriginal != NULL) {
+ FreePool(CleanOriginal);
+ CleanOriginal = NULL;
+ }
+ return (EFI_SUCCESS);
+ }
+
+ //
+ // Remove any spaces at the end of the string.
+ //
+ while (CleanOriginal[StrLen(CleanOriginal)-1] == L' ') {
+ CleanOriginal[StrLen(CleanOriginal)-1] = CHAR_NULL;
+ }
+
CommandName = NULL;
if (StrStr(CleanOriginal, L" ") == NULL){
StrnCatGrow(&CommandName, NULL, CleanOriginal, 0);
@@ -1892,9 +1928,15 @@ RunScriptFileHandle (
Status = RunCommand(CommandLine3+1);
//
- // Now restore the pre-'@' echo state.
+ // If command was "@echo -off" or "@echo -on" then don't restore echo state
//
- ShellCommandSetEchoState(PreCommandEchoState);
+ if (StrCmp (L"@echo -off", CommandLine3) != 0 &&
+ StrCmp (L"@echo -on", CommandLine3) != 0) {
+ //
+ // Now restore the pre-'@' echo state.
+ //
+ ShellCommandSetEchoState(PreCommandEchoState);
+ }
} else {
if (ShellCommandGetEchoState()) {
CurDir = ShellInfoObject.NewEfiShellProtocol->GetEnv(L"cwd");
diff --git a/ShellPkg/Application/Shell/Shell.inf b/ShellPkg/Application/Shell/Shell.inf
index c3af61743..801180ea0 100644
--- a/ShellPkg/Application/Shell/Shell.inf
+++ b/ShellPkg/Application/Shell/Shell.inf
@@ -1,6 +1,7 @@
## @file
# This is the shell application
#
+# Copyright (c) 2013, Hewlett-Packard Development Company, L.P.
# Copyright (c) 2009 - 2013, Intel Corporation. All rights reserved.<BR>
#
# This program and the accompanying materials
@@ -106,4 +107,5 @@
gEfiShellPkgTokenSpaceGuid.PcdShellMapNameLength # ALWAYS_CONSUMED
gEfiShellPkgTokenSpaceGuid.PcdShellPrintBufferSize # ALWAYS_CONSUMED
gEfiShellPkgTokenSpaceGuid.PcdShellForceConsole # ALWAYS_CONSUMED
+ gEfiShellPkgTokenSpaceGuid.PcdShellSupplier # ALWAYS_CONSUMED
diff --git a/ShellPkg/Application/Shell/Shell.uni b/ShellPkg/Application/Shell/Shell.uni
index b9ddcaed6..dae54e8c2 100644
--- a/ShellPkg/Application/Shell/Shell.uni
+++ b/ShellPkg/Application/Shell/Shell.uni
Binary files differ
diff --git a/ShellPkg/Application/Shell/ShellParametersProtocol.c b/ShellPkg/Application/Shell/ShellParametersProtocol.c
index 067f6b7cf..2f8c626b0 100644
--- a/ShellPkg/Application/Shell/ShellParametersProtocol.c
+++ b/ShellPkg/Application/Shell/ShellParametersProtocol.c
@@ -2,7 +2,7 @@
Member functions of EFI_SHELL_PARAMETERS_PROTOCOL and functions for creation,
manipulation, and initialization of EFI_SHELL_PARAMETERS_PROTOCOL.
- Copyright (c) 2009 - 2012, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2009 - 2013, 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
@@ -313,9 +313,7 @@ CreatePopulateInstallShellParametersProtocol (
FullCommandLine = AllocateZeroPool(Size);
}
if (FullCommandLine != NULL) {
- if (LoadedImage->LoadOptionsSize != 0){
- StrCpy(FullCommandLine, LoadedImage->LoadOptions);
- }
+ CopyMem (FullCommandLine, LoadedImage->LoadOptions, LoadedImage->LoadOptionsSize);
//
// Populate Argc and Argv
//
diff --git a/ShellPkg/Application/Shell/ShellProtocol.c b/ShellPkg/Application/Shell/ShellProtocol.c
index e1aadb845..89132969b 100644
--- a/ShellPkg/Application/Shell/ShellProtocol.c
+++ b/ShellPkg/Application/Shell/ShellProtocol.c
@@ -645,8 +645,6 @@ EfiShellGetDeviceName(
UINTN LoopVar;
CHAR16 *DeviceNameToReturn;
CHAR8 *Lang;
- CHAR8 *TempChar;
-
UINTN ParentControllerCount;
EFI_HANDLE *ParentControllerBuffer;
UINTN ParentDriverCount;
@@ -703,23 +701,7 @@ EfiShellGetDeviceName(
if (EFI_ERROR(Status)) {
continue;
}
- if (Language == NULL) {
- Lang = AllocateZeroPool(AsciiStrSize(CompName2->SupportedLanguages));
- if (Lang == NULL) {
- return (EFI_OUT_OF_RESOURCES);
- }
- AsciiStrCpy(Lang, CompName2->SupportedLanguages);
- TempChar = AsciiStrStr(Lang, ";");
- if (TempChar != NULL){
- *TempChar = CHAR_NULL;
- }
- } else {
- Lang = AllocateZeroPool(AsciiStrSize(Language));
- if (Lang == NULL) {
- return (EFI_OUT_OF_RESOURCES);
- }
- AsciiStrCpy(Lang, Language);
- }
+ Lang = GetBestLanguageForDriver(CompName2->SupportedLanguages, Language, FALSE);
Status = CompName2->GetControllerName(CompName2, DeviceHandle, NULL, Lang, &DeviceNameToReturn);
FreePool(Lang);
Lang = NULL;
@@ -762,23 +744,7 @@ EfiShellGetDeviceName(
if (EFI_ERROR(Status)) {
continue;
}
- if (Language == NULL) {
- Lang = AllocateZeroPool(AsciiStrSize(CompName2->SupportedLanguages));
- if (Lang == NULL) {
- return (EFI_OUT_OF_RESOURCES);
- }
- AsciiStrCpy(Lang, CompName2->SupportedLanguages);
- TempChar = AsciiStrStr(Lang, ";");
- if (TempChar != NULL){
- *TempChar = CHAR_NULL;
- }
- } else {
- Lang = AllocateZeroPool(AsciiStrSize(Language));
- if (Lang == NULL) {
- return (EFI_OUT_OF_RESOURCES);
- }
- AsciiStrCpy(Lang, Language);
- }
+ Lang = GetBestLanguageForDriver(CompName2->SupportedLanguages, Language, FALSE);
Status = CompName2->GetControllerName(CompName2, ParentControllerBuffer[LoopVar], DeviceHandle, Lang, &DeviceNameToReturn);
FreePool(Lang);
Lang = NULL;