grub-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH v3 3/3] Add support for loading initrd from android bootimg


From: Shea Levy
Subject: [PATCH v3 3/3] Add support for loading initrd from android bootimg
Date: Mon, 8 Feb 2016 15:47:39 -0500

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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]