- if (ShellCommandLineGetFlag(Package, L"-nv")) {\r
- Attributes |= EFI_VARIABLE_NON_VOLATILE;\r
+\r
+ if (EFI_ERROR(Status) || Buffer == NULL) {\r
+ //\r
+ // Creating a new variable. determine attributes from command line.\r
+ //\r
+ Attributes = 0;\r
+ if (ShellCommandLineGetFlag(Package, L"-bs")) {\r
+ Attributes |= EFI_VARIABLE_BOOTSERVICE_ACCESS;\r
+ }\r
+ if (ShellCommandLineGetFlag(Package, L"-rt")) {\r
+ Attributes |= EFI_VARIABLE_RUNTIME_ACCESS |\r
+ EFI_VARIABLE_BOOTSERVICE_ACCESS;\r
+ }\r
+ if (ShellCommandLineGetFlag(Package, L"-nv")) {\r
+ Attributes |= EFI_VARIABLE_NON_VOLATILE;\r
+ }\r