aboutsummaryrefslogtreecommitdiffstats
path: root/core/fs
diff options
context:
space:
mode:
authorAlek Du <alek.du@intel.com>2010-06-08 22:28:33 -0700
committerH. Peter Anvin <hpa@linux.intel.com>2010-06-09 10:57:27 -0700
commit146c34a2632a4295b1aef44ef79e84b4d4b9cf7e (patch)
treeeb744f032eaee413fcff54c3c67ad2f8daab5207 /core/fs
parent0153498e9ce97fbf7329b590ddb7a373e33b12e6 (diff)
downloadsyslinux-146c34a2632a4295b1aef44ef79e84b4d4b9cf7e.tar.gz
syslinux-146c34a2632a4295b1aef44ef79e84b4d4b9cf7e.tar.xz
syslinux-146c34a2632a4295b1aef44ef79e84b4d4b9cf7e.zip
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 <alek.du@intel.com> Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Diffstat (limited to 'core/fs')
-rw-r--r--core/fs/fat/fat.c2
-rw-r--r--core/fs/lib/loadconfig.c16
2 files changed, 12 insertions, 6 deletions
diff --git a/core/fs/fat/fat.c b/core/fs/fat/fat.c
index a21f4312..9877a4d5 100644
--- a/core/fs/fat/fat.c
+++ b/core/fs/fat/fat.c
@@ -708,7 +708,7 @@ static int vfat_load_config(void)
com32sys_t regs;
int i;
- /* If installed by extlinux, try the extlinux filename */
+ /* If path filled by installer, then use that to load config*/
if (*CurrentDirName && !generic_load_config())
return 0;
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 <fs.h>
/*
- * 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(&regs, 0, sizeof regs);
regs.edi.w[0] = OFFS_WRT(ConfigName, 0);
call16(core_open, &regs, &regs);
-
+ /* 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(&regs, 0, sizeof regs);
+ regs.edi.w[0] = OFFS_WRT(ConfigName, 0);
+ call16(core_open, &regs, &regs);
+ }
return (regs.eflags.l & EFLAGS_ZF) ? -1 : 0;
}