diff options
author | Kay Sievers <kay@vrfy.org> | 2013-01-21 21:41:45 +0100 |
---|---|---|
committer | Kay Sievers <kay@vrfy.org> | 2013-01-21 21:41:45 +0100 |
commit | eb97618aa94f53a89f375503b8979438a6f879eb (patch) | |
tree | f40ab22a3fe07c803218d6ddc3192380c26e8e81 | |
parent | c4aea60e81311914c3739d0252acebfaa18cd6e2 (diff) |
recognize LoaderEntryOptions{,OneShot}-$machine-id EFI variables
-rw-r--r-- | gummiboot.c | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/gummiboot.c b/gummiboot.c index df4f0b6..b15c86a 100644 --- a/gummiboot.c +++ b/gummiboot.c @@ -1147,6 +1147,42 @@ static VOID config_entry_add_from_file(Config *config, EFI_HANDLE *device, CHAR1 } FreePool(initrd); + /* append additional options from EFI variables for this machine-id */ + str = PoolPrint(L"LoaderEntryOptions-%s", entry->machine_id); + if (str) { + CHAR16 *s; + + if (efivar_get(str, &s) == EFI_SUCCESS) { + if (entry->options) { + CHAR16 *s2; + + s2 = PoolPrint(L"%s %s", entry->options, s); + FreePool(entry->options); + entry->options = s2; + } else + entry->options = s; + } + FreePool(str); + } + + str = PoolPrint(L"LoaderEntryOptionsOneShot-%s", entry->machine_id); + if (str) { + CHAR16 *s; + + if (efivar_get(str, &s) == EFI_SUCCESS) { + if (entry->options) { + CHAR16 *s2; + + s2 = PoolPrint(L"%s %s", entry->options, s); + FreePool(entry->options); + entry->options = s2; + } else + entry->options = s; + efivar_set(str, NULL, TRUE); + } + FreePool(str); + } + entry->device = device; entry->file = StrDuplicate(file); len = StrLen(entry->file); |