All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/7] Add driver for android bootimg filesystem
@ 2016-01-26 18:51 Shea Levy
  2016-01-26 18:51 ` [PATCH 1/7] Add stub module for android bootimgs Shea Levy
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: Shea Levy @ 2016-01-26 18:51 UTC (permalink / raw)
  To: The development of GNU GRUB; +Cc: Shea Levy

Adds support for the android bootimg filesystem [1]. The kernel and, if
present, the ramdisk are made available as regular files.

[1]: https://android.googlesource.com/platform/system/core/+/506d233e7ac8ca4efa80768153d842c296477f99/mkbootimg/bootimg.h

Shea Levy (7):
  Add stub module for android bootimgs
  android_bootimg: Implement dir
  android_bootimg: Implement open
  android_bootimg: Implement close
  android_bootimg: Implement read
  android_bootimg: style fixes
  Add android_bootimg to changelog

 ChangeLog-2015                 |   4 +
 grub-core/Makefile.core.def    |   7 ++
 grub-core/fs/android_bootimg.c | 255 +++++++++++++++++++++++++++++++++++++++++
 3 files changed, 266 insertions(+)
 create mode 100644 grub-core/fs/android_bootimg.c

-- 
2.7.0



^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH 1/7] Add stub module for android bootimgs
  2016-01-26 18:51 [PATCH 0/7] Add driver for android bootimg filesystem Shea Levy
@ 2016-01-26 18:51 ` Shea Levy
  2016-01-26 18:51 ` [PATCH 2/7] android_bootimg: Implement dir Shea Levy
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: Shea Levy @ 2016-01-26 18:51 UTC (permalink / raw)
  To: The development of GNU GRUB; +Cc: Shea Levy

---
 grub-core/Makefile.core.def    |   7 +++
 grub-core/fs/android_bootimg.c | 105 +++++++++++++++++++++++++++++++++++++++++
 2 files changed, 112 insertions(+)
 create mode 100644 grub-core/fs/android_bootimg.c

diff --git a/grub-core/Makefile.core.def b/grub-core/Makefile.core.def
index 0cc40bb..a726abd 100644
--- a/grub-core/Makefile.core.def
+++ b/grub-core/Makefile.core.def
@@ -1231,6 +1231,13 @@ module = {
 };
 
 module = {
+  name = android_bootimg;
+  common = fs/android_bootimg.c;
+  cflags = '$(CFLAGS_POSIX) $(CFLAGS_GNULIB)';
+  cppflags = '$(CPPFLAGS_POSIX) $(CPPFLAGS_GNULIB)';
+};
+
+module = {
   name = bfs;
   common = fs/bfs.c;
 };
diff --git a/grub-core/fs/android_bootimg.c b/grub-core/fs/android_bootimg.c
new file mode 100644
index 0000000..f6b2283
--- /dev/null
+++ b/grub-core/fs/android_bootimg.c
@@ -0,0 +1,105 @@
+/* android-bootimg.c - android bootimg filesystem.  */
+/*
+ *  GRUB  --  GRand Unified Bootloader
+ *  Copyright (C) 2016 Free Software Foundation, Inc.
+ *
+ *  This program is free software: you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation, either version 3 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include <stdint.h>
+#include <grub/dl.h>
+#include <grub/file.h>
+
+GRUB_MOD_LICENSE ("GPLv3+");
+
+/* from https://android.googlesource.com/platform/system/core/+/506d233e7ac8ca4efa80768153d842c296477f99/mkbootimg/bootimg.h */
+#define BOOT_MAGIC	"ANDROID!"
+#define BOOT_MAGIC_SIZE	8
+#define BOOT_NAME_SIZE	16
+#define BOOT_ARGS_SIZE	512
+#define BOOT_EXTRA_ARGS_SIZE	1024
+
+struct boot_img_hdr
+{
+  uint8_t magic[BOOT_MAGIC_SIZE];
+
+  uint32_t kernel_size;
+  uint32_t kernel_addr;
+
+  uint32_t ramdisk_size;
+  uint32_t ramdisk_addr;
+
+  uint32_t second_size;
+  uint32_t second_addr;
+
+  uint32_t tags_addr;
+  uint32_t page_size;
+  uint32_t unused[2];
+
+  uint8_t name[BOOT_NAME_SIZE];
+
+  uint8_t cmdline[BOOT_ARGS_SIZE];
+
+  uint32_t id[8];
+
+  uint8_t extra_cmdline[BOOT_EXTRA_ARGS_SIZE];
+} GRUB_PACKED;
+
+static grub_err_t
+grub_android_bootimg_dir (grub_device_t device, const char *path_in,
+               grub_fs_dir_hook_t hook, void *hook_data)
+{
+  return GRUB_ERR_NOT_IMPLEMENTED_YET;
+}
+
+static grub_err_t
+grub_android_bootimg_open (grub_file_t file, const char *name_in)
+{
+  return GRUB_ERR_NOT_IMPLEMENTED_YET;
+}
+
+static grub_ssize_t
+grub_android_bootimg_read (grub_file_t file, char *buf, grub_size_t len)
+{
+  grub_errno = GRUB_ERR_NOT_IMPLEMENTED_YET;
+  return -1;
+}
+
+static grub_err_t
+grub_android_bootimg_close (grub_file_t file)
+{
+  return GRUB_ERR_NOT_IMPLEMENTED_YET;
+}
+
+static struct grub_fs grub_android_bootimg_fs = {
+  .name = "android_bootimg",
+  .dir = grub_android_bootimg_dir,
+  .open = grub_android_bootimg_open,
+  .read = grub_android_bootimg_read,
+  .close = grub_android_bootimg_close,
+#ifdef GRUB_UTIL
+  .reserved_first_sector = 0,
+  .blocklist_install = 0,
+#endif
+};
+
+GRUB_MOD_INIT (android_bootimg)
+{
+  grub_fs_register (&grub_android_bootimg_fs);
+}
+
+GRUB_MOD_FINI (android_bootimg)
+{
+  grub_fs_unregister (&grub_android_bootimg_fs);
+}
-- 
2.7.0



^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 2/7] android_bootimg: Implement dir
  2016-01-26 18:51 [PATCH 0/7] Add driver for android bootimg filesystem Shea Levy
  2016-01-26 18:51 ` [PATCH 1/7] Add stub module for android bootimgs Shea Levy
@ 2016-01-26 18:51 ` Shea Levy
  2016-01-26 18:51 ` [PATCH 3/7] android_bootimg: Implement open Shea Levy
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: Shea Levy @ 2016-01-26 18:51 UTC (permalink / raw)
  To: The development of GNU GRUB; +Cc: Shea Levy

---
 grub-core/fs/android_bootimg.c | 43 +++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 42 insertions(+), 1 deletion(-)

diff --git a/grub-core/fs/android_bootimg.c b/grub-core/fs/android_bootimg.c
index f6b2283..de49303 100644
--- a/grub-core/fs/android_bootimg.c
+++ b/grub-core/fs/android_bootimg.c
@@ -60,7 +60,48 @@ static grub_err_t
 grub_android_bootimg_dir (grub_device_t device, const char *path_in,
                grub_fs_dir_hook_t hook, void *hook_data)
 {
-  return GRUB_ERR_NOT_IMPLEMENTED_YET;
+  struct boot_img_hdr hd;
+  if (grub_disk_read (device->disk, 0, 0, sizeof hd, &hd))
+    goto fail;
+
+  if (grub_memcmp (hd.magic, BOOT_MAGIC, BOOT_MAGIC_SIZE))
+    goto fail;
+
+  if (hd.unused[0] || hd.unused[1])
+    goto fail;
+
+  const struct grub_dirhook_info info = {
+    .dir = 0,
+    .mtimeset = 0,
+    .case_insensitive = 0,
+    .inodeset = 0,
+    .mtime = 0,
+    .inode = 0
+  };
+
+  if (!grub_strcmp(path_in, "/")) {
+    return GRUB_ERR_FILE_NOT_FOUND;
+  }
+
+  if (hook ("kernel", &info, hook_data)) {
+    return grub_errno;
+  }
+
+  if (hook ("info", &info, hook_data)) {
+    return grub_errno;
+  }
+
+  if (hd.ramdisk_size != 0) {
+    if (hook ("ramdisk", &info, hook_data)) {
+      return grub_errno;
+    }
+  }
+
+  return GRUB_ERR_NONE;
+
+fail:
+  return grub_error (GRUB_ERR_BAD_FS, "%s is not an android bootimg",
+                     device->disk->name);
 }
 
 static grub_err_t
-- 
2.7.0



^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 3/7] android_bootimg: Implement open
  2016-01-26 18:51 [PATCH 0/7] Add driver for android bootimg filesystem Shea Levy
  2016-01-26 18:51 ` [PATCH 1/7] Add stub module for android bootimgs Shea Levy
  2016-01-26 18:51 ` [PATCH 2/7] android_bootimg: Implement dir Shea Levy
@ 2016-01-26 18:51 ` Shea Levy
  2016-01-26 18:51 ` [PATCH 4/7] android_bootimg: Implement close Shea Levy
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: Shea Levy @ 2016-01-26 18:51 UTC (permalink / raw)
  To: The development of GNU GRUB; +Cc: Shea Levy

---
 grub-core/fs/android_bootimg.c | 132 +++++++++++++++++++++++++++++++++++------
 1 file changed, 114 insertions(+), 18 deletions(-)

diff --git a/grub-core/fs/android_bootimg.c b/grub-core/fs/android_bootimg.c
index de49303..249f8ca 100644
--- a/grub-core/fs/android_bootimg.c
+++ b/grub-core/fs/android_bootimg.c
@@ -56,22 +56,87 @@ struct boot_img_hdr
   uint8_t extra_cmdline[BOOT_EXTRA_ARGS_SIZE];
 } GRUB_PACKED;
 
+typedef enum
+  {
+    ROOT,
+    KERNEL,
+    RAMDISK,
+    NOT_FOUND,
+    BAD_NAME
+  }
+bootimg_file_t;
+
+static bootimg_file_t
+grub_android_bootimg_handle_path (const char * path)
+{
+  if (!path || path[0] != '/')
+    return BAD_NAME;
+  const char * path_iter;
+  for (path_iter = path + 1; *path_iter; ++path_iter) {
+    if (*path_iter == '/')
+      continue;
+    if (*path_iter == '.') {
+      if (*(++path_iter) == '/')
+	continue;
+      else if (*path_iter == '.' && *(++path_iter) == '/')
+	continue;
+      else
+	return NOT_FOUND;
+    }
+    break;
+  }
+
+  if (!*path_iter)
+    return ROOT;
+  else if (grub_strcmp (path_iter, "kernel") == 0)
+    return KERNEL;
+  else if (grub_strcmp (path_iter, "ramdisk") == 0)
+    return RAMDISK;
+  else
+    return NOT_FOUND;
+}
+
 static grub_err_t
-grub_android_bootimg_dir (grub_device_t device, const char *path_in,
-               grub_fs_dir_hook_t hook, void *hook_data)
+grub_android_bootimg_hdr (grub_disk_t disk, struct boot_img_hdr * hd)
 {
-  struct boot_img_hdr hd;
-  if (grub_disk_read (device->disk, 0, 0, sizeof hd, &hd))
+  if (grub_disk_read (disk, 0, 0, sizeof *hd, hd))
     goto fail;
 
-  if (grub_memcmp (hd.magic, BOOT_MAGIC, BOOT_MAGIC_SIZE))
+  if (grub_memcmp (hd->magic, BOOT_MAGIC, BOOT_MAGIC_SIZE))
     goto fail;
 
-  if (hd.unused[0] || hd.unused[1])
+  if (hd->unused[0] || hd->unused[1])
     goto fail;
 
-  const struct grub_dirhook_info info = {
-    .dir = 0,
+  return GRUB_ERR_NONE;
+
+fail:
+  return grub_error (GRUB_ERR_BAD_FS, N_("%s not an android bootimg"),
+                     disk->name);
+}
+
+static grub_err_t
+grub_android_bootimg_dir (grub_device_t device, const char * path,
+               grub_fs_dir_hook_t hook, void *hook_data)
+{
+  struct boot_img_hdr hd;
+
+  if (grub_android_bootimg_hdr (device->disk, &hd))
+    return grub_errno;
+
+  bootimg_file_t file = grub_android_bootimg_handle_path (path);
+  if (file == NOT_FOUND)
+    return grub_error (GRUB_ERR_FILE_NOT_FOUND, N_("directory `%s' not found"),
+                       path);
+  else if (file == BAD_NAME)
+    return grub_error (GRUB_ERR_BAD_FILENAME, N_("invalid directory name `%s'"),
+                       path);
+  else if (file != ROOT)
+    return grub_error (GRUB_ERR_BAD_FILE_TYPE, N_("`%s' not a directory"),
+                       path);
+
+  struct grub_dirhook_info info = {
+    .dir = 1,
     .mtimeset = 0,
     .case_insensitive = 0,
     .inodeset = 0,
@@ -79,15 +144,17 @@ grub_android_bootimg_dir (grub_device_t device, const char *path_in,
     .inode = 0
   };
 
-  if (!grub_strcmp(path_in, "/")) {
-    return GRUB_ERR_FILE_NOT_FOUND;
+  if (hook (".", &info, hook_data)) {
+    return grub_errno;
   }
 
-  if (hook ("kernel", &info, hook_data)) {
+  if (hook ("..", &info, hook_data)) {
     return grub_errno;
   }
 
-  if (hook ("info", &info, hook_data)) {
+  info.dir = 0;
+
+  if (hook ("kernel", &info, hook_data)) {
     return grub_errno;
   }
 
@@ -98,16 +165,45 @@ grub_android_bootimg_dir (grub_device_t device, const char *path_in,
   }
 
   return GRUB_ERR_NONE;
-
-fail:
-  return grub_error (GRUB_ERR_BAD_FS, "%s is not an android bootimg",
-                     device->disk->name);
 }
 
 static grub_err_t
-grub_android_bootimg_open (grub_file_t file, const char *name_in)
+grub_android_bootimg_open (grub_file_t file, const char *name)
 {
-  return GRUB_ERR_NOT_IMPLEMENTED_YET;
+  struct boot_img_hdr hd;
+
+  if (grub_android_bootimg_hdr (file->device->disk, &hd))
+    return grub_errno;
+
+  grub_off_t * begin_offset;
+
+  bootimg_file_t fn = grub_android_bootimg_handle_path (name);
+  switch (fn)
+    {
+    case NOT_FOUND:
+      return grub_error (GRUB_ERR_FILE_NOT_FOUND, N_("file `%s' not found"),
+                         name);
+    case BAD_NAME:
+      return grub_error (GRUB_ERR_BAD_FILENAME, N_("bad file name `%s'"), name);
+    case ROOT:
+      return grub_error (GRUB_ERR_BAD_FILE_TYPE, N_("`%s' not a regular file"),
+                         name);
+    case KERNEL:
+      begin_offset = grub_malloc (sizeof *begin_offset);
+      *begin_offset = hd.page_size;
+      file->data = begin_offset;
+      file->size = hd.kernel_size;
+      break;
+    case RAMDISK:
+      begin_offset = grub_malloc (sizeof *begin_offset);
+      *begin_offset =
+        hd.page_size * (1 + (hd.kernel_size + hd.page_size - 1) / hd.page_size);
+      file->data = begin_offset;
+      file->size = hd.ramdisk_size;
+      break;
+    }
+
+  return GRUB_ERR_NONE;
 }
 
 static grub_ssize_t
-- 
2.7.0



^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 4/7] android_bootimg: Implement close
  2016-01-26 18:51 [PATCH 0/7] Add driver for android bootimg filesystem Shea Levy
                   ` (2 preceding siblings ...)
  2016-01-26 18:51 ` [PATCH 3/7] android_bootimg: Implement open Shea Levy
@ 2016-01-26 18:51 ` Shea Levy
  2016-01-26 18:51 ` [PATCH 5/7] android_bootimg: Implement read Shea Levy
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: Shea Levy @ 2016-01-26 18:51 UTC (permalink / raw)
  To: The development of GNU GRUB; +Cc: Shea Levy

---
 grub-core/fs/android_bootimg.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/grub-core/fs/android_bootimg.c b/grub-core/fs/android_bootimg.c
index 249f8ca..793e0aa 100644
--- a/grub-core/fs/android_bootimg.c
+++ b/grub-core/fs/android_bootimg.c
@@ -216,7 +216,8 @@ grub_android_bootimg_read (grub_file_t file, char *buf, grub_size_t len)
 static grub_err_t
 grub_android_bootimg_close (grub_file_t file)
 {
-  return GRUB_ERR_NOT_IMPLEMENTED_YET;
+  grub_free (file->data);
+  return GRUB_ERR_NONE;
 }
 
 static struct grub_fs grub_android_bootimg_fs = {
-- 
2.7.0



^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 5/7] android_bootimg: Implement read
  2016-01-26 18:51 [PATCH 0/7] Add driver for android bootimg filesystem Shea Levy
                   ` (3 preceding siblings ...)
  2016-01-26 18:51 ` [PATCH 4/7] android_bootimg: Implement close Shea Levy
@ 2016-01-26 18:51 ` Shea Levy
  2016-01-26 18:51 ` [PATCH 6/7] android_bootimg: style fixes Shea Levy
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: Shea Levy @ 2016-01-26 18:51 UTC (permalink / raw)
  To: The development of GNU GRUB; +Cc: Shea Levy

---
 grub-core/fs/android_bootimg.c | 25 ++++++++++++++++++-------
 1 file changed, 18 insertions(+), 7 deletions(-)

diff --git a/grub-core/fs/android_bootimg.c b/grub-core/fs/android_bootimg.c
index 793e0aa..13d77fd 100644
--- a/grub-core/fs/android_bootimg.c
+++ b/grub-core/fs/android_bootimg.c
@@ -67,11 +67,11 @@ typedef enum
 bootimg_file_t;
 
 static bootimg_file_t
-grub_android_bootimg_handle_path (const char * path)
+grub_android_bootimg_handle_path (const char *path)
 {
   if (!path || path[0] != '/')
     return BAD_NAME;
-  const char * path_iter;
+  const char *path_iter;
   for (path_iter = path + 1; *path_iter; ++path_iter) {
     if (*path_iter == '/')
       continue;
@@ -97,7 +97,7 @@ grub_android_bootimg_handle_path (const char * path)
 }
 
 static grub_err_t
-grub_android_bootimg_hdr (grub_disk_t disk, struct boot_img_hdr * hd)
+grub_android_bootimg_hdr (grub_disk_t disk, struct boot_img_hdr *hd)
 {
   if (grub_disk_read (disk, 0, 0, sizeof *hd, hd))
     goto fail;
@@ -116,7 +116,7 @@ fail:
 }
 
 static grub_err_t
-grub_android_bootimg_dir (grub_device_t device, const char * path,
+grub_android_bootimg_dir (grub_device_t device, const char *path,
                grub_fs_dir_hook_t hook, void *hook_data)
 {
   struct boot_img_hdr hd;
@@ -175,7 +175,7 @@ grub_android_bootimg_open (grub_file_t file, const char *name)
   if (grub_android_bootimg_hdr (file->device->disk, &hd))
     return grub_errno;
 
-  grub_off_t * begin_offset;
+  grub_off_t *begin_offset;
 
   bootimg_file_t fn = grub_android_bootimg_handle_path (name);
   switch (fn)
@@ -209,8 +209,19 @@ grub_android_bootimg_open (grub_file_t file, const char *name)
 static grub_ssize_t
 grub_android_bootimg_read (grub_file_t file, char *buf, grub_size_t len)
 {
-  grub_errno = GRUB_ERR_NOT_IMPLEMENTED_YET;
-  return -1;
+  grub_size_t len_left = file->size - file->offset;
+  len = len > len_left ? len_left : len;
+  grub_off_t *begin_offset = file->data;
+  grub_off_t actual_offset = *begin_offset + file->offset;
+  file->device->disk->read_hook = file->read_hook;
+  file->device->disk->read_hook_data = file->read_hook_data;
+  grub_errno = grub_disk_read (file->device->disk, 0, actual_offset, len, buf);
+  file->device->disk->read_hook = 0;
+
+  if (grub_errno)
+    return -1;
+  else
+    return len;
 }
 
 static grub_err_t
-- 
2.7.0



^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 6/7] android_bootimg: style fixes
  2016-01-26 18:51 [PATCH 0/7] Add driver for android bootimg filesystem Shea Levy
                   ` (4 preceding siblings ...)
  2016-01-26 18:51 ` [PATCH 5/7] android_bootimg: Implement read Shea Levy
@ 2016-01-26 18:51 ` Shea Levy
  2016-01-26 18:51 ` [PATCH 7/7] Add android_bootimg to changelog Shea Levy
  2016-01-26 19:04 ` [PATCH 0/7] Add driver for android bootimg filesystem Vladimir 'phcoder' Serbinenko
  7 siblings, 0 replies; 9+ messages in thread
From: Shea Levy @ 2016-01-26 18:51 UTC (permalink / raw)
  To: The development of GNU GRUB; +Cc: Shea Levy

---
 grub-core/fs/android_bootimg.c | 17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)

diff --git a/grub-core/fs/android_bootimg.c b/grub-core/fs/android_bootimg.c
index 13d77fd..37d7ff7 100644
--- a/grub-core/fs/android_bootimg.c
+++ b/grub-core/fs/android_bootimg.c
@@ -64,13 +64,14 @@ typedef enum
     NOT_FOUND,
     BAD_NAME
   }
-bootimg_file_t;
+grub_android_bootimg_filename_t;
 
-static bootimg_file_t
-grub_android_bootimg_handle_path (const char *path)
+static grub_android_bootimg_filename_t
+handle_path (const char *path)
 {
   if (!path || path[0] != '/')
     return BAD_NAME;
+
   const char *path_iter;
   for (path_iter = path + 1; *path_iter; ++path_iter) {
     if (*path_iter == '/')
@@ -97,7 +98,7 @@ grub_android_bootimg_handle_path (const char *path)
 }
 
 static grub_err_t
-grub_android_bootimg_hdr (grub_disk_t disk, struct boot_img_hdr *hd)
+read_hdr (grub_disk_t disk, struct boot_img_hdr *hd)
 {
   if (grub_disk_read (disk, 0, 0, sizeof *hd, hd))
     goto fail;
@@ -121,10 +122,10 @@ grub_android_bootimg_dir (grub_device_t device, const char *path,
 {
   struct boot_img_hdr hd;
 
-  if (grub_android_bootimg_hdr (device->disk, &hd))
+  if (read_hdr (device->disk, &hd))
     return grub_errno;
 
-  bootimg_file_t file = grub_android_bootimg_handle_path (path);
+  grub_android_bootimg_filename_t file = handle_path (path);
   if (file == NOT_FOUND)
     return grub_error (GRUB_ERR_FILE_NOT_FOUND, N_("directory `%s' not found"),
                        path);
@@ -172,12 +173,12 @@ grub_android_bootimg_open (grub_file_t file, const char *name)
 {
   struct boot_img_hdr hd;
 
-  if (grub_android_bootimg_hdr (file->device->disk, &hd))
+  if (read_hdr (file->device->disk, &hd))
     return grub_errno;
 
   grub_off_t *begin_offset;
 
-  bootimg_file_t fn = grub_android_bootimg_handle_path (name);
+  grub_android_bootimg_filename_t fn = handle_path (name);
   switch (fn)
     {
     case NOT_FOUND:
-- 
2.7.0



^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 7/7] Add android_bootimg to changelog
  2016-01-26 18:51 [PATCH 0/7] Add driver for android bootimg filesystem Shea Levy
                   ` (5 preceding siblings ...)
  2016-01-26 18:51 ` [PATCH 6/7] android_bootimg: style fixes Shea Levy
@ 2016-01-26 18:51 ` Shea Levy
  2016-01-26 19:04 ` [PATCH 0/7] Add driver for android bootimg filesystem Vladimir 'phcoder' Serbinenko
  7 siblings, 0 replies; 9+ messages in thread
From: Shea Levy @ 2016-01-26 18:51 UTC (permalink / raw)
  To: The development of GNU GRUB; +Cc: Shea Levy

---
 ChangeLog-2015 | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/ChangeLog-2015 b/ChangeLog-2015
index 869f6bf..cfab4fc 100644
--- a/ChangeLog-2015
+++ b/ChangeLog-2015
@@ -1,3 +1,7 @@
+2015-01-26  Shea Levy  <shea@shealevy.com>
+
+	Add driver for android bootimg filesystem.
+
 2015-01-23  Vladimir Serbinenko  <phcoder@gmail.com>
 
 	* tests/file_filter/file: Really add missing file.
-- 
2.7.0



^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH 0/7] Add driver for android bootimg filesystem
  2016-01-26 18:51 [PATCH 0/7] Add driver for android bootimg filesystem Shea Levy
                   ` (6 preceding siblings ...)
  2016-01-26 18:51 ` [PATCH 7/7] Add android_bootimg to changelog Shea Levy
@ 2016-01-26 19:04 ` Vladimir 'phcoder' Serbinenko
  7 siblings, 0 replies; 9+ messages in thread
From: Vladimir 'phcoder' Serbinenko @ 2016-01-26 19:04 UTC (permalink / raw)
  To: The development of GNU GRUB; +Cc: Shea Levy

[-- Attachment #1: Type: text/plain, Size: 1343 bytes --]

We don't care about the history of a single file. You can basically merge
all patches in a single one.
You took code from AOSP. It's license compatible but you need to keep
Google copyright lines.
We don't use ChangeLog file anymore. Please just provide git commit message

вт, 26 янв. 2016, 19:51, Shea Levy <shea@shealevy.com>:

> Adds support for the android bootimg filesystem [1]. The kernel and, if
> present, the ramdisk are made available as regular files.
>
> [1]:
> https://android.googlesource.com/platform/system/core/+/506d233e7ac8ca4efa80768153d842c296477f99/mkbootimg/bootimg.h
>
> Shea Levy (7):
>   Add stub module for android bootimgs
>   android_bootimg: Implement dir
>   android_bootimg: Implement open
>   android_bootimg: Implement close
>   android_bootimg: Implement read
>   android_bootimg: style fixes
>   Add android_bootimg to changelog
>
>  ChangeLog-2015                 |   4 +
>  grub-core/Makefile.core.def    |   7 ++
>  grub-core/fs/android_bootimg.c | 255
> +++++++++++++++++++++++++++++++++++++++++
>  3 files changed, 266 insertions(+)
>  create mode 100644 grub-core/fs/android_bootimg.c
>
> --
> 2.7.0
>
>
> _______________________________________________
> Grub-devel mailing list
> Grub-devel@gnu.org
> https://lists.gnu.org/mailman/listinfo/grub-devel
>

[-- Attachment #2: Type: text/html, Size: 1987 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2016-01-26 19:04 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-01-26 18:51 [PATCH 0/7] Add driver for android bootimg filesystem Shea Levy
2016-01-26 18:51 ` [PATCH 1/7] Add stub module for android bootimgs Shea Levy
2016-01-26 18:51 ` [PATCH 2/7] android_bootimg: Implement dir Shea Levy
2016-01-26 18:51 ` [PATCH 3/7] android_bootimg: Implement open Shea Levy
2016-01-26 18:51 ` [PATCH 4/7] android_bootimg: Implement close Shea Levy
2016-01-26 18:51 ` [PATCH 5/7] android_bootimg: Implement read Shea Levy
2016-01-26 18:51 ` [PATCH 6/7] android_bootimg: style fixes Shea Levy
2016-01-26 18:51 ` [PATCH 7/7] Add android_bootimg to changelog Shea Levy
2016-01-26 19:04 ` [PATCH 0/7] Add driver for android bootimg filesystem Vladimir 'phcoder' Serbinenko

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.