ShellPkg: ShellCommands/SetVar: Make '-rt' imply '-bs'

It's invalid to set a variable that's available from runtime services but not
from boot services.

Currently if you pass '-rt' without '-bs' you get a generic
'Invalid Parameter' message. We should either print a more useful message in
this case, or make '-rt' imply '-bs' (as this patch does). The Shell Spec is
ambiguous on the matter.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Brendan Jackman <Brendan.Jackman@arm.com>
Reviewed-By: Olivier Martin <olivier.martin@arm.com>
Reviewed-By: Jaben Carsey <jaben.carsey@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15323 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
Brendan Jackman 2014-03-10 18:13:13 +00:00 committed by jcarsey
parent 207256b79b
commit 0698723204
1 changed files with 2 additions and 1 deletions

View File

@ -139,7 +139,8 @@ ShellCommandRunSetVar (
Attributes |= EFI_VARIABLE_BOOTSERVICE_ACCESS; Attributes |= EFI_VARIABLE_BOOTSERVICE_ACCESS;
} }
if (ShellCommandLineGetFlag(Package, L"-rt")) { if (ShellCommandLineGetFlag(Package, L"-rt")) {
Attributes |= EFI_VARIABLE_RUNTIME_ACCESS; Attributes |= EFI_VARIABLE_RUNTIME_ACCESS |
EFI_VARIABLE_BOOTSERVICE_ACCESS;
} }
if (ShellCommandLineGetFlag(Package, L"-nv")) { if (ShellCommandLineGetFlag(Package, L"-nv")) {
Attributes |= EFI_VARIABLE_NON_VOLATILE; Attributes |= EFI_VARIABLE_NON_VOLATILE;