[syslinux] [PATCH 0/2] improve Lua API for files and initramfs objects

hpa at zytor.com hpa at zytor.com
Sat Nov 19 16:12:44 PST 2016


On November 19, 2016 6:06:43 AM PST, wferi at niif.hu wrote:
>"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.

It was the "for completeness" part that I wanted to know.

Incidentally, why do we copy the data if it is in a Lua string (or are we?) Seems pointless to me.
-- 
Sent from my Android device with K-9 Mail. Please excuse my brevity.


More information about the Syslinux mailing list