All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Michael <fedora.dm0-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: linux-efi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Default initrd path with the EFI stub
Date: Tue, 12 Aug 2014 19:49:28 -0400	[thread overview]
Message-ID: <87oavpp8tz.fsf@gmail.com> (raw)

---
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

                 reply	other threads:[~2014-08-12 23:49 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87oavpp8tz.fsf@gmail.com \
    --to=fedora.dm0-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
    --cc=linux-efi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.