[syslinux] [PATCH 2/2] COM32: lua - add dmi library

Marcel Ritter Marcel.Ritter at rrze.uni-erlangen.de
Wed Dec 10 05:31:46 PST 2008


Hi again,

this is the second part of the patch extending lua. This time it adds
the dmi functions (com32/modules/dmi*) to lua:

 dmi.supported(): returns true if DMI is supported
 dmi.gettable(): returns array of key, value pairs containing system info

Sorry, but this patch does not apply cleanly if [PATCH 1/2] was applied
before.  There's just one line to fix in com32/lua/src/linit.c however:
"      {LUA_DMILIBNAME, luaopen_dmi},"


Usage example:

if (dmi.supported()) then
  dmitable = dmi.gettable()
  for k,v in pairs(dmitable) do
    print(k, v)
  end
  print(dmitable["system.manufacturer"])
  print(dmitable["system.product_name"])
  print(dmitable["bios.bios_revision"])

  if ( string.match(dmitable["system.product_name"], "ESPRIMO P7935") ) then
    print("Matches")
    syslinux.run_command("memdisk initrd=/dos/BIOS/FSC-P7935-108.img raw")
  else
    print("Does not match")
  end
end




Bye,
    Marcel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: syslinux-lua-dmi.diff
Type: text/x-patch
Size: 10295 bytes
Desc: not available
URL: <http://www.zytor.com/pipermail/syslinux/attachments/20081210/30d060ce/attachment.bin>


More information about the Syslinux mailing list