diff options
Diffstat (limited to 'com32/elflink/ldlinux')
-rw-r--r-- | com32/elflink/ldlinux/config.h | 1 | ||||
-rw-r--r-- | com32/elflink/ldlinux/execute.c | 12 | ||||
-rw-r--r-- | com32/elflink/ldlinux/ldlinux.c | 2 |
3 files changed, 13 insertions, 2 deletions
diff --git a/com32/elflink/ldlinux/config.h b/com32/elflink/ldlinux/config.h index 63e33b69..9b7ce4a4 100644 --- a/com32/elflink/ldlinux/config.h +++ b/com32/elflink/ldlinux/config.h @@ -48,5 +48,6 @@ extern int new_linux_kernel(char *okernel, char *ocmdline); extern void pm_load_high(com32sys_t *regs); extern void ldlinux_enter_command(void); +extern const char *apply_extension(const char *kernel, const char *ext); #endif /* __CONFIG_H__ */ diff --git a/com32/elflink/ldlinux/execute.c b/com32/elflink/ldlinux/execute.c index 6ccde49d..e06192e6 100644 --- a/com32/elflink/ldlinux/execute.c +++ b/com32/elflink/ldlinux/execute.c @@ -84,7 +84,17 @@ void execute(const char *cmdline, uint32_t type) const struct image_types *t; for (t = image_boot_types; t->name; t++) { if (!strcmp(kernel + 1, t->name)) { - /* Strip the type specifier and retry */ + /* + * Strip the type specifier, apply the + * filename extension if COM32 and + * retry. + */ + if (t->type == IMAGE_TYPE_COM32) { + p = apply_extension(p, ".c32"); + if (!p) + return; + } + execute(p, t->type); return; } diff --git a/com32/elflink/ldlinux/ldlinux.c b/com32/elflink/ldlinux/ldlinux.c index 004769ce..d3f8e627 100644 --- a/com32/elflink/ldlinux/ldlinux.c +++ b/com32/elflink/ldlinux/ldlinux.c @@ -102,7 +102,7 @@ static const char *get_extension(const char *kernel) return NULL; } -static const char *apply_extension(const char *kernel, const char *ext) +const char *apply_extension(const char *kernel, const char *ext) { const char *p; char *k; |