diff options
author | Matt Fleming <matt.fleming@intel.com> | 2012-07-03 09:34:03 +0100 |
---|---|---|
committer | Matt Fleming <matt.fleming@intel.com> | 2012-07-03 09:44:35 +0100 |
commit | 316f9636e3958ada609d506deca8db3aef395e54 (patch) | |
tree | 1aaf9bb9a89b2a9cfdbb77aa526b92bac258bf7a | |
parent | 5f17528b5ff4e35911794d20759f5a72f0f4f3bd (diff) | |
download | syslinux-316f9636e3958ada609d506deca8db3aef395e54.tar.gz |
menu: Supply the command type to execute()
The old execute() was much more forgiving when passing a COM32 module
as KT_NONE, as the old code for loading a kernel could also handle
COM32 modules. This isn't the case with new_linux_kernel(), and COM32
modules really need to take the create_args_and_load() path in
execute().
Without this change loading .c32 files from vesamenu.c32/menu.c32
fails.
Reported-by: Helmut Hullen <Hullen@t-online.de>
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
-rw-r--r-- | com32/elflink/ldlinux/ldlinux.c | 2 | ||||
-rw-r--r-- | com32/include/menu.h | 2 | ||||
-rw-r--r-- | com32/menu/menumain.c | 10 |
3 files changed, 10 insertions, 4 deletions
diff --git a/com32/elflink/ldlinux/ldlinux.c b/com32/elflink/ldlinux/ldlinux.c index 4ad5eb85..f56f2c06 100644 --- a/com32/elflink/ldlinux/ldlinux.c +++ b/com32/elflink/ldlinux/ldlinux.c @@ -45,7 +45,7 @@ static inline const char *find_command(const char *str) return p; } -static enum kernel_type parse_kernel_type(const char *kernel) +enum kernel_type parse_kernel_type(const char *kernel) { const struct file_ext *ext; const char *p; diff --git a/com32/include/menu.h b/com32/include/menu.h index be2eaeb1..a3e9cd62 100644 --- a/com32/include/menu.h +++ b/com32/include/menu.h @@ -94,6 +94,8 @@ enum kernel_type { extern const char *const kernel_types[]; +extern enum kernel_type parse_kernel_type(const char *kernel); + /* Configurable integer parameters */ enum parameter_number { P_WIDTH, diff --git a/com32/menu/menumain.c b/com32/menu/menumain.c index a795cb2c..53bc6c64 100644 --- a/com32/menu/menumain.c +++ b/com32/menu/menumain.c @@ -1161,9 +1161,13 @@ int main(int argc, char *argv[]) printf("\033[?25h\033[%d;1H\033[0m", cursorrow); if (cmdline) { - execute(cmdline, KT_NONE); - if (cm->onerror) - execute(cm->onerror, KT_NONE); + enum kernel_type type = parse_kernel_type(cmdline); + + execute(cmdline, type); + if (cm->onerror) { + type = parse_kernel_type(cm->onerror); + execute(cm->onerror, type); + } } else { return 0; /* Exit */ } |