Skip to content

Commit 7dde67f

Browse files
nivedita76ardbiesheuvel
authored andcommitted
efi/x86: Support builtin command line
Add support for the x86 CMDLINE_BOOL and CMDLINE_OVERRIDE configuration options. Signed-off-by: Arvind Sankar <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Ard Biesheuvel <[email protected]>
1 parent f61900f commit 7dde67f

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

drivers/firmware/efi/libstub/x86-stub.c

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -680,7 +680,6 @@ unsigned long efi_main(efi_handle_t handle,
680680
unsigned long buffer_start, buffer_end;
681681
struct setup_header *hdr = &boot_params->hdr;
682682
efi_status_t status;
683-
unsigned long cmdline_paddr;
684683

685684
efi_system_table = sys_table_arg;
686685

@@ -739,9 +738,14 @@ unsigned long efi_main(efi_handle_t handle,
739738
image_offset = 0;
740739
}
741740

742-
cmdline_paddr = ((u64)hdr->cmd_line_ptr |
743-
((u64)boot_params->ext_cmd_line_ptr << 32));
744-
efi_parse_options((char *)cmdline_paddr);
741+
#ifdef CONFIG_CMDLINE_BOOL
742+
efi_parse_options(CONFIG_CMDLINE);
743+
#endif
744+
if (!IS_ENABLED(CONFIG_CMDLINE_OVERRIDE)) {
745+
unsigned long cmdline_paddr = ((u64)hdr->cmd_line_ptr |
746+
((u64)boot_params->ext_cmd_line_ptr << 32));
747+
efi_parse_options((char *)cmdline_paddr);
748+
}
745749

746750
/*
747751
* At this point, an initrd may already have been loaded by the

0 commit comments

Comments
 (0)