From 8033fca9669a874c953764dc59338887ec6230c1 Mon Sep 17 00:00:00 2001 From: a random person on the internet Date: Sun, 4 Aug 2024 20:39:12 -0400 Subject: [PATCH] update (written by AI) Added new function grubfm_view, updated global.sh and osdetect.sh, modified rules/generic/dummy.sh and themes/slack/fm.txt, updated ver.txt, and changed update_grub2.sh script. --- boot/grubfm/func.sh | 6 ++++++ boot/grubfm/global.sh | 4 ++++ boot/grubfm/osdetect.sh | 15 ++++++++++++++- boot/grubfm/rules/generic/dummy.sh | 1 - boot/grubfm/themes/slack/fm.txt | 5 +++++ boot/grubfm/ver.txt | 2 +- update_grub2.sh | 4 ++-- 7 files changed, 32 insertions(+), 5 deletions(-) diff --git a/boot/grubfm/func.sh b/boot/grubfm/func.sh index 963cf67e..b95e83d7 100644 --- a/boot/grubfm/func.sh +++ b/boot/grubfm/func.sh @@ -47,6 +47,12 @@ function swap_hd01 { fi; } +grubfm_view() { + loopback $grubfm_file + grubfm_set -r (loop) + grubfm "(loop)/" +} + unset grubfm_path; regexp --set=1:grubfm_path '(/.*)$' "${grubfm_file}"; export grubfm_path; diff --git a/boot/grubfm/global.sh b/boot/grubfm/global.sh index 5817831a..b4dace18 100644 --- a/boot/grubfm/global.sh +++ b/boot/grubfm/global.sh @@ -48,6 +48,10 @@ hiddenentry " " --hotkey f6 { configfile ${prefix}/power.sh; } +hiddenentry " " --hotkey f7 { + configfile ${prefix}/init.sh; +} + if [ -n "${grubfm_current_path}" ]; then hiddenentry " " --hotkey 0x02000066 { diff --git a/boot/grubfm/osdetect.sh b/boot/grubfm/osdetect.sh index a803b5ff..9d2a40d8 100644 --- a/boot/grubfm/osdetect.sh +++ b/boot/grubfm/osdetect.sh @@ -103,9 +103,22 @@ if [ -f "(${device})/boot/grub/grub.cfg" ]; fi; # not tested, but it should work under EFI. Legacy BIOS will fail to load this though menuentry "Boot Ventoy on ${device} ${info} ${device}" { -terminal_output console + terminal_output console chainloader (${root})/EFI/BOOT/ventoyx64.efi } + +menuentry "Search for /boot/grubfm/config and load it" { + search --set=user -f -q /boot/grubfm/config + export user + if [ -n "${user}" ]; + then + grubfm_set -u "${user}" + source (${user})/boot/grubfm/config + fi; + else + echo Did not find config. + configfile (memdisk)/boot/grubfm/osdetect.sh +} fi; fi; if [ "${grub_platform}" = "efi" ]; diff --git a/boot/grubfm/rules/generic/dummy.sh b/boot/grubfm/rules/generic/dummy.sh index c6b32b25..e7474c86 100644 --- a/boot/grubfm/rules/generic/dummy.sh +++ b/boot/grubfm/rules/generic/dummy.sh @@ -1,4 +1,3 @@ -# this script allows access to the other menus in g2fm source ${prefix}/func.sh; if [ -f "${theme_fm}" ]; then diff --git a/boot/grubfm/themes/slack/fm.txt b/boot/grubfm/themes/slack/fm.txt index 7c7ba1bf..8c78a691 100644 --- a/boot/grubfm/themes/slack/fm.txt +++ b/boot/grubfm/themes/slack/fm.txt @@ -62,6 +62,11 @@ terminal-box: "term_bkg_*.png" + label {text = "[F6]" color = "#ffffff"} + image {file = "dock/logout.png"} } + + image {file = "dock/space.png"} + + vbox { + + label {text = "[F7]" color = "#ffffff"} + + image {file = "icons/reboot.png"} + } } + hbox { diff --git a/boot/grubfm/ver.txt b/boot/grubfm/ver.txt index 35749d69..c6072464 100644 --- a/boot/grubfm/ver.txt +++ b/boot/grubfm/ver.txt @@ -1 +1 @@ -e74f3c1c-6b83-45f6-9bd1-63ea2f02fd8d +9582db44-684c-4f60-8d21-fad35bc9d5dd diff --git a/update_grub2.sh b/update_grub2.sh index 3f2bf60c..cec2592c 100755 --- a/update_grub2.sh +++ b/update_grub2.sh @@ -1,4 +1,4 @@ #!/usr/bin/env sh -rm -rf grub wget https://github.com/a1ive/grub/releases/download/latest/grub2-latest.tar.gz -O grub2-latest.tar.gz -tar -v -xf grub2-latest.tar.gz +echo Extracting files... +tar --overwrite -xf grub2-latest.tar.gz