From 96ae7c7c8bb2899b5fede38e44891ebe08f41ea5 Mon Sep 17 00:00:00 2001 From: TCFFan123 Date: Mon, 24 Jun 2024 16:55:02 -0400 Subject: [PATCH] New feature: Test mode test mode allows testing .sh files to make sure they work --- boot/grub/loopback.cfg | 1 + boot/grubfm/settings.sh | 3 ++ boot/grubfm/testmode.lua | 72 ++++++++++++++++++++++++++++++++++++++++ 3 files changed, 76 insertions(+) create mode 100644 boot/grub/loopback.cfg create mode 100644 boot/grubfm/testmode.lua diff --git a/boot/grub/loopback.cfg b/boot/grub/loopback.cfg new file mode 100644 index 0000000..3f21bc0 --- /dev/null +++ b/boot/grub/loopback.cfg @@ -0,0 +1 @@ +linux (${root})/grubfm.elf diff --git a/boot/grubfm/settings.sh b/boot/grubfm/settings.sh index b387c5c..012105e 100644 --- a/boot/grubfm/settings.sh +++ b/boot/grubfm/settings.sh @@ -131,4 +131,7 @@ menuentry $"Enable serial terminal" --class ms-dos { terminal_output --append serial; } +menuentry "Test mode" --class settings { + lua ${PREFIX}/testmode.lua + source ${prefix}/global.sh; diff --git a/boot/grubfm/testmode.lua b/boot/grubfm/testmode.lua new file mode 100644 index 0000000..a90d99f --- /dev/null +++ b/boot/grubfm/testmode.lua @@ -0,0 +1,72 @@ +local sh_list = +{ + distro/alt.sh + distro/andmenu.sh + distro/android.sh + distro/antix.sh + distro/archlinux.sh + distro/austrumi.sh + distro/blackarch.sh + distro/calculate.sh + distro/cdlinux.sh + distro/chakra.sh + distro/debian.sh + distro/debinstmenu.sh + distro/debmenu.sh + distro/dsl-old.sh + distro/fedora.sh + distro/freebsd.sh + distro/gentoo.sh + distro/hyper.sh + distro/ipfire.sh + distro/kaos.sh + distro/knoppix.sh + distro/krd.sh + distro/liveslack.sh + distro/netbsd.sh + distro/openbsd.sh + distro/parabola.sh + distro/pclinuxos.sh + distro/pentoo.sh + distro/plop.sh + distro/pmagic.sh + distro/porteus.sh + distro/proxmox.sh + distro/sabayon.sh + distro/siduction.sh + distro/slax.sh + distro/smartos.sh + distro/suse64.sh + distro/sysrcd.sh + distro/sysresccd.sh + distro/tinycore.sh + distro/ubuntu.sh + distro/veket.sh + distro/wifislax.sh + distro/win.sh + distro/winxp.sh + func.sh + global.sh + hwinfo.sh + init.sh + lang.sh + netboot.sh + osdetect.sh + power.sh + pxeinit.sh + search.sh + settings.sh + util.sh +} + +local function search_sh (sh_table) + local j = 0 + for i, wim in ipairs (sh_list) do + if (grub.file_exist (sh)) then + print ("found .sh file " .. sh) + j = j + 1 + sh_table[j] = sh + end + end + return j +end \ No newline at end of file