I have a GRUB configuration that looks like the following, where I would like to detect different key inputs so I can act accordingly, but this does not work by default:
echo ""
echo -n "server: "
echo -n $net_default_server
echo -n " client: "
net_ls_addr
echo ""
echo "--------------------------------------------------------------------------"
echo " Boot from disk in 5 seconds."
echo "Press [ENTER] for network boot. Press [TAB] for text mode network boot."
echo "--------------------------------------------------------------------------"
# this is modified sleep returning:
# 0 - timeout
# 1 - ESC
# 2 - TAB
# 3 - ENTER
sleep -i 5
set retcode=$?
clear
if [ $retcode == 1 ]; then
exit
fi
if [ $retcode == 0 ]; then
exit
fi
if [ $retcode == 3 ]; then
terminal_output gfxterm
set gfxmode="800x600;640x480;auto"
set theme=theme.txt
fi
set color_normal=white/black
set color_highlight=black/white
set menu_color_normal=white/black
set menu_color_highlight=black/white
set timeout=15
set default='Exit to EFI Shell'
set fallback='Exit to EFI Shell'
set pager=1
menuentry 'Install CentOS 8 Linux x86_64 (C8)' {
blah
}
This comes from a local grub patch I no longer have, hence my question: is this somehow possible? Even changing keys would do the trick.