[syslinux] Configuration file not found when using non-standard installation path

Ady ady-sf at hotmail.com
Sat Aug 22 00:49:56 PDT 2015


Installing with:

 syslinux --directory otherdir -i my_unmounted_device 

will install the bootloader in the desired directory ("otherdir") under 
the root directory of the desired unmounted device 
("my_unmounted_device").

All the corresponding syslinux-related files are located in the same 
installation directory.

When booting this device, SYSLINUX fails to find a configuration file 
located in the installation directory ("/otherdir/syslinux.cfg").

Executing pwd.c32 from CLI, the result is consistent with the 
successful installation of the bootloader, "/otherdir/"

Executing ls.c32 from CLI, the resulting list includes the 
configuration file, syslinux.cfg, listed under "/otherdir/". So, 
SYSLINUX is capable of finding the file in that directory; it just 
doesn't search for it during its boot sequence.

Since the configuration file, syslinux.cfg, has not been found by 
SYSLINUX during the boot, the LABELs are not recognized.

The procedure can be replicated with versions 4.07 and 6.03.

If also one of the standard installation directory paths (e.g. 
"/boot/syslinux/") exists in the booting device, then the situation can 
be considered even worse.

If "/boot/syslinux/" exists (too) in the booting device, but the 
configuration file is not there, then the CWD will still be 
"/otherdir/".

If "/boot/syslinux/syslinux.cfg" exists, then the initial CWD will be 
"/boot/syslinux/", not the installation directory, "/otherdir/", in 
spite of the bootloader file(s) (ldlinux.*) being located / installed 
in "/otherdir/". This is almost expected, except that the presence of 
the configuration file located in the installation directory should had 
set the CWD to that installation directory.

With "/boot/syslinux/syslinux.cfg" being found, the LABELs in it might 
still fail to execute. If the paths in syslinux.cfg are all written in 
absolute notation and if the files are indeed located in the 
corresponding paths, then the LABELs would work. If the syslinux.cfg 
file was copied/moved from "/otherdir/" and the paths in it are written 
in relative notation, the LABELs will fail, unless all the files 
(except the bootloader files, "ldlinux.*") under "/otherdir/" are 
copied/moved to "/boot/syslinux/" too.

So, if the installation directory is one of the standard directories, 
all works as expected. But if the installation directory is other than 
the standard ones, the behavior is slightly inconsistent.

BTW, "core/fs/lib/loadconfig.c" includes:
 * This searches for extlinux.conf and syslinux.cfg in the install
 * directory, followed by a set of fallback directories.  If found,
 * set the current working directory to match.

which means that we are failing to do what that paragraph says we are 
supposed to be doing (i.e. searching in the install directory first).

Shouldn't we add the "installation" directory to 
"core/fs/lib/loadconfig.c", and/or to "core/fs/lib/searchconfig.c", 
and/or to some file(s) in "core/fs/lib/", as first searched-for path?

Or perhaps there is some other method so to solve this slight 
inconsistency(?).

TIA,
Ady.


More information about the Syslinux mailing list