Skip to content

Instantly share code, notes, and snippets.

@wferi
Last active December 25, 2015 14:09
Show Gist options
  • Save wferi/6989458 to your computer and use it in GitHub Desktop.
Save wferi/6989458 to your computer and use it in GitHub Desktop.
[PATCH 00/20] Upgrade to Lua 5.2.2, add filesystem module and get_key() binding
Cover letter for the lua52 branch at https://github.com/wferi/syslinux
Hi,
This series targets automatic boot menu generation, but most of it
is the Lua upgrade, because I got tired reading deprecated API docs.
It's mostly a straightforward forward port of the earlier Syslinux
specific changes to Lua 5.1, except that:
* I chose to add a stub getenv() implementation to the COM32 API
instead of #ifdefing out all the references in Lua, and
* I kept oslib for its exit() and getenv() functions.
I kept the various changes needed to make Lua compile in separate
commits to simplify future forward porting, but this breaks the
Syslinux build until the 12th patch in the series. Shall I disable
Lua until then, or is this breakage a manageable inconvenience during
bisection? Also, the current extension modules are disabled during
this series, but re-enable at the end (with a slight change in usage:
they must be explicitly require()d before use).
The Lua 5.2.2 tarball does not contain tests, so that directory is
gone now. They were not of much use in my opinion.
Maybe the extension modules should be moved into another directory,
I'm not sure.
And an official stat() implementation would be very useful. After
inventing mine, I noticed rosh also invented its own...
Comments welcome.
Ferenc Wágner (20):
lua: import Lua 5.2.2
lua: replace src/Makefile to build Lua as a Syslinux COM32 module
dev.h: get size_t definition
lua: the COM32 API does not provide signal.h
lua: the COM32 API does not provide locale.h
lua: use integer arithmetic
lua: the COM32 API does not provide strcoll()
lua: the COM32 API supports only part of iolib
stdlib.h: provide a stub definition for getenv()
lua: the COM32 API actually supports exit() of oslib
lua: the COM32 API does not support time()
lua: the COM32 API does not support freopen()
sys/module.h: remove the #ifdef DYNAMIC_MODULE condition
sys/module.h: fix some typos in function documentations
lua: enable dynamic module loading
lua: add the LuaFileSystem library
lua: reactivate the syslinux extension module
lua: bind get_key() in the syslinux module
lua: also reactivate the cpu, dhcp, dmi, pci and vesa extension
modules
lua: make the dmi module standalone
com32/include/dev.h | 1 +
com32/include/stdlib.h | 7 +-
com32/include/sys/module.h | 25 +-
com32/lua/COPYRIGHT | 34 -
com32/lua/HISTORY | 183 -
com32/lua/INSTALL | 99 -
com32/lua/Makefile | 114 +
com32/lua/Makefile-orig | 120 -
com32/lua/README | 37 +-
com32/lua/doc/amazon.gif | Bin 797 -> 0 bytes
com32/lua/doc/contents.html | 286 +-
com32/lua/doc/cover.png | Bin 3305 -> 0 bytes
com32/lua/doc/lua.1 | 121 +-
com32/lua/doc/lua.css | 48 +-
com32/lua/doc/lua.html | 172 -
com32/lua/doc/luac.1 | 86 +-
com32/lua/doc/luac.html | 145 -
com32/lua/doc/manual.css | 17 +-
com32/lua/doc/manual.html | 7472 ++++++++++++++++++++------------
com32/lua/doc/osi-certified-72x60.png | Bin 0 -> 3774 bytes
com32/lua/doc/readme.html | 402 +-
com32/lua/doc/syslinux.asc | 6 +
com32/lua/etc/Makefile | 44 -
com32/lua/etc/README | 37 -
com32/lua/etc/all.c | 38 -
com32/lua/etc/lua.ico | Bin 1078 -> 0 bytes
com32/lua/etc/lua.pc | 31 -
com32/lua/etc/luavs.bat | 28 -
com32/lua/etc/min.c | 39 -
com32/lua/etc/noparser.c | 50 -
com32/lua/etc/strict.lua | 41 -
com32/lua/src/Makefile | 26 +-
com32/lua/src/Makefile-orig | 182 -
com32/lua/src/cpu.c | 6 +-
com32/lua/src/dhcp.c | 4 +-
com32/lua/src/dmi.c | 16 +-
com32/lua/src/lapi.c | 867 ++--
com32/lua/src/lapi.h | 14 +-
com32/lua/src/lauxlib.c | 947 ++--
com32/lua/src/lauxlib.h | 126 +-
com32/lua/src/lbaselib.c | 567 +--
com32/lua/src/lbitlib.c | 211 +
com32/lua/src/lcode.c | 404 +-
com32/lua/src/lcode.h | 21 +-
com32/lua/src/lcorolib.c | 155 +
com32/lua/src/lctype.c | 52 +
com32/lua/src/lctype.h | 95 +
com32/lua/src/ldblib.c | 214 +-
com32/lua/src/ldebug.c | 620 ++-
com32/lua/src/ldebug.h | 27 +-
com32/lua/src/ldo.c | 661 +--
com32/lua/src/ldo.h | 33 +-
com32/lua/src/ldump.c | 43 +-
com32/lua/src/lfs.c | 294 ++
com32/lua/src/lfunc.c | 81 +-
com32/lua/src/lfunc.h | 7 +-
com32/lua/src/lgc.c | 1410 ++++--
com32/lua/src/lgc.h | 159 +-
com32/lua/src/linit.c | 57 +-
com32/lua/src/liolib.c | 548 ++-
com32/lua/src/llex.c | 366 +-
com32/lua/src/llex.h | 27 +-
com32/lua/src/llimits.h | 221 +-
com32/lua/src/lmathlib.c | 98 +-
com32/lua/src/lmem.c | 45 +-
com32/lua/src/lmem.h | 28 +-
com32/lua/src/loadlib.c | 613 +--
com32/lua/src/lobject.c | 251 +-
com32/lua/src/lobject.h | 460 +-
com32/lua/src/lopcodes.c | 31 +-
com32/lua/src/lopcodes.h | 106 +-
com32/lua/src/loslib.c | 166 +-
com32/lua/src/lparser.c | 1015 +++--
com32/lua/src/lparser.h | 75 +-
com32/lua/src/lstate.c | 271 +-
com32/lua/src/lstate.h | 149 +-
com32/lua/src/lstring.c | 174 +-
com32/lua/src/lstring.h | 21 +-
com32/lua/src/lstrlib.c | 576 ++-
com32/lua/src/ltable.c | 203 +-
com32/lua/src/ltable.h | 15 +-
com32/lua/src/ltablib.c | 140 +-
com32/lua/src/ltm.c | 20 +-
com32/lua/src/ltm.h | 9 +-
com32/lua/src/lua.c | 338 +-
com32/lua/src/lua.h | 225 +-
com32/lua/{etc => src}/lua.hpp | 0
com32/lua/src/luac.c | 332 +-
com32/lua/src/luaconf.h | 737 ++--
com32/lua/src/lualib.h | 47 +-
com32/lua/src/lundump.c | 141 +-
com32/lua/src/lundump.h | 22 +-
com32/lua/src/lvm.c | 923 ++--
com32/lua/src/lvm.h | 26 +-
com32/lua/src/lzio.c | 34 +-
com32/lua/src/lzio.h | 8 +-
com32/lua/src/pci.c | 4 +-
com32/lua/src/print.c | 227 -
com32/lua/src/syslinux.c | 53 +-
com32/lua/src/vesa.c | 4 +-
com32/lua/test/README | 26 -
com32/lua/test/bisect.lua | 27 -
com32/lua/test/cf.lua | 16 -
com32/lua/test/cpu.lua | 19 -
com32/lua/test/dmi.lua | 21 -
com32/lua/test/echo.lua | 5 -
com32/lua/test/env.lua | 7 -
com32/lua/test/factorial.lua | 32 -
com32/lua/test/fib.lua | 40 -
com32/lua/test/fibfor.lua | 13 -
com32/lua/test/globals.lua | 13 -
com32/lua/test/hello.lua | 3 -
com32/lua/test/life.lua | 111 -
com32/lua/test/luac.lua | 7 -
com32/lua/test/pci.lua | 34 -
com32/lua/test/printf.lua | 7 -
com32/lua/test/readonly.lua | 12 -
com32/lua/test/sieve.lua | 29 -
com32/lua/test/sort.lua | 66 -
com32/lua/test/syslinux-derivative.lua | 38 -
com32/lua/test/syslinux.lua | 1 -
com32/lua/test/table.lua | 12 -
com32/lua/test/trace-calls.lua | 32 -
com32/lua/test/trace-globals.lua | 38 -
com32/lua/test/vesa.lua | 55 -
com32/lua/test/xd.lua | 14 -
126 files changed, 15141 insertions(+), 11268 deletions(-)
delete mode 100644 com32/lua/COPYRIGHT
delete mode 100644 com32/lua/HISTORY
delete mode 100644 com32/lua/INSTALL
create mode 100644 com32/lua/Makefile
delete mode 100644 com32/lua/Makefile-orig
delete mode 100644 com32/lua/doc/amazon.gif
delete mode 100644 com32/lua/doc/cover.png
delete mode 100644 com32/lua/doc/lua.html
delete mode 100644 com32/lua/doc/luac.html
create mode 100644 com32/lua/doc/osi-certified-72x60.png
delete mode 100644 com32/lua/etc/Makefile
delete mode 100644 com32/lua/etc/README
delete mode 100644 com32/lua/etc/all.c
delete mode 100644 com32/lua/etc/lua.ico
delete mode 100644 com32/lua/etc/lua.pc
delete mode 100644 com32/lua/etc/luavs.bat
delete mode 100644 com32/lua/etc/min.c
delete mode 100644 com32/lua/etc/noparser.c
delete mode 100644 com32/lua/etc/strict.lua
delete mode 100644 com32/lua/src/Makefile-orig
create mode 100644 com32/lua/src/lbitlib.c
create mode 100644 com32/lua/src/lcorolib.c
create mode 100644 com32/lua/src/lctype.c
create mode 100644 com32/lua/src/lctype.h
create mode 100644 com32/lua/src/lfs.c
rename com32/lua/{etc => src}/lua.hpp (100%)
delete mode 100644 com32/lua/src/print.c
delete mode 100644 com32/lua/test/README
delete mode 100644 com32/lua/test/bisect.lua
delete mode 100644 com32/lua/test/cf.lua
delete mode 100644 com32/lua/test/cpu.lua
delete mode 100644 com32/lua/test/dmi.lua
delete mode 100644 com32/lua/test/echo.lua
delete mode 100644 com32/lua/test/env.lua
delete mode 100644 com32/lua/test/factorial.lua
delete mode 100644 com32/lua/test/fib.lua
delete mode 100644 com32/lua/test/fibfor.lua
delete mode 100644 com32/lua/test/globals.lua
delete mode 100644 com32/lua/test/hello.lua
delete mode 100644 com32/lua/test/life.lua
delete mode 100644 com32/lua/test/luac.lua
delete mode 100644 com32/lua/test/pci.lua
delete mode 100644 com32/lua/test/printf.lua
delete mode 100644 com32/lua/test/readonly.lua
delete mode 100644 com32/lua/test/sieve.lua
delete mode 100644 com32/lua/test/sort.lua
delete mode 100644 com32/lua/test/syslinux-derivative.lua
delete mode 100644 com32/lua/test/syslinux.lua
delete mode 100644 com32/lua/test/table.lua
delete mode 100644 com32/lua/test/trace-calls.lua
delete mode 100644 com32/lua/test/trace-globals.lua
delete mode 100644 com32/lua/test/vesa.lua
delete mode 100644 com32/lua/test/xd.lua
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment