diff options
author | Ferenc Wágner <wferi@niif.hu> | 2014-07-03 17:18:46 +0200 |
---|---|---|
committer | Ferenc Wágner <wferi@niif.hu> | 2014-10-11 21:59:15 +0200 |
commit | 0eb5bf809969dcb98ea9cf1653e1d0ed190b1a36 (patch) | |
tree | 6e54aa32fb4ac89934287aea7415fe22b3b3c016 /com32 | |
parent | aeff6bccaf6b836c38b52b1fd39b990d323ec404 (diff) | |
download | syslinux-0eb5bf809969dcb98ea9cf1653e1d0ed190b1a36.tar.gz |
lua: docs: bring documentation up to date
Signed-off-by: Ferenc Wágner <wferi@niif.hu>
Diffstat (limited to 'com32')
-rw-r--r-- | com32/lua/doc/syslinux.asc | 73 |
1 files changed, 42 insertions, 31 deletions
diff --git a/com32/lua/doc/syslinux.asc b/com32/lua/doc/syslinux.asc index 4e8a1efa..6b53024e 100644 --- a/com32/lua/doc/syslinux.asc +++ b/com32/lua/doc/syslinux.asc @@ -23,25 +23,27 @@ Modules Modules must be explicitly loaded into the namespace before use, for example: ...................................................... -syslinux = require ("syslinux") +local sl = require "syslinux" ...................................................... +Using +local+, as above, is good practice in scripts, but it must be +omitted when working interactively. SYSLINUX ~~~~~~~~ -.syslinux.version() +.version() Returns version string -.syslinux.derivative() +.derivative() Returns running Syslinux's derivative (ISOLINUX, PXELINUX or SYSLINUX). -.syslinux.sleep(s) +.sleep(s) Sleep for +s+ seconds -.syslinux.msleep(ms) +.msleep(ms) Sleep for +ms+ milliseconds @@ -51,7 +53,8 @@ Execute syslinux command line +command+. _Example_: ...................................................... - syslinux.run_command("memdisk initrd=/dos/BIOS/FSC-P7935-108.img raw") + local sl = require "syslinux" + sl.run_command("memdisk initrd=/dos/BIOS/FSC-P7935-108.img raw") ...................................................... .run_default() @@ -72,7 +75,7 @@ FIXME .IMAGE_TYPE -A table containing the possible "kernel" types for +run_kernel_image()+. +A table containing the possible kernel types for +run_kernel_image()+. .run_kernel_image(kernel, cmdline, ipappend_flags, type) @@ -108,26 +111,25 @@ initialized, +file+ has been loaded by loadfile(). _Example_: ...................................................... + local sl = require "syslinux" + -- get nice output printf = function(s,...) return io.write(s:format(...)) end -- function - kernel = syslinux.loadfile("/SuSE-11.1/x86_64/linux") - - printf("Filename/size: %s %d\n", syslinux.filename(kernel), syslinux.filesize(kernel)) + kernel = sl.loadfile("/SuSE-11.1/x86_64/linux") - initrd = syslinux.loadfile("/SuSE-11.1/x86_64/initrd") + printf("Filename/size: %s %d\n", sl.filename(kernel), sl.filesize(kernel)) - printf("Filename/size: %s %d\n", syslinux.filename(initrd), syslinux.filesize(initrd)) + initrd = sl.loadfile("/SuSE-11.1/x86_64/initrd") - initrd = syslinux.initramfs_init() - syslinux.initramfs_load_archive(initrd, "/SuSE-11.1/x86_64/initrd"); + printf("Filename/size: %s %d\n", sl.filename(initrd), sl.filesize(initrd)) - syslinux.boot_it(kernel, initrd, "init=/bin/bash") - - syslinux.sleep(20) + initrd = sl.initramfs_init() + sl.initramfs_load_archive(initrd, "/SuSE-11.1/x86_64/initrd"); + sl.boot_it(kernel, initrd, "init=/bin/bash") ...................................................... .KEY @@ -149,17 +151,20 @@ table, or +KEY.NONE+ on timeout. DMI ~~~ -.dmi_supported() +.supported() Returns +true+ if DMI is supported on machine, +false+ otherwise. -.dmi_gettable() +.gettable() Returns a list if key-value pairs. The key is one of the DMI property strings: FIXME list _Example_: ...................................................... + local sl = require "syslinux" + local dmi = require "dmi" + if (dmi.supported()) then dmitable = dmi.gettable() @@ -168,31 +173,30 @@ _Example_: print(k, v) end - print(dmitable["system.manufacturer"]) - print(dmitable["system.product_name"]) - print(dmitable["bios.bios_revision"]) + print(dmitable.system.manufacturer) + print(dmitable.system.product_name) + print(dmitable.bios.bios_revision) - if ( string.match(dmitable["system.product_name"], "ESPRIMO P7935") ) then + if ( string.match(dmitable.system.product_name, "ESPRIMO P7935") ) then print("Matches") - syslinux.run_command("memdisk initrd=/dos/BIOS/FSC-P7935-108.img raw") + sl.run_command("memdisk initrd=/dos/BIOS/FSC-P7935-108.img raw") else print("Does not match") - syslinux.run_command("memdisk initrd=/dos/BIOS/FSC-P7935-108.img raw") + sl.run_command("memdisk initrd=/dos/BIOS/FSC-P7935-108.img raw") end end - ...................................................... PCI ~~~ -.pci_getinfo() +.getinfo() Return list of value pairs (device_index, device) of all PCI devices. -.pci_getidlist(filename) +.getidlist(filename) Load a tab separated list of PCI IDs and their description. Sample files can be found here: http://pciids.sourceforge.net/ @@ -200,6 +204,8 @@ Sample files can be found here: http://pciids.sourceforge.net/ _Example_: ...................................................... +local pci = require "pci" + -- get nice output printf = function(s,...) return io.write(s:format(...)) @@ -244,6 +250,8 @@ Return list of available VESA modes. _Example_: ...................................................... + local vesa = require "vesa" + -- get nice output printf = function(s,...) return io.write(s:format(...)) @@ -269,6 +277,9 @@ Load +filename+ from TFTP, and use it as background image. _Example_: ...................................................... + local sl = require "syslinux" + local vesa = require "vesa" + -- get nice output printf = function(s,...) return io.write(s:format(...)) @@ -297,15 +308,15 @@ _Example_: vesa.load_background("/background1.jpg") - syslinux.sleep(1) + sl.sleep(1) for i = 1, #textline do local c = textline:sub(i,i) printf("%s", c) - syslinux.msleep(200) + sl.msleep(200) end - syslinux.sleep(10) + sl.sleep(10) ...................................................... |