Ady
2015-Aug-22 07:49 UTC
[syslinux] Configuration file not found when using non-standard installation path
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.
Ady
2015-Aug-22 15:19 UTC
[syslinux] Configuration file not found when using non-standard installation path
> 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.Oops. I have to apologize for sending an incomplete report. I detected that I forgot to specify the most important part of the report. If the installation command is: syslinux -d otherdir -i my_device then the resulting behavior is as I described in my prior email. If, instead, the installation command is: syslinux -d /otherdir/ -i my_device (note the slash characters, "/", in the parameter for "--directory", "/otherdir/") then the resulting behavior is as really expected, and as described in "core/fs/lib/loadconfig.c", searching for the configuration file name(s) in the installation directory first (and finding it when present). So, I have to ask, is there a way to improve this slight inconsistency? Sure, we could _just_ improve the documentation by adding this little detail (we should do it anyway), but in addition maybe there is a way to improve the code so to interpret the following "--directory" alternative parameters: _ -d otherdir/subdir _ -d /otherdir/subdir _ -d otherdir/subdir/ in the same way as: _ -d /otherdir/subdir/ so the user can achieve the objective without having to care about the notation of the parameter? Note: I have _not_ tested each and every alternative notation I am mentioning here, just the two I posted in the complete example commands. This is obviously not a major issue, but perhaps a patch is simple-enough and with a low-risk of introducing regressions? ? The latter part of this question / sentence is especially relevant for those installers that are based on OSes other than Linux; if in doubt, lets just document the matter and move on to more important things. TIA, Ady.> _______________________________________________ > Syslinux mailing list > Submissions to Syslinux at zytor.com > Unsubscribe or set options at: > http://www.zytor.com/mailman/listinfo/syslinux >
Maybe Matching Threads
- [syslinux:master] core/fs/lib/loadconfig.c: Add architecture-specific config name to search
- syslinux efi configuration file name proposal
- syslinux efi configuration file name proposal
- [PATCH 00/19][elflink] Improve compatibility with 4.x
- pxelinux feature request