[syslinux] PATH directive rules
Ady
ady-sf at hotmail.com
Tue Jan 29 11:20:25 PST 2013
> On Tue, 2013-01-29 at 10:48 +0200, Ady wrote:
> > > But for all variants, wherever we find ldlinux.c32, that's used as the
> > > initial PATH string.
> > >
> >
> > Thank you for your answers.
> >
> > I want to understand what exactly the word "initial" means here.
>
> It's used as the PATH string before any PATH directives are parsed in
> config files,
> ...
According to your answer for the example at the end of your previous
email ("B, C, D, E", posted below too), the location where
ldlinux.c32 resides indeed is always searched-for before the paths
stated by the PATH directive,...
> ...
> config files, meaning that the location of ldlinux.c32 will always be
> the first string in PATH, since PATH directives can only be appended.
... but it is not the "first" searched-for location. Maybe using
terms like "first string in PATH" in this case is technically correct
(or not; I don't know), but I am trying to make it clearer for simple
common mortal users as myself :).
>
> > What happens with the searched-for paths when using the CONFIG directive
> > to change the CWD? Is the new CWD added to the searched-for paths? Is
> > the "old" (previously set as - but no longer is the) CWD still
> > included in the searched-for paths?
>
> If the old CWD is the directory in which we found ldlinux.c32, then it
> will be included in PATH.
>
> But remember that the CWD is *always* searched before the entries in
> PATH.
Yes; according to your answer for the example at the end of your
previous email ("B, C, D, E", posted below too), the "CWD" is the
first location to be searched-for, _then_ the location where
ldlinux.c32 resides and only _then_ the locations according to the
PATH directive(s).
>
> > Having now:
> > A_ "old" CWD;
> > B_ "new" CWD;
> > C_ ldlinux.c32 location;
> > D_ PATH directive(s) stated in "old" cfg files;
> > E_ PATH directive(s) stated in "new" cfg files;
> >
> > in which specific (sort) order are the respective paths searched for
> > lib*.c32 files?
>
> B, C, D, E. Note that A is not searched unless it's equal to one of the
> other letters.
>
> Make sense?
>
It indeed makes sense, at least until (and if) the location where the
main c32 module that needs the lib*.c32 file(s) is also added to the
fallback rules for the PATH directive.
So, if I understand correctly...
1_ The CWD is always first; and if the CWD changes (by means of the
CONFIG directive), then the new CWD will be the new first location to
be searched-for, and the "old" CWD is not retained.
2_ Then, if the needed lib*.c32 files were not found in the CWD, the
location of ldlinux.c32 is the second path to be searched-for. Since
this second path is (still) known (retained?) and available after
using the CONFIG directive, it can be searched-for, still as _second_
possible location, while the new first searched-for path will be the
new CWD.
3_ The paths in all PATH directive statements are searched-for, in
the same order they are stated, and are also available after using
the CONFIG directive, still with lower priority than the new CWD and
than the location of the ldlinux.c32 file.
5_ Any new PATH statement always appends new locations to the
previous paths already available, so the presence of a new PATH
directive does not replace previous PATH statements, even if those
previous paths are not stated in the current cfg file.
I know that the above seems "too long". Some of us need it; some may
be bored already.
The above comments ("rules"?) are not including "every possible"
situation, but I think they probably cover many of them. Hopefully,
the above comments are accurate enough in this context. If they are
not, please correct them.
Thank you,
Ady.
More information about the Syslinux
mailing list