From 53a20455215e645cf66f1080cc528a994720e8b4 Mon Sep 17 00:00:00 2001 From: Dimitri John Ledkov Date: Tue, 12 Nov 2019 17:08:57 -0800 Subject: [PATCH] boot: Load LoadOptions cmdline, if none is available. Fixes #13694 --- src/boot/efi/stub.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/boot/efi/stub.c b/src/boot/efi/stub.c index 26c204fb438..6a10cafff02 100644 --- a/src/boot/efi/stub.c +++ b/src/boot/efi/stub.c @@ -62,8 +62,8 @@ EFI_STATUS efi_main(EFI_HANDLE image, EFI_SYSTEM_TABLE *sys_table) { cmdline_len = szs[0]; - /* if we are not in secure boot mode, accept a custom command line and replace the built-in one */ - if (!secure && loaded_image->LoadOptionsSize > 0 && *(CHAR16 *)loaded_image->LoadOptions > 0x1F) { + /* if we are not in secure boot mode, or none was provided, accept a custom command line and replace the built-in one */ + if ((!secure || cmdline_len == 0) && loaded_image->LoadOptionsSize > 0 && *(CHAR16 *)loaded_image->LoadOptions > 0x1F) { CHAR16 *options; CHAR8 *line; UINTN i;