]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
boot: Load LoadOptions cmdline, if none is available.
authorDimitri John Ledkov <xnox@ubuntu.com>
Wed, 13 Nov 2019 01:08:57 +0000 (17:08 -0800)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Thu, 14 Nov 2019 09:01:20 +0000 (10:01 +0100)
Fixes #13694

src/boot/efi/stub.c

index 26c204fb438a1757083699eced8373f066b53444..6a10cafff020e3b1638e8bc1488d00c9ffca5902 100644 (file)
@@ -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;