]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
ARM64 grub-file and grub-mkconfig support.
authorVladimir Serbinenko <phcoder@gmail.com>
Mon, 23 Dec 2013 16:35:18 +0000 (17:35 +0100)
committerVladimir Serbinenko <phcoder@gmail.com>
Mon, 23 Dec 2013 17:17:09 +0000 (18:17 +0100)
ChangeLog
grub-core/commands/file.c
util/grub-mkconfig.in

index a92eccbdfe82340b149b1a14d84584dac8e77698..1043b4103155db7de8dbdb2b022a732581c5c380 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2013-12-23  Vladimir Serbinenko  <phcoder@gmail.com>
+
+       ARM64 grub-file and grub-mkconfig support.
+
 2013-12-23  Vladimir Serbinenko  <phcoder@gmail.com>
 
        Remove leftover options defines.
index 2723609c017e57bb5dfa583d3be70a38b53d5c06..42d62d4799dbc3eba4385fa50f5598ab239c9a3b 100644 (file)
@@ -48,6 +48,8 @@ static const struct grub_arg_option options[] = {
    N_("Check if FILE can be used as x86 multiboot2 kernel"), 0, 0},
   {"is-arm-linux", 0, 0,
    N_("Check if FILE is ARM Linux"), 0, 0},
+  {"is-arm64-linux", 0, 0,
+   N_("Check if FILE is ARM64 Linux"), 0, 0},
   {"is-ia64-linux", 0, 0,
    N_("Check if FILE is IA64 Linux"), 0, 0},
   {"is-mips-linux", 0, 0,
@@ -107,6 +109,7 @@ enum
   IS_MULTIBOOT,
   IS_MULTIBOOT2,
   IS_ARM_LINUX,
+  IS_ARM64_LINUX,
   IS_IA64_LINUX,
   IS_MIPS_LINUX,
   IS_MIPSEL_LINUX,
@@ -401,6 +404,21 @@ grub_cmd_file (grub_extcmd_context_t ctxt, int argc, char **args)
          }
        break;
       }
+    case IS_ARM64_LINUX:
+      {
+       grub_uint32_t sig;
+
+       if (grub_file_seek (file, 0x38) == (grub_size_t) -1)
+         break;
+       if (grub_file_read (file, &sig, 4) != 4)
+         break;
+       if (sig == grub_cpu_to_le32_compile_time (0x644d5241))
+         {
+           ret = 1;
+           break;
+         }
+       break;
+      }
     case IS_PAE_DOMU ... IS_DOM0:
       {
        struct grub_xen_file_info xen_inf;
index 02a455eca35652e660ff4e102a0fcb6a2f6c7c18..44f2d1d4dc504fea9d6266e0c27743481bff19f1 100644 (file)
@@ -273,7 +273,8 @@ for i in "${grub_mkconfig_dir}"/* ; do
     */\#*\#) ;;
     *)
       if grub_file_is_not_garbage "$i" && test -x "$i" ; then
-         for platform in x86 i386-xen-pae x86_64-xen mips mipsel sparc64 powerpc ia64 arm; do
+         for platform in x86 i386-xen-pae x86_64-xen mips mipsel sparc64 powerpc ia64 arm arm64; do
+
              GRUB_PLATFORM=$platform
              export GRUB_PLATFORM
               buf="$($i)"