• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 #include <dprintf.h>
2 #include <stdio.h>
3 #include <string.h>
4 #include <core.h>
5 #include <fs.h>
6 
7 /*
8  * Standard version of load_config for extlinux/syslinux filesystems.
9  *
10  * This searches for extlinux.conf and syslinux.cfg in the install
11  * directory, followed by a set of fallback directories.  If found,
12  * set the current working directory to match.
13  */
generic_open_config(struct com32_filedata * filedata)14 int generic_open_config(struct com32_filedata *filedata)
15 {
16     static const char *search_directories[] = {
17 	NULL,			/* CurrentDirName */
18 	"/boot/syslinux",
19 	"/syslinux",
20 	"/",
21 	NULL
22     };
23     static const char *filenames[] = {
24 	"extlinux.conf",
25 	"syslinux.cfg",
26 	NULL
27     };
28 
29     search_directories[0] = CurrentDirName;
30 
31     dprintf("CurrentDirName: \"%s\"\n", CurrentDirName);
32 
33     return search_dirs(filedata, search_directories, filenames, ConfigName);
34 }
35