Skip to contentSkip to conversation

arm64 in grub-mkconfig and grub-file?

DISCUSSION Andrey Borzenkov 2 participants 2 messages Dec 22, 2013 – Dec 23, 2013

lore
Share & tools
lore
#0 lore raw

Should not they have explicit arm64 support? I assume, images for arm and arm64 are different and not interchangeable?

#1 lore raw
Quoted 3 lines · Andrey Borzenkov

Should not they have explicit arm64 support? I assume, images for arm and arm64 are different and not interchangeable?

Like attached?

Quoted 6 lines

_______________________________________________
Grub-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/grub-devel

grub-core/commands/file.c +18 -0
index 2723609..42d62d4 100644
@@ -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;
util/grub-mkconfig.in +2 -1
index 02a455e..44f2d1d 100644
@@ -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)"