[syslinux] lua not working on syslinux-6.03-pre18

Ferenc Wagner wferi at niif.hu
Tue Jul 1 03:37:19 PDT 2014


Alex Bligh <alex at alex.org.uk> writes:

> Firstly, this line:
>
>    syslinux.run_kernel_image("mboot.c32", bootstr, 0, 0)
>
> no longer works at all as is. I think it was broken (probably
> intentionally) by this commit:
>
> commit 4bbaf68cbf6c9a4c850f71b19bfb9604b9327efb
> Author: Ferenc Wágner <wferi at niif.hu>
> Date:   Sun Oct 13 22:30:16 2013 +0200
>
>     lua: reactivate the syslinux extension module
>
>     Under Lua 5.2 modules are not expected to set global variables
>     to reduce namespace pollution. Explicit require() is preferred.
>
>
> What you now need is something like:
>
>    local sl = require "syslinux"
>    sl.run_kernel_image("mboot.c32", bootstr, 0, 0)

Yes.  It's mentioned in com32/lua/doc/syslinux.asc.

> Except that this ALSO won't work, because run_kernel_image is now
> (it seems) much more fussy about image types, so the required
> code is actually:
>
>    local sl = require "syslinux"
>    sl.run_kernel_image("mboot.c32", bootstr, 0, 7)
>
> with 7 being the magic number as per:
>
>    #define IMAGE_TYPE_COM32        7
>
> It would be useful if there were some Lua constants for that

OK, I'll queue a patch for that.

> or even better if it could be persuaded to autodetect based on file
> extension as the rest of the system does.

I'm not sure what changed exactly, but you can use run_command()
instead, or pass a type specifier to run_kernel_image():

sl.run_kernel_image(".com32 mboot", bootstr, 0, 0)
-- 
Regards,
Feri.



More information about the Syslinux mailing list