[syslinux] constants and line continuation
Warren Block
wblock at wonkity.com
Tue Jul 13 11:31:05 PDT 2010
On Tue, 13 Jul 2010, Jim Cromie wrote:
> is this a good application for lua ?
>
> if lua is 'ready' when the config is requested and downloaded,
> the file could contain lua code that is run to produce all the
> menus, kernels, append-lines etc.
This got me thinking about lua as a preprocessor. Load a lua module
with UI, have it preprocess a menu file and then hand back off to a real
UI module...
And then it occurred to me that for simple constants and line
continuations, run-time evaluation isn't needed:
#define HTTPHOST http://192.168.1.1
ui vesamenu.c32
label clonezilla
menu label Clonezilla
kernel images/clonezilla/vmlinuz
append boot=live union=aufs noswap vga=788 \
ocs_lang="en_US.UTF-8" \
ocs_live_keymap="/usr/share/keymaps/i386/qwerty/us.kmap.gz" \
fetch=HTTPHOST/images/clonezilla/filesystem.squashfs
Of course you then have to "compile" your menu files before use, but
it's not bad:
% cpp -traditional-cpp menu.src default # for pxelinux.0
That "-traditional-cpp" is so the // in URLs aren't seen as comments.
More information about the Syslinux
mailing list