diff options
author | Ferenc Wágner <wferi@niif.hu> | 2014-10-13 12:31:47 +0200 |
---|---|---|
committer | Ferenc Wágner <wferi@niif.hu> | 2014-10-13 12:44:15 +0200 |
commit | 6b68a381be780b83a1df0033fd82819a6d642676 (patch) | |
tree | fc15dfb8536e7dae00e00608425e4f6d54bf5c62 | |
parent | 7952d37662a5738ba22eef45b5eae4f2ff41e909 (diff) | |
download | syslinux-6b68a381be780b83a1df0033fd82819a6d642676.tar.gz syslinux-6b68a381be780b83a1df0033fd82819a6d642676.tar.xz syslinux-6b68a381be780b83a1df0033fd82819a6d642676.zip |
lua: move the automenu test from the boot_linux to the boot_it binding
Signed-off-by: Ferenc Wágner <wferi@niif.hu>
-rw-r--r-- | com32/lua/test/automenu.lua | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/com32/lua/test/automenu.lua b/com32/lua/test/automenu.lua index 1e66cca1..891adbc0 100644 --- a/com32/lua/test/automenu.lua +++ b/com32/lua/test/automenu.lua @@ -26,6 +26,17 @@ local function modifiers () return (single and " single" or "") .. ({" quiet",""," debug"})[verbosity] end +local function boot (kernel_path, initrd_path, cmdline) + print ("Loading " .. kernel_path .. " ...") + local kernel = sl.loadfile (kernel_path) + local initrd + if (initrd_path) then + print ("Loading " .. initrd_path .. " ...") + initrd = sl.initramfs():load (initrd_path) + end + sl.boot_it (kernel, initrd, cmdline) +end + local function scan (params) local sep = string.sub (params.dir, -1) == "/" and "" or "/" if not params.items then params.items = {} end @@ -35,14 +46,16 @@ local function scan (params) local from,to,version = string.find (name, "^vmlinuz%-(.*)") if from then local initrd = params.dir .. sep .. "initrd.img-" .. version - local initrd_param = "" - if lfs.attributes (initrd, "size") then - initrd_param = "initrd=" .. initrd .. " " + if not lfs.attributes (initrd, "size") then + initrd = nil end table.insert (params.items, { - show = function () return name end, + show = function () return name .. (initrd and " +initrd" or "") end, version = version, - execute = function () sl.boot_linux (path, initrd_param .. params.append .. modifiers ()) end + execute = function () + boot (path, initrd, + params.append .. modifiers ()) + end }) end end |