From: Ralph Ronnquist Date: Wed, 8 Nov 2023 07:12:59 +0000 (+1100) Subject: some more testing X-Git-Url: https://git.rrq.au/?a=commitdiff_plain;h=4787f88fb3861e750bd0927ee7873905d2f829ca;p=rrq%2Ftiniest.git some more testing --- diff --git a/muffin.lua b/muffin.lua index ed79f3a..23ad342 100644 --- a/muffin.lua +++ b/muffin.lua @@ -1,16 +1,74 @@ local sl = require "syslinux" local vesa = require "vesa" +local dmi = require "dmi" +local pci = require "pci" -vesa.setmode() -vesa.load_background "sample2.jpg" +vesa.setmode("800x600") +--vesa.load_background "sample2.jpg" for c in string.gmatch ("Hello World! - VESA mode", ".") do io.write (c) - sl.msleep(200) + sl.msleep(10) end --- vesa.load_background "PXE-RRZE_small.jpg" -sl.sleep(3) +io.write("\n") + + +-- cmdline(ix) = concatenates the command line arguments from +-- the index ix and up, with space separation +function cmdline(ix) + local line = "" + while arg[ix] do + line = line .. " " .. arg[ix] + ix = ix + 1 + end + return string.sub(line,2) -- drop the initial space +end + +-- dumptable(tbl) = print table entries +function dumptable(name, tbl,vtype) + print("== begin "..name) + if tbl then + for k,v in pairs(tbl) do + if vtype == nill or type(v) == vtype then + print(k,v) + end + end + else + print(nil) + end + print( "== end " .. name ) + return nil +end + +-- dump_G(k) = print the value of _G[k] +function dump_G(k) + dumptable(k,_G[k],nil) + return nil +end + +--[[ +dumptable("tables",_G,"table") +dumptable("package.loaded",_G["package"]["loaded"], nil) +dumptable("pci.getidlist",pci.getidlist("/pci.ids"), nil) +]] + +-- [[ +dmitable = dmi.gettable() +dumptable("dmitable",dmitable,nil) +--dumptable("dmitable.dmi_info",dmitable["dmi_info"],nil) +--]] + +-- [[ +-- dumptable("dmitable.system",dmitable.system,nil) +-- dumptable("dmitable.bios",dmitable.bios,nil) +--dumptable("dmitable.chassis",dmitable.chassis,nil) +--]] + +print(arg[1].." "..cmdline(2)) +x = sl.get_key(600000) + +sl.boot_linux(arg[1],cmdline(2)) -- Return to vesamenu -sl.run_command("vesamenu.") +sl.run_command("vesamenu") diff --git a/syslinux-legacy.cfg b/syslinux-legacy.cfg index dc141fc..7b591f1 100644 --- a/syslinux-legacy.cfg +++ b/syslinux-legacy.cfg @@ -2,7 +2,8 @@ menu title Tiniest ISO (legacy) path /boot/syslinux/bios # Note that the path is on the EFI/FAT partition -default vesamenu.c32 +#default vesamenu.c32 +default luatest menu margin 0 menu rows 7 @@ -17,5 +18,7 @@ label linux kernel vmlinuz sysappend 0x78074 append initrd=initrd.gz init=/init root=/dev/sda1 -path /boot/syslinux/bios -include /bootmenu.cfg + +label luatest + kernel lua.c32 + append -i -- EFI/BOOT/muffin.lua /vmlinuz initrd=/initrd.gz init=/init root=/dev/ram0 diff --git a/syslinux-uefi.cfg b/syslinux-uefi.cfg index a54df20..94a5bdb 100644 --- a/syslinux-uefi.cfg +++ b/syslinux-uefi.cfg @@ -2,7 +2,7 @@ menu title Tiniest ISO (uefi boot) path /EFI/BOOT/efi64 # Note that the path is on the EFI/FAT partition -default vesamenu.c32 +default luatest menu margin 0 menu rows 7 @@ -11,13 +11,14 @@ menu background splash.png label uefi kernel /vmlinuz sysappend 0x78074 - append initrd=/initrd.gz init=/init root=/dev/sda1 + append initrd=/initrd.gz init=/init root=/dev/ram0 label linux kernel vmlinuz sysappend 0x78074 - append initrd=initrd.gz init=/init root=/dev/sda1 + append initrd=/initrd.gz init=/init root=/dev/ram0 -label lua test +label luatest kernel lua.c32 - append muffin.lua + append -i -- muffin.lua /vmlinuz initrd=/initrd.gz init=/init root=/dev/ram0 +