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

p.emmerich at first-colo.net p.emmerich at first-colo.net
Fri Nov 4 06:19:28 PDT 2016

From: Paul Emmerich <p.emmerich at first-colo.net>


the new API for initramfs and files in master lacked the ability to build
initramfs objects from files loaded via HTTP/TFTP in Lua. The documentation
indicated that it should be possible (and I believe I did that in an older
version). I implemented a few new functions to handle files/initramfs
objects better.

* NEW: file:data() returns file contents as a string
* NEW: initramfs:load_file(filename, source, mode, do_mkdir)
       loads a file from source and add it an initramfs object
* CHANGED: initramfs:add_file(filename, data, mode, do_mkdir)
       data can now also be a file loaded by loadfile(name)

I've also changed the order of the do_mkdirs and mode arguments and changed
the default of do_mkdirs to true (since that is more useful). This change
is not backwards compatible, but it shouldn't be a big problem since the
new API in the current master branch is not backwards compatible with the
latest release anyways.

Let me know what you think.


Paul Emmerich (2):
  lua: improve handling of files/initramfs
  docs: document Lua syslinux module changes

 com32/lua/doc/syslinux.asc | 15 ++++++++++---
 com32/lua/src/syslinux.c   | 52 +++++++++++++++++++++++++++++++++++++---------
 2 files changed, 54 insertions(+), 13 deletions(-)


More information about the Syslinux mailing list