[syslinux:master] lua: docs: bring documentation up to date

syslinux-bot for Ferenc Wágner wferi at niif.hu
Sat Feb 14 11:09:13 PST 2015


Commit-ID:  0eb5bf809969dcb98ea9cf1653e1d0ed190b1a36
Gitweb:     http://www.syslinux.org/commit/0eb5bf809969dcb98ea9cf1653e1d0ed190b1a36
Author:     Ferenc Wágner <wferi at niif.hu>
AuthorDate: Thu, 3 Jul 2014 17:18:46 +0200
Committer:  Ferenc Wágner <wferi at niif.hu>
CommitDate: Sat, 11 Oct 2014 21:59:15 +0200

lua: docs: bring documentation up to date

Signed-off-by: Ferenc Wágner <wferi at niif.hu>

---
 com32/lua/doc/syslinux.asc | 73 ++++++++++++++++++++++++++--------------------
 1 file changed, 42 insertions(+), 31 deletions(-)

diff --git a/com32/lua/doc/syslinux.asc b/com32/lua/doc/syslinux.asc
index 4e8a1ef..6b53024 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)
 
 ......................................................
 


More information about the Syslinux-commits mailing list