From: Vladimir Serbinenko Date: Mon, 23 Dec 2013 04:33:44 +0000 (+0100) Subject: Add arm64-efi recognition to grub-file. X-Git-Tag: grub-2.02-beta2~23 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=260632161f3a4d25287092744416a0de574e8a91;p=thirdparty%2Fgrub.git Add arm64-efi recognition to grub-file. --- diff --git a/ChangeLog b/ChangeLog index 7ff951ac2..ab336faf5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2013-12-23 Vladimir Serbinenko + + Add arm64-efi recognition to grub-file. + 2013-12-23 Vladimir Serbinenko Fix ia64-efi recognition in grub-file. diff --git a/grub-core/commands/file.c b/grub-core/commands/file.c index be8ed528d..2723609c0 100644 --- a/grub-core/commands/file.c +++ b/grub-core/commands/file.c @@ -82,6 +82,8 @@ static const struct grub_arg_option options[] = { N_("Check if FILE is x86_64 EFI file"), 0, 0}, {"is-ia64-efi", 0, 0, N_("Check if FILE is IA64 EFI file"), 0, 0}, + {"is-arm64-efi", 0, 0, + N_("Check if FILE is ARM64 EFI file"), 0, 0}, {"is-arm-efi", 0, 0, N_("Check if FILE is ARM EFI file"), 0, 0}, {"is-hibernated-hiberfil", 0, 0, @@ -121,6 +123,7 @@ enum IS_32_EFI, IS_64_EFI, IS_IA_EFI, + IS_ARM64_EFI, IS_ARM_EFI, IS_HIBERNATED, IS_XNU64, @@ -546,6 +549,7 @@ grub_cmd_file (grub_extcmd_context_t ctxt, int argc, char **args) case IS_32_EFI: case IS_64_EFI: case IS_IA_EFI: + case IS_ARM64_EFI: case IS_ARM_EFI: { char signature[4]; @@ -584,11 +588,15 @@ grub_cmd_file (grub_extcmd_context_t ctxt, int argc, char **args) && coff_head.machine != grub_cpu_to_le16_compile_time (GRUB_PE32_MACHINE_IA64)) break; + if (type == IS_ARM64_EFI + && coff_head.machine != + grub_cpu_to_le16_compile_time (GRUB_PE32_MACHINE_ARM64)) + break; if (type == IS_ARM_EFI && coff_head.machine != grub_cpu_to_le16_compile_time (GRUB_PE32_MACHINE_ARMTHUMB_MIXED)) break; - if (type == IS_IA_EFI || type == IS_64_EFI) + if (type == IS_IA_EFI || type == IS_64_EFI || type == IS_ARM64_EFI) { struct grub_pe64_optional_header o64; if (grub_file_read (file, &o64, sizeof (o64)) != sizeof (o64))