[syslinux] Conditional kernel selection based on CPUID/DMI info
H. Peter Anvin
hpa at zytor.com
Tue Jan 29 12:05:52 PST 2008
Craig Johnston wrote:
>
> What do people think of the following for a string substitution method?
>
> DEFAULT linux
>
> LABEL linux
> KERNEL cpuselect.c32
> APPEND ${LM?"x86_64":"i386"}/bzImage-${SMP?"smp":"up"}
> initrd=${LM?"x86_64":"i386"}/initrd-${SMP?"smp":"up"} console=ttyS0
>
> LABEL linux-single
> KERNEL cpuselect.c32
> APPEND ${LM?"x86_64":"i386"}/bzImage-${SMP?"smp":"up"}
> initrd=${LM?"x86_64":"i386"}/initrd-${SMP?"smp":"up"} console=ttyS0
> single
>
> The parameters "LM" and "SMP" are Boolean values that are set in the
> cpuselect.c32 module, and select the replacement text ala the C-like
> conditional statement. This is just one of many ways to do something
> like this, and it would seem a lot simpler than a full fledged
> scripting language (it's all kept inside a module).
>
> Am I reinventing the wheel here, or inventing a square wheel? :)
>
I think we can consider a pattern-substitution module to be the
beginning of a scripting language. We should probably have it collect
information from as many sources as possible (CPUID, ...)
On the other hand, a fullblown scripting language probably would be easy
enough -- it's not really any different than what you're doing above.
It's just a matter of having the time to do it...
-hpa
More information about the Syslinux
mailing list