From 146c34a2632a4295b1aef44ef79e84b4d4b9cf7e Mon Sep 17 00:00:00 2001 From: Alek Du Date: Tue, 8 Jun 2010 22:28:33 -0700 Subject: Make syslinux installer real "pathbased" The previous merging extlinux/syslinux patch is not sufficient, the syslinux is not real "patchbased", hence: * fill currentdir in patcharea * search "extlinux.conf" and "syslinux.cfg" for generic_load_config * define boot_image and boot_sector macro for ldsyslinux this could make further merging extlinux and syslinux possible Signed-off-by: Alek Du Signed-off-by: H. Peter Anvin --- core/fs/lib/loadconfig.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'core/fs/lib') diff --git a/core/fs/lib/loadconfig.c b/core/fs/lib/loadconfig.c index 9318c1c3..d84bdef9 100644 --- a/core/fs/lib/loadconfig.c +++ b/core/fs/lib/loadconfig.c @@ -5,20 +5,26 @@ #include /* - * Standard version of load_config for extlinux-installed filesystems + * Standard version of load_config for extlinux/syslinux filesystems */ int generic_load_config(void) { com32sys_t regs; chdir(CurrentDirName); + /* try extlinux.conf first */ realpath(ConfigName, "extlinux.conf", FILENAME_MAX); - - dprintf("Config = %s\n", ConfigName); - + dprintf("Try config = %s\n", ConfigName); memset(®s, 0, sizeof regs); regs.edi.w[0] = OFFS_WRT(ConfigName, 0); call16(core_open, ®s, ®s); - + /* give syslinux.cfg a chance ? */ + if (regs.eflags.l & EFLAGS_ZF) { + realpath(ConfigName, "syslinux.cfg", FILENAME_MAX); + dprintf("Then try config = %s\n", ConfigName); + memset(®s, 0, sizeof regs); + regs.edi.w[0] = OFFS_WRT(ConfigName, 0); + call16(core_open, ®s, ®s); + } return (regs.eflags.l & EFLAGS_ZF) ? -1 : 0; } -- cgit