grub-devel.gnu.org archive mirror
 help / color / mirror / Atom feed
From: Shea Levy <shea@shealevy.com>
To: The development of GNU GRUB <grub-devel@gnu.org>
Cc: Shea Levy <shea@shealevy.com>
Subject: [PATCH v3 3/3] Add support for loading initrd from android bootimg
Date: Mon,  8 Feb 2016 15:47:39 -0500	[thread overview]
Message-ID: <1454964459-28213-4-git-send-email-shea@shealevy.com> (raw)
In-Reply-To: <1454964459-28213-1-git-send-email-shea@shealevy.com>

---
 grub-core/loader/linux.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/grub-core/loader/linux.c b/grub-core/loader/linux.c
index be6fa0f..4c5537a 100644
--- a/grub-core/loader/linux.c
+++ b/grub-core/loader/linux.c
@@ -4,6 +4,7 @@
 #include <grub/misc.h>
 #include <grub/file.h>
 #include <grub/mm.h>
+#include <grub/android_bootimg.h>
 
 struct newc_head
 {
@@ -199,7 +200,11 @@ grub_initrd_init (int argc, char *argv[],
 	  newc = 0;
 	}
       grub_file_filter_disable_compression ();
-      initrd_ctx->components[i].file = grub_file_open (fname);
+      if (grub_memcmp (fname, "android_bootimg:", sizeof "android_bootimg:" - 1) == 0)
+        grub_android_bootimg_load_initrd (fname + sizeof "android_bootimg:" - 1,
+                                          &initrd_ctx->components[i].file);
+      else
+        initrd_ctx->components[i].file = grub_file_open (fname);
       if (!initrd_ctx->components[i].file)
 	{
 	  grub_initrd_close (initrd_ctx);
-- 
2.7.0



      parent reply	other threads:[~2016-02-08 20:48 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-08 20:47 [PATCH v3 0/3] Android bootimg support Shea Levy
2016-02-08 20:47 ` [PATCH v3 1/3] Add helper functions to interact with android bootimg disks Shea Levy
2016-02-12 17:42   ` Vladimir 'φ-coder/phcoder' Serbinenko
2016-02-12 17:53     ` Vladimir 'φ-coder/phcoder' Serbinenko
2016-02-08 20:47 ` [PATCH v3 2/3] i386: Add support for loading from android bootimg Shea Levy
2016-02-12 17:50   ` Vladimir 'φ-coder/phcoder' Serbinenko
2016-02-12 19:19     ` Shea Levy
2016-02-12 19:22       ` Vladimir 'phcoder' Serbinenko
2016-02-12 19:34         ` Shea Levy
2016-02-12 21:16           ` Vladimir 'φ-coder/phcoder' Serbinenko
2016-02-13 10:32             ` Andrei Borzenkov
2016-02-14 13:21             ` Shea Levy
2016-02-14 13:26               ` Vladimir 'phcoder' Serbinenko
2016-02-14 17:20                 ` Andrei Borzenkov
2016-02-14 20:58                 ` Seth Goldberg
2016-02-15  3:41                   ` Andrei Borzenkov
2016-02-15  4:13                     ` Seth Goldberg
2016-02-15 10:55                     ` Vladimir 'phcoder' Serbinenko
2016-02-08 20:47 ` Shea Levy [this message]

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=1454964459-28213-4-git-send-email-shea@shealevy.com \
    --to=shea@shealevy.com \
    --cc=grub-devel@gnu.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).