All of lore.kernel.org
 help / color / mirror / Atom feed
* Default initrd path with the EFI stub
@ 2014-08-12 23:49 David Michael
  0 siblings, 0 replies; only message in thread
From: David Michael @ 2014-08-12 23:49 UTC (permalink / raw)
  To: linux-efi-u79uwXL29TY76Z2rM5mHXA

---
Hi,

I'd like to specify a default initrd path for the EFI stub at compile
time.  Is there a way to do this?

I got it to successfully load an initrd by setting the parameter in
CONFIG_CMDLINE with this proof-of-concept patch on 3.16.  (This patch is
against the efi tree's next branch.)  If the EFI stub doesn't currently
support this functionality, I'd appreciate it if something like this
could be applied.

Thanks.

David

 drivers/firmware/efi/libstub/efi-stub-helper.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/drivers/firmware/efi/libstub/efi-stub-helper.c b/drivers/firmware/efi/libstub/efi-stub-helper.c
index a920fec..eac30dc 100644
--- a/drivers/firmware/efi/libstub/efi-stub-helper.c
+++ b/drivers/firmware/efi/libstub/efi-stub-helper.c
@@ -675,6 +675,10 @@ char *efi_convert_cmdline(efi_system_table_t *sys_table_arg,
 
 	options_bytes++;	/* NUL termination */
 
+#ifdef CONFIG_CMDLINE
+	options_bytes += sizeof(CONFIG_CMDLINE);
+#endif
+
 	status = efi_low_alloc(sys_table_arg, options_bytes, 0, &cmdline_addr);
 	if (status != EFI_SUCCESS)
 		return NULL;
@@ -682,6 +686,11 @@ char *efi_convert_cmdline(efi_system_table_t *sys_table_arg,
 	s1 = (u8 *)cmdline_addr;
 	s2 = (const u16 *)options;
 
+#ifdef CONFIG_CMDLINE
+	memcpy((void *)s1, CONFIG_CMDLINE " ", sizeof(CONFIG_CMDLINE));
+	s1 += sizeof(CONFIG_CMDLINE);
+#endif
+
 	s1 = efi_utf16_to_utf8(s1, s2, options_chars);
 	*s1 = '\0';
 
-- 
1.9.3

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2014-08-12 23:49 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-08-12 23:49 Default initrd path with the EFI stub David Michael

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.