Merge pull request 'Implemented failsafe options at boot and inside menus for enabling/disabling serial, spkmodem and gfxterm' (#203) from livio/lbmk:failsafe into master

Reviewed-on: https://codeberg.org/libreboot/lbmk/pulls/203
20240612_branch
Leah Rowe 2024-05-03 13:59:20 +00:00
commit 9961779643
1 changed files with 57 additions and 8 deletions

View File

@ -14,6 +14,11 @@ terminal_input --append at_keyboard
terminal_input --append usb_keyboard terminal_input --append usb_keyboard
terminal_output --append cbmemc terminal_output --append cbmemc
# 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 gfxpayload=keep
terminal_output --append gfxterm terminal_output --append gfxterm
@ -24,6 +29,20 @@ elif [ -f (cbfsdisk)/background.jpg ]; then
insmod jpeg insmod jpeg
background_image (cbfsdisk)/background.jpg background_image (cbfsdisk)/background.jpg
fi 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" set default="0"
if [ -f (cbfsdisk)/timeout.cfg ]; then if [ -f (cbfsdisk)/timeout.cfg ]; then
@ -198,3 +217,33 @@ menuentry 'Load MemTest86+ [m]' --hotkey='m' {
chainloader /img/memtest chainloader /img/memtest
} }
fi 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
}
}