From 95b56e3a97fa0e143f96641e7286c8ab8bbf9cf3 Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Mon, 23 Dec 2013 05:19:42 +0100 Subject: [PATCH] Recognize raspberry pi kernel in grub-file. --- ChangeLog | 4 ++++ grub-core/commands/file.c | 19 +++++++++++++++---- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 30a752b5b..6acd5e4cb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2013-12-23 Vladimir Serbinenko + + Recognize raspberry pi kernel in grub-file. + 2013-12-23 Vladimir Serbinenko Enable cache on ARM U-Boot port. diff --git a/grub-core/commands/file.c b/grub-core/commands/file.c index 3b88525bc..9f2c38dfa 100644 --- a/grub-core/commands/file.c +++ b/grub-core/commands/file.c @@ -377,14 +377,25 @@ grub_cmd_file (grub_extcmd_context_t ctxt, int argc, char **args) } case IS_ARM_LINUX: { - grub_uint32_t sig; + grub_uint32_t sig, sig_pi; + if (grub_file_read (file, &sig_pi, 4) != 4) + break; + /* Raspberry pi. */ + if (sig_pi == grub_cpu_to_le32_compile_time (0xea000006)) + { + ret = 1; + break; + } + if (grub_file_seek (file, 0x24) == (grub_size_t) -1) break; if (grub_file_read (file, &sig, 4) != 4) break; - if (sig != grub_cpu_to_le32_compile_time (0x016f2818)) - break; - ret = 1; + if (sig == grub_cpu_to_le32_compile_time (0x016f2818)) + { + ret = 1; + break; + } break; } case IS_PAE_DOMU ... IS_DOM0: