[syslinux] [PATCH 1/1] COMBOOT API: Add get current working directory call to most

Gene Cumm gene.cumm at gmail.com
Tue Nov 11 10:14:15 PST 2008


On Mon, Nov 10, 2008 at 5:14 PM, Geert Stappers <stappers at stappers.nl> wrote:
> Op 20081110 om 11:28 schreef H. Peter Anvin:
>> Gene Cumm wrote:
>> > On the flip side, PXELINUX does assume that it can use "/" when trying
>> > to find the configuration.
>
> 'does assume'  ???
>

To quote pxelinux.asm(line 2731 in head):

cfgprefix	db 'pxelinux.cfg/'		; No final null!

It always searches for configuration files as [PathPrefix][cfgprefix]
then appends formatted UUID, formatted MAC and IP address (from 8 to 1
hexadecimal characters) then default such that the last file attempted
is always [PathPrefix]pxelinux.cfg/default however it is up to the
TFTP server to interpret the characters in any way it sees fit.

Hence why I say that PXELINUX assumes that "/" is a part of the valid
path name character set.  If it were not, using PXELINUX would be
impossible.  From here, you could also build the minimum allowable
character set (which is a little silly but might be good for an
academic exercise or diagnostics).

>
> Back to directory separators in the Syslinux project.
>
> dictated by the file system
> SYSLINUX:   \
> ISOLINUX:   \
> EXTLINUX:   /
>
> PXELINUX:   /
> It is up to us agree that a slash is the directory separator.
>

I didn't think that the directory separator was dictated by the
filesystem but rather the environment using it (boot loader, OS, etc).
 When Linux goes to interpret a MAC OS Classic filesystem (HFS, I
think), it would probably have to escape the "/" in a file name in
order to use it.  When Linux uses a vfat filesystem, it always uses
"/" as the directory separator.  Also, I know SYSLINUX mangles path
names to use "/" rather than "\" as a directory separator (backwards
compatibility for users accustomed to DOS naming, I think).  I think
the others require "/" as the directory separator (looking at the .asm
files).

On a related topic, it would almost seem that mangling/unmangling the
tail (after derivative-specific prefixes) of a filename could be moved
to a common .inc file.  This might be more useful for \-escapes but
looking at the size of the existing code, probably won't show benefit
unless \-escape coding is to be included.

>
> Why slash?  (and not backslash?)
> Because it matches http://www.kernel.org/pub/linux/utils/boot/syslinux/
> and git://git.kernel.org/pub/scm/boot/syslinux/syslinux.git
>

I agree that _if_ we were to standardize on one directory separator,
it should be "/" and not "\".  I think Peter's point is not what to
standardize with but whether to standardize with PXELINUX.  PXELINUX
deals only with path names (absolute to the server, URLs (if GPXE) and
relative to the [PathPrefix] of the server, I think) and not
(separately) directory names and filenames as the TFTP server
abstracts that away, providing a file system interface rather than a
block interface and must manually build a file system interface.

It would be possible (however probably not wise) to design a file
system that utilized two distinct character sets, one for directory
names, and another for file names.  Most (if not all) file systems use
the same character set for directory names and file names.

>
> The slash might indeed inconvinent for some TFTP servers.
> But at server side are more resources available
> then at bootloader side being the small client.
>

Definitely agree on that.

>
> Two cents from
> Geert Stappers

-Gene




More information about the Syslinux mailing list