summaryrefslogtreecommitdiff
path: root/src/boot/efi/util.c
diff options
context:
space:
mode:
authorKay Sievers <kay@vrfy.org>2015-03-11 23:26:48 +0100
committerKay Sievers <kay@vrfy.org>2015-03-11 23:33:53 +0100
commit4db7e6d781c2d9bba4e9124d26e811dd4addc1c5 (patch)
tree7dabc81c01520a8cc0eefdf6813ea07d662be40c /src/boot/efi/util.c
parent510c4a0f1e7e7efe2897d2fbb9067f121467b103 (diff)
boot: efi - add config option to disable the command line editor
Diffstat (limited to 'src/boot/efi/util.c')
-rw-r--r--src/boot/efi/util.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/boot/efi/util.c b/src/boot/efi/util.c
index 5678b50c31..ba5ed7d22f 100644
--- a/src/boot/efi/util.c
+++ b/src/boot/efi/util.c
@@ -69,6 +69,26 @@ UINT64 time_usec(VOID) {
return 1000 * 1000 * ticks / freq;
}
+EFI_STATUS parse_boolean(CHAR8 *v, BOOLEAN *b) {
+ if (strcmpa(v, (CHAR8 *)"1") == 0 ||
+ strcmpa(v, (CHAR8 *)"yes") == 0 ||
+ strcmpa(v, (CHAR8 *)"y") == 0 ||
+ strcmpa(v, (CHAR8 *)"true") == 0) {
+ *b = TRUE;
+ return EFI_SUCCESS;
+ }
+
+ if (strcmpa(v, (CHAR8 *)"0") == 0 ||
+ strcmpa(v, (CHAR8 *)"no") == 0 ||
+ strcmpa(v, (CHAR8 *)"n") == 0 ||
+ strcmpa(v, (CHAR8 *)"false") == 0) {
+ *b = FALSE;
+ return EFI_SUCCESS;
+ }
+
+ return EFI_INVALID_PARAMETER;
+}
+
EFI_STATUS efivar_set_raw(const EFI_GUID *vendor, CHAR16 *name, CHAR8 *buf, UINTN size, BOOLEAN persistent) {
UINT32 flags;