[syslinux] multiple ".." support

Ady Ady ady-sf at hotmail.com
Wed Jun 20 00:37:47 PDT 2012


Hello HPA,
 
I have a request. Since v4.04, SYSLINUX supports one ".." in relative paths. It also supports multiple "../", only if the relative path ends with a specific directory, as in "../../otherdirectory/".
 
Is it possible to expand this support to multiple "../" in SYSLINUX?
 
BTW, ISOLINUX already supports this type of relative paths.
 
The rest of this message gives more details and examples.
 

My request is to add support in SYSLINUX for cases like the following "Example C" below.
 
In SYSLINUX, when using:
 
CONFIG <path/to/new/cfg>
APPEND <path/to/new/base/directory/>
 
and with both paths in RELATIVE notation, I've found that the path can't just "go up" to a parent directory more than one level up.
 
=====================
Example A (works OK):
=====================
_____________________________
/boot/syslinux/syslinux.cfg :
_____________________________
DEFAULT 1
PROMPT 0
 
LABEL 1
CONFIG ../1.cfg
APPEND ../
_____________________________

_____________________________
/boot/1.cfg :
_____________________________
DEFAULT 2
PROMPT 0
 
LABEL 2
COM32 /boot/syslinux/pwd.c32
_____________________________
=================
End of Example A.
=================
 
In the above "Example A", the original working directory is /boot/syslinux/ and the new base directory is /boot/, which is only ONE level up from the previous one.
 
This "Example A" is supported in SYSLINUX since v.4.04.
 
 (See: 
 http://git.kernel.org/?p=boot/syslinux/syslinux.git;a=commit;h=7557067a64696f1136952a8815562e670205b38c 
 http://git.kernel.org/?p=boot/syslinux/syslinux.git;a=commit;h=ca785c7e715a74dac0fd8e537ef8cf4e5a655171 
 http://git.kernel.org/?p=boot/syslinux/syslinux.git;a=commit;h=da9c8bcfbb899975a8254e0a97945074c359ff19 
 http://git.kernel.org/?p=boot/syslinux/syslinux.git;a=commit;h=ce8bce014e4ec3dd4d1a1cb9e64c83d096d95127 
 )
 

=====================
Example B (works OK):
=====================
_____________________________
/boot/syslinux/syslinux.cfg :
_____________________________
DEFAULT 3
PROMPT 0
 
LABEL 3
CONFIG 3.cfg
APPEND ../../otherdir/
_____________________________

_____________________________
/boot/syslinux/3.cfg :
_____________________________
DEFAULT 4
PROMPT 0
 
LABEL 4
COM32 /boot/syslinux/pwd.c32
_____________________________
=================
End of Example B.
=================
 
In the above "Example B", the original working directory is /boot/syslinux/ and the new base directory is /otherdir/. Note that the new base file, "3.cfg", is located in /boot/syslinux/ and not in the new base directory /otherdir/.
 
Since the RELATIVE paths being used in "Example B" don't end with ".." nor "../", this example still works OK.
 

I could give more working examples with different combinations of paths, but let's go to the one that is not working.
 
=============================
Example C (INCORRECT RESULT):
=============================
_____________________________
/boot/syslinux/syslinux.cfg :
_____________________________
DEFAULT 5
PROMPT 0
 
LABEL 5
CONFIG 5.cfg
APPEND ../../
_____________________________

_____________________________
/boot/syslinux/5.cfg :
_____________________________
DEFAULT 6
PROMPT 0
 
LABEL 6
COM32 /boot/syslinux/pwd.c32
_____________________________
=================
End of Example C.
=================
 
The above "Example C" is currently NOT supported by SYSLINUX, since it:
 
1_ contains MORE than one level of "../" in the same CONFIG+APPEND; AND
2_ the path ends with ".." or with "../".
 
According to "LABEL 5" above, the intended new base directory should be "/boot/syslinux/../../" (equivalent to "/"), but since:

1_ more than one "../" is used; AND
2_ the path ends with "..[/]",
 
 then the resulting "pwd.c32" gives "/boot/syslinux/../" (equivalent to "/boot/", not to "/" as intended).
 
(Side note: A possible (but very annoying) workaround is to use (multiple) "../" for CONFIG+APPEND, adding one additional cfg file in a subdirectory one level down from the intended final base directory, just for the purpose of going one level up. That way, the relative path after multiple "../" also has at least one additional directory at its end, and then the additional cfg file changes the base directory up one last level).
 
In the above "Example C" I show the unsupported path in the APPEND line (changing the base directory), but the same is relevant for the CONFIG line (changing to a new cfg file).
 

It is worth noting that ISOLINUX already supports multiple "../" in CONFIG+APPEND.
 
My request is to add support in SYSLINUX for cases like the above "Example C".
 
Another example that is currently NOT working in SYSLINUX as expected can be seen at:
 -hXXp://projects.archlinux.org/archiso.git/tree/configs/releng/syslinux 
 (note the "-hXXp") 
 

If needed, I can provide additional practical examples where this additional support would be useful.
 
Please let me know if there is some testing version that should support these cases.
 
Could this support be added to SYSLINUX?
 
TIA.
  		 	   		  



More information about the Syslinux mailing list