[syslinux] When is PATH directive used?

Alexander Perlis aperlis at math.lsu.edu
Fri Jun 10 12:44:20 PDT 2016


Ady asked:
> Have you read the "See also" section(s) of the wiki page(s)?

Yes.

> By reading the relevant wiki pages, a user should (_hopefully_) get to
> the conclusion that the PATH directive is relevant for c32 modules, and
> not a replacement for the CONFIG / INCLUDE directives nor for relative
> paths based on the "Working Directory".

There's nothing in Directives/path that says it applies only to c32. 
Rephrasing the first sentence on that page:

   When attempting to open a file name, the CWD is searched first, 
before PATH.

Perhaps that should be:

   PATH is a space-separated list of path prefixes to be tried when 
searching for a C32 module. Note that the CWD is always searched first.

Wouldn't hurt to also say:

   Note also that PATH is not used when opening INCLUDE files, or the 
various types of KERNEL binary files.


> So, no, the case you are presenting here is not a bug.

It seems PATH would be more useful if it applied to *all* loads of 
binary files, and perhaps also to INCLUDE or perhaps a separate CFGPATH 
directive could give places to look for configuration files.


Which brings me back to my original question: any suggestion on how to 
make "common directory distinct config" work?

Ady suggested:
> In other words, put the c32 modules in the adequate (sub)directory, use
> the PATH directive accordingly, and use relative paths notation in the
> configuration file for directives other than PATH and for files other
> than c32 modules.

This won't work, since c32 aren't the only binaries that might be 
architecture specific. For example there was talk on this list at one 
point of making version of memdisk for EFI. I want a single config entry 
to load the correct memdisk depending on current running architecture. 
If I specify the relative path to the binary, then my config is specific 
to an architecture. If there were some kind of support to set a custom 
variable, then I could at least do this:

  archstub.cfg:
   SET MYARCH=bios
   INCLUDE rest.cfg

  rest.cfg:
   ...
   LINUX syslinux/$MYARCH/memdisk


At any rate, my impression at this point is that "common directory 
distinct config" is not workable, when it seemed initially like an 
attractive way to have most of the config (all but an initial stub to 
set the PATH) be identical for both architectures. Bummer.

Thanks,
Alex


More information about the Syslinux mailing list