Cisneros, Jorge (George)
2011-Aug-17 15:37 UTC
[syslinux] [patch 1/1] syslinux: add suport for com32 entries in the menu
From: Jorge D Cisneros <jorge.cisneros at hp.com> Problem: The actual code only check for entries with kernel or linux, so this example will not work, this patch is to add support to gfxboot to detect the entry COM32 and use any module, in this case the module is chain.c32 Version: Syslinux 4.04 Example: UI gfxboot.c32 LABEL boot_hd0 MENU LABEL Boot from first hard drive COM32 chain.c32 APPEND hd0 Signed-off-by: Jorge D Cisneros <jorge.cisneros at hp.com> -- --- com32/gfxboot/gfxboot.c.orig 2011-08-17 10:04:44.000000000 -0500 +++ com32/gfxboot/gfxboot.c 2011-08-17 10:07:34.000000000 -0500 @@ -125,6 +125,7 @@ typedef struct menu_s { char *alt_kernel; // alternative name in case user has replaced it char *linux; // de facto an alias for 'kernel' char *localboot; // boot from local disk + char *com32; // boot other com32 modules char *initrd; // initrd as separate line (instead of as part of 'append') char *append; // kernel args char *ipappend; // append special pxelinux args (see doc) @@ -374,6 +375,11 @@ int read_config_file(const char *filenam continue; } + if(!strcasecmp(s, "com32") && menu_ptr) { + menu_ptr->com32 = strdup(t); + continue; + } + if(!strcasecmp(s, "initrd") && menu_ptr) { menu_ptr->initrd = strdup(t); continue; @@ -866,7 +872,13 @@ void boot_entry(menu_t *menu_ptr, char * if(menu_ptr->localboot) { gfx_done(); syslinux_local_boot(strtol(menu_ptr->localboot, NULL, 0)); + return; + } + if(menu_ptr->com32) { + gfx_done(); + asprintf(&cmd_buf, "%s %s", menu_ptr->com32, arg); + syslinux_run_command(cmd_buf); return; }
Sebastian Herbszt
2011-Aug-18 21:03 UTC
[syslinux] [patch 1/1] syslinux: add suport for com32 entries inthe menu
Cisneros, Jorge (George) wrote:> Problem: The actual code only check for entries with kernel or linux, so this example will not work, this patch is to > add support to gfxboot to detect the entry COM32 and use any module, in this case the module is chain.c32 > Version: Syslinux 4.04 > > Example: > UI gfxboot.c32 > > LABEL boot_hd0 > MENU LABEL Boot from first hard drive > COM32 chain.c32 > APPEND hd0Can't we just add the following instead? Sebastian diff --git a/com32/gfxboot/gfxboot.c b/com32/gfxboot/gfxboot.c index 35d180a..58fdc1b 100644 --- a/com32/gfxboot/gfxboot.c +++ b/com32/gfxboot/gfxboot.c @@ -381,6 +381,10 @@ int read_config_file(const char *filename) continue; } + if(!strcasecmp(s, "com32") && menu_ptr) { + continue; + } + if(!strcasecmp(s, "initrd") && menu_ptr) { menu_ptr->initrd = strdup(t); continue;