[syslinux] suggestions for global APPEND consistency

Ady ady-sf at hotmail.com
Wed Feb 13 08:11:12 PST 2013


> Instead of all this global append stuff, it would be better to have
> variable support in Syslinux for this kind of thing:
> 
>  *** syslinux.cfg start ***
> UI menu.c32
> PROMPT 1
> VARIABLE $standard_kernel_options=a lot of kernel parameters you want by default
> 
> LABEL 1
> LINUX bzImage
> INITRD initramfs
> APPPEND $standard_kernel_options
> 
> LABEL 2
> LINUX bzImage
> INITRD initramfs
> APPPEND $standard_kernel_options some extra options
> 
> LABEL 3
> LINUX bzImage
> INITRD initramfs
> APPPEND no standard kernel options but user only the parameters
> explicitly given on this append line
> *** syslinux.cfg ***
> 
> Then you can explicitly specify where you want to have some default parameters.

With my proposal, using "APPEND -" you can still specify where to use 
the default parameters and where not to.

> 
> When Syslinux parses the config file it should first get all
> "VARIABLE" variable lines and
> replace all variables in the whole config file. Then it should parse
> this in memory config file
> with the expanded variables again (it can skip the VARIABLE lines now).
> 
> So when editing LABEL 1 from the menu, the user should only see:
>   .linux bzImage initrd=initramfs a lot of kernel parameters you want by default

Which is also in my proposal.

> 
> And not:
>   .linux bzImage initrd=initramfs $standard_kernel_options
> 
> Variable support could then also be used for non append lines (like
> the path to the kernel image).
> 
> - Gert

Which is also in my proposal. The generic resulting command is 
'KERNEL' ' MENU GLOBAL APPEND' 'INITRD' 'APPEND' and any of those 
could be not-specified. For example:

 *** syslinux.cfg start ***
UI menu.c32

MENU GLOBAL APPEND linux.c32 path/to/bzImage initrd=path/to/initramfs

LABEL 1
# Just the default entry.
# No additional commands for this specific entry.
# So the resulting command is just the menu global append.

LABEL 2
INITRD path/to/a/different/initrd
# By concatenating this initrd after the menu global append
# as suggested, the last one, in this specific entry,
# is the valid initrd.

LABEL 3
COM32 linux.c32 path/to/a/different/bzImage
APPEND -
# This entry doesn't take the menu global append
# into the final resulting command.

 *** syslinux.c32 end ***

I understand the potential flexibility of using variables, but my 
guess is that it would be a bigger project than my suggested new 
directive (I of course could be completely wrong). I think my 
proposal is still worth and IMHO it has practical applications. My 
proposed directive is coherent with other directives and behaves 
consistently between menu and CLI.

I am not disregarding the potential future use of variables, but I 
still hope my proposed new directive could be implemented (hopefully, 
easier than the whole variables project). I wish I could contribute 
with its code myself. Since I don't have the knowledge, I posted my 
suggestion / request.

TIA,
Ady.


More information about the Syslinux mailing list