* [PATCH] filetype: Fix booting ARM Linux Kernels with CONFIG_EFI enabled
@ 2016-04-19 8:58 Sascha Hauer
0 siblings, 0 replies; only message in thread
From: Sascha Hauer @ 2016-04-19 8:58 UTC (permalink / raw)
To: Barebox List; +Cc: mgr
When an ARM kernel is built with CONFIG_EFI enabled, then the
kernel image also looks like a EXE file. Move ARM zImage detection
before EXE detection so that the kernel is still detected as zImage.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
common/filetype.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/common/filetype.c b/common/filetype.c
index 74baf51..a8666a1 100644
--- a/common/filetype.c
+++ b/common/filetype.c
@@ -291,8 +291,6 @@ enum filetype file_detect_type(const void *_buf, size_t bufsize)
if (bufsize < 64)
return filetype_unknown;
- if (buf8[0] == 'M' && buf8[1] == 'Z')
- return filetype_exe;
if (le32_to_cpu(buf[5]) == 0x504d5453)
return filetype_mxs_bootstream;
@@ -301,6 +299,9 @@ enum filetype file_detect_type(const void *_buf, size_t bufsize)
if (buf[9] == 0x016f2818 || buf[9] == 0x18286f01)
return filetype_arm_zimage;
+ if (buf8[0] == 'M' && buf8[1] == 'Z')
+ return filetype_exe;
+
if (bufsize < 512)
return filetype_unknown;
--
2.8.0.rc3
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2016-04-19 8:59 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-04-19 8:58 [PATCH] filetype: Fix booting ARM Linux Kernels with CONFIG_EFI enabled Sascha Hauer
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox