[syslinux] [PATCH 0/2] improve Lua API for files and initramfs objects
wferi at niif.hu
Sat Nov 19 06:06:43 PST 2016
"H. Peter Anvin" <hpa at zytor.com> writes:
> On 11/10/16 04:38, Paul Emmerich via Syslinux wrote:
>> Ferenc Wágner <wferi at niif.hu>:
>>> for reading configuration files from disk. Does it not work with HTTP/
>>> TFTP for you? Using that, load_file could be implemented in Lua as:
>> that does work, yes. It just looked like a file object should have a some way
>> to get the contents. I'm actually not using it in our scripts.
> It does seem useful. So what you are saying here is that it isn't
> actually broken, it is just suboptimal?
No, this interface is completely missing at the moment. You can read a
file using standard Lua I/O calls and work with its content. Or you can
read a file using loadfile() provided by Syslinux, but then you can't
look at its contents from Lua. You can run it as a kernel or use it as
an initramfs, but the only available Lua methods are name and size now.
Paul adds the data method to export the contents to Lua, mainly for the
sake of completeness, if I understand him correctly.
More information about the Syslinux