This creates a new parameter to this shell implementation “_exit” that causes the shell to automatically exit after running the initial specified command line. This also automatically uses that command in the Execute() API.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: jaben carsey <jaben.carsey@intel.com>
Reviewed-by: Samer El-Haj-Mahmoud <elhaj@hp.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@14444
6f19259b-4bc3-4df7-8a09-
765794883524
/** @file\r
This is THE shell (application)\r
\r
/** @file\r
This is THE shell (application)\r
\r
- Copyright (c) 2009 - 2012, Intel Corporation. All rights reserved.<BR>\r
+ Copyright (c) 2009 - 2013, Intel Corporation. All rights reserved.<BR>\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
Status = DoStartupScript(ShellInfoObject.ImageDevPath, ShellInfoObject.FileDevPath);\r
}\r
\r
Status = DoStartupScript(ShellInfoObject.ImageDevPath, ShellInfoObject.FileDevPath);\r
}\r
\r
- if (!ShellCommandGetExit() && (PcdGet8(PcdShellSupportLevel) >= 3 || PcdGetBool(PcdShellForceConsole)) && !EFI_ERROR(Status) && !ShellInfoObject.ShellInitSettings.BitUnion.Bits.NoConsoleIn) {\r
+ if (!ShellInfoObject.ShellInitSettings.BitUnion.Bits.Exit && !ShellCommandGetExit() && (PcdGet8(PcdShellSupportLevel) >= 3 || PcdGetBool(PcdShellForceConsole)) && !EFI_ERROR(Status) && !ShellInfoObject.ShellInitSettings.BitUnion.Bits.NoConsoleIn) {\r
//\r
// begin the UI waiting loop\r
//\r
//\r
// begin the UI waiting loop\r
//\r
{L"-noversion", TypeFlag},\r
{L"-startup", TypeFlag},\r
{L"-delay", TypeValue},\r
{L"-noversion", TypeFlag},\r
{L"-startup", TypeFlag},\r
{L"-delay", TypeValue},\r
+ {L"-_exit", TypeFlag},\r
{NULL, TypeMax}\r
};\r
\r
{NULL, TypeMax}\r
};\r
\r
ShellInfoObject.ShellInitSettings.BitUnion.Bits.NoMap = ShellCommandLineGetFlag(Package, L"-nomap");\r
ShellInfoObject.ShellInitSettings.BitUnion.Bits.NoVersion = ShellCommandLineGetFlag(Package, L"-noversion");\r
ShellInfoObject.ShellInitSettings.BitUnion.Bits.Delay = ShellCommandLineGetFlag(Package, L"-delay");\r
ShellInfoObject.ShellInitSettings.BitUnion.Bits.NoMap = ShellCommandLineGetFlag(Package, L"-nomap");\r
ShellInfoObject.ShellInitSettings.BitUnion.Bits.NoVersion = ShellCommandLineGetFlag(Package, L"-noversion");\r
ShellInfoObject.ShellInitSettings.BitUnion.Bits.Delay = ShellCommandLineGetFlag(Package, L"-delay");\r
+ ShellInfoObject.ShellInitSettings.BitUnion.Bits.Exit = ShellCommandLineGetFlag(Package, L"-_exit");\r
\r
ShellInfoObject.ShellInitSettings.Delay = 5;\r
\r
\r
ShellInfoObject.ShellInitSettings.Delay = 5;\r
\r
/** @file\r
function definitions for internal to shell functions.\r
\r
/** @file\r
function definitions for internal to shell functions.\r
\r
- Copyright (c) 2009 - 2012, Intel Corporation. All rights reserved.<BR>\r
+ Copyright (c) 2009 - 2013, Intel Corporation. All rights reserved.<BR>\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
UINT32 NoMap:1; ///< Was "-nomap" found on command line.\r
UINT32 NoVersion:1; ///< Was "-noversion" found on command line.\r
UINT32 Delay:1; ///< Was "-delay[:n] found on command line\r
UINT32 NoMap:1; ///< Was "-nomap" found on command line.\r
UINT32 NoVersion:1; ///< Was "-noversion" found on command line.\r
UINT32 Delay:1; ///< Was "-delay[:n] found on command line\r
- UINT32 Reserved:8; ///< Extra bits\r
+ UINT32 Exit:1; ///< Was "-_exit" found on command line\r
+ UINT32 Reserved:7; ///< Extra bits\r
} SHELL_BITS;\r
\r
typedef union {\r
} SHELL_BITS;\r
\r
typedef union {\r
Member functions of EFI_SHELL_PROTOCOL and functions for creation,\r
manipulation, and initialization of EFI_SHELL_PROTOCOL.\r
\r
Member functions of EFI_SHELL_PROTOCOL and functions for creation,\r
manipulation, and initialization of EFI_SHELL_PROTOCOL.\r
\r
- Copyright (c) 2009 - 2012, Intel Corporation. All rights reserved.<BR>\r
+ Copyright (c) 2009 - 2013, Intel Corporation. All rights reserved.<BR>\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
Temp = NULL;\r
Size = 0;\r
ASSERT((Temp == NULL && Size == 0) || (Temp != NULL));\r
Temp = NULL;\r
Size = 0;\r
ASSERT((Temp == NULL && Size == 0) || (Temp != NULL));\r
- StrnCatGrow(&Temp, &Size, L"Shell.efi ", 0);\r
+ StrnCatGrow(&Temp, &Size, L"Shell.efi -_exit ", 0);\r
StrnCatGrow(&Temp, &Size, CommandLine, 0);\r
\r
Status = InternalShellExecuteDevicePath(\r
StrnCatGrow(&Temp, &Size, CommandLine, 0);\r
\r
Status = InternalShellExecuteDevicePath(\r