Skip to content

Commit dbc151e

Browse files
zhaofenglihorms
authored andcommitted
multiboot2: Accept x86-64 images
Signed-off-by: Zhaofeng Li <hello@zhaofeng.li> Signed-off-by: Simon Horman <horms@verge.net.au>
1 parent e388195 commit dbc151e

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

kexec/arch/i386/kexec-mb2-x86.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,10 @@ int multiboot2_x86_probe(const char *buf, off_t buf_len)
7676
/* Is it a good idea to try booting this file? */
7777
{
7878
int i, len;
79-
/* First of all, check that this is an ELF file */
80-
if ((i=elf_x86_probe(buf, buf_len)) < 0)
79+
80+
/* First of all, check that this is an ELF file for either x86 or x86-64 */
81+
i = elf_x86_any_probe(buf, buf_len, CORE_TYPE_UNDEF);
82+
if (i < 0)
8183
return i;
8284

8385
/* Now look for a multiboot header. */

kexec/arch/x86_64/kexec-x86_64.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,11 @@
3333
#include <arch/options.h>
3434

3535
struct file_type file_type[] = {
36+
{ "multiboot2-x86", multiboot2_x86_probe, multiboot2_x86_load,
37+
multiboot2_x86_usage },
3638
{ "elf-x86_64", elf_x86_64_probe, elf_x86_64_load, elf_x86_64_usage },
3739
{ "multiboot-x86", multiboot_x86_probe, multiboot_x86_load,
3840
multiboot_x86_usage },
39-
{ "multiboot2-x86", multiboot2_x86_probe, multiboot2_x86_load,
40-
multiboot2_x86_usage },
4141
{ "elf-x86", elf_x86_probe, elf_x86_load, elf_x86_usage },
4242
{ "bzImage64", bzImage64_probe, bzImage64_load, bzImage64_usage },
4343
{ "bzImage", bzImage_probe, bzImage_load, bzImage_usage },

0 commit comments

Comments
 (0)