[syslinux] store the label name unmangled

Sebastian Herbszt herbszt at gmx.de
Mon Jul 21 10:27:32 PDT 2008


H. Peter Anvin wrote:

> This sort of works, but there is one piece of messiness: label names are 
> still "mangled", which *used* to handle stuff like case conversion, but 
> doesn't really anymore.  However, expecially for PXELINUX it is 
> problematic, since the host name prefix is actually a binary structure 
> in front of the name.
> 
> The right thing to do is really to remove this one last link between 
> label names and filenames and store the label name unmangled.  This also 
> means matching labels *before* mangling the name, i.e. to match from 
> command_line instead of KernelName using a comparison which can 
> understand end of character (the code that needs replacement is ui.inc, 
> lines 311-313), 

310                 push si
311                 mov si,KernelName
312                 mov cx,FILENAME_MAX
313                 es repe cmpsb
314                 pop si

It looks like command_line can contain spaces and be longer than 
FILENAME_MAX. mangle_name seems to take care of this for KernelName.
So this "custom compare" should compare up to FILENAME_MAX chars
and end on char <= ' '.

> and to just length-check the label name rather than 
> mangling it (parseconfig.inc, line 310).

308                 call pc_getline
309                 mov di,VKernelBuf+vk_vname
310                 call mangle_name                ; Mangle virtual name
311                 mov byte [VKernel],1            ; We've seen a "label" statement
312                 mov si,VKernelBuf+vk_vname      ; By default, rname == vname
313                 mov di,VKernelBuf+vk_rname
314                 mov cx,FILENAME_MAX
315                 rep movsb

Same seems to apply here. It should copy up to FILENAME_MAX chars from
si to di and break on char <= ' '.

Did i miss anything?

- Sebastian




More information about the Syslinux mailing list