Difference between revisions of "Directives/path"

From Syslinux Wiki
Jump to: navigation, search
(Rules for PATH directive.)
 
m (Add to Category "Examples".)
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
The current working directory (CWD) is <u>always</u> searched first, before PATH, when attempting to open a file name.  
+
[[Category:Directives]]
 +
[[Category:Examples]]
 +
<!-- This document is transcluded into [[Cli]]. -->
 +
The objective of the [[Config#PATH|PATH]] directive is to search for
 +
c32 [[library modules]],
 +
which are dependencies of other c32 modules.
 +
Since there is no absolute distinction between "main" c32 modules
 +
and "library" modules,
 +
the PATH directive applies to all c32 modules, and only to them.
 +
 
 +
The [[Config#PATH|PATH]] directive is not a replacement for using
 +
actual paths in the configuration file.
 +
With the introduction of c32 dependencies (or "[[library modules]]"),
 +
there is a need to tell the main modules where to search for their
 +
respective dependencies,
 +
according to the directory structure that the user sets up.
 +
 
 +
The current [[working directory]] (CWD)  
 +
is <u>always</u> searched first,  
 +
before [[Config#PATH|PATH]],  
 +
when attempting to open a file name.  
 
The CWD is not affected when specifying a file with an absolute path.  
 
The CWD is not affected when specifying a file with an absolute path.  
 
For example, given the following file system layout,  
 
For example, given the following file system layout,  
Line 26: Line 46:
 
even if  
 
even if  
 
{{nowrap|<tt>/boot/bin</tt>}}  
 
{{nowrap|<tt>/boot/bin</tt>}}  
is specified in the PATH directive of a config file.
+
is specified in the PATH directive of a configuration file.
  
The reason that things work this way is that typically a user will install all library files in the Syslinux installation directory, as specified with the {{nowrap|"<tt>--directory</tt>"}} installer option.  
+
The reason that things work this way is that typically a user will  
This method allows the user to omit the PATH directive from their config file and still have things work correctly.
+
install all library files in the Syslinux installation directory,  
 +
as specified with  
 +
the {{nowrap|"<tt>--directory</tt>"}} [[install]]er option.  
 +
This method allows users to omit the PATH directive from  
 +
their configuration file and still have things work correctly.

Latest revision as of 06:52, 3 May 2019

The objective of the PATH directive is to search for c32 library modules, which are dependencies of other c32 modules. Since there is no absolute distinction between "main" c32 modules and "library" modules, the PATH directive applies to all c32 modules, and only to them.

The PATH directive is not a replacement for using actual paths in the configuration file. With the introduction of c32 dependencies (or "library modules"), there is a need to tell the main modules where to search for their respective dependencies, according to the directory structure that the user sets up.

The current working directory (CWD) is always searched first, before PATH, when attempting to open a file name. The CWD is not affected when specifying a file with an absolute path. For example, given the following file system layout,

  /boot/
    	/bin/
      		ls.c32
      		libls.c32
    	/foo/
      		libls.c32

assuming that the current working directory is /boot/foo, and assuming that libls.c32 is a dependency of ls.c32, then executing /boot/bin/ls.c32 will cause /boot/foo/libls.c32 to be loaded, not /boot/bin/libls.c32, even if /boot/bin is specified in the PATH directive of a configuration file.

The reason that things work this way is that typically a user will install all library files in the Syslinux installation directory, as specified with the "--directory" installer option. This method allows users to omit the PATH directive from their configuration file and still have things work correctly.