diff options
author | livio <livio@codeberg.org> | 2024-04-29 14:39:47 +0200 |
---|---|---|
committer | livio <livio@codeberg.org> | 2024-04-29 14:39:47 +0200 |
commit | 3e86b3ab731fdf086c653d791f92ff7094bbb798 (patch) | |
tree | 9a6f4ce57ef759e453cadac2c18804de6094e50a /config/grub/config/grub.cfg | |
parent | 6b11f1b055466982747f65665506173a0b22557b (diff) |
Implemented failsafe options at boot and inside menus for enabling/disabling serial, spkmodem and gfxterm
Diffstat (limited to 'config/grub/config/grub.cfg')
-rw-r--r-- | config/grub/config/grub.cfg | 67 |
1 files changed, 58 insertions, 9 deletions
diff --git a/config/grub/config/grub.cfg b/config/grub/config/grub.cfg index 17576b5f..a433000e 100644 --- a/config/grub/config/grub.cfg +++ b/config/grub/config/grub.cfg @@ -14,17 +14,36 @@ terminal_input --append at_keyboard terminal_input --append usb_keyboard terminal_output --append cbmemc -gfxpayload=keep -terminal_output --append gfxterm - -if [ -f (cbfsdisk)/background.png ]; then - insmod png - background_image (cbfsdisk)/background.png -elif [ -f (cbfsdisk)/background.jpg ]; then - insmod jpeg - background_image (cbfsdisk)/background.jpg +# User interface overrides wherever "keystatus" is supported +# Keep SHIFT key pressed before powering on to disable graphics +if keystatus --shift; then + terminal_output --append vga_text +else + gfxpayload=keep + terminal_output --append gfxterm + + if [ -f (cbfsdisk)/background.png ]; then + insmod png + background_image (cbfsdisk)/background.png + elif [ -f (cbfsdisk)/background.jpg ]; then + insmod jpeg + background_image (cbfsdisk)/background.jpg + fi +fi + +# Keep CTRL pressed to enable default serial terminal (COM1 or the like) +if keystatus --ctrl; then + serial + terminal_input --append serial + terminal_output --append serial fi +# Keep ALT pressed to enable spkmodem +if keystatus --alt; then + terminal_output --append spkmodem +fi + + set default="0" if [ -f (cbfsdisk)/timeout.cfg ]; then source (cbfsdisk)/timeout.cfg @@ -198,3 +217,33 @@ menuentry 'Load MemTest86+ [m]' --hotkey='m' { chainloader /img/memtest } fi + +submenu 'Other [z]' --hotkey='z' { + menuentry 'Enable default serial terminal [s]' --hotkey='s' { + serial + terminal_input --append serial + terminal_output --append serial + } + + menuentry 'Disable default serial terminal' { + terminal_input --remove serial + terminal_output --remove serial + } + + menuentry 'Enable gfxterm' { + terminal_output --append gfxterm + terminal_output --remove vga_text + } + menuentry 'Disable gfxterm [g]' --hotkey='g' { + terminal_output --remove gfxterm + terminal_output --append vga_text + } + + menuentry 'Enable spkmodem [a]' --hotkey='a' { + terminal_output --append spkmodem + } + + menuentry 'Disable spkmodem [z]' --hotkey='z' { + terminal_output --remove spkmodem + } +}
\ No newline at end of file |