fix reboot to BIOS

This commit is contained in:
Ing 2024-08-06 09:32:56 +08:00
parent 31321a4bef
commit 3623600ac2
3 changed files with 16 additions and 11 deletions

View File

@ -362,7 +362,7 @@ function delCmdline() {
# Rebooting # Rebooting
# 1 - mode # 1 - mode
function rebootTo() { function rebootTo() {
local MODES="config recovery junior" local MODES="config recovery junior bios memtest"
if [ -z "${1}" ] || ! echo "${MODES}" | grep -qw "${1}"; then exit 1; fi if [ -z "${1}" ] || ! echo "${MODES}" | grep -qw "${1}"; then exit 1; fi
# echo "Rebooting to ${1} mode" # echo "Rebooting to ${1} mode"
GRUBPATH="$(dirname $(find ${PART1_PATH}/ -name grub.cfg 2>/dev/null | head -1))" GRUBPATH="$(dirname $(find ${PART1_PATH}/ -name grub.cfg 2>/dev/null | head -1))"

View File

@ -3613,9 +3613,9 @@ else
echo "x \"$(TEXT "Reboot to RR")\"" >>"${TMP_PATH}/menu" echo "x \"$(TEXT "Reboot to RR")\"" >>"${TMP_PATH}/menu"
echo "y \"$(TEXT "Reboot to Recovery")\"" >>"${TMP_PATH}/menu" echo "y \"$(TEXT "Reboot to Recovery")\"" >>"${TMP_PATH}/menu"
echo "z \"$(TEXT "Reboot to Junior")\"" >>"${TMP_PATH}/menu" echo "z \"$(TEXT "Reboot to Junior")\"" >>"${TMP_PATH}/menu"
if efibootmgr | grep -q "^Boot0000"; then #if efibootmgr | grep -q "^Boot0000"; then
echo "b \"$(TEXT "Reboot to BIOS")\"" >>"${TMP_PATH}/menu" echo "b \"$(TEXT "Reboot to BIOS")\"" >>"${TMP_PATH}/menu"
fi #fi
echo "s \"$(TEXT "Back to shell")\"" >>"${TMP_PATH}/menu" echo "s \"$(TEXT "Back to shell")\"" >>"${TMP_PATH}/menu"
echo "e \"$(TEXT "Exit")\"" >>"${TMP_PATH}/menu" echo "e \"$(TEXT "Exit")\"" >>"${TMP_PATH}/menu"
@ -3657,8 +3657,9 @@ else
b) b)
DIALOG --title "$(TEXT "Main menu")" \ DIALOG --title "$(TEXT "Main menu")" \
--infobox "$(TEXT "Reboot to BIOS")" 0 0 --infobox "$(TEXT "Reboot to BIOS")" 0 0
efibootmgr -n 0000 >/dev/null 2>&1 #efibootmgr -n 0000 >/dev/null 2>&1
reboot #reboot
rebootTo bios
exit 0 exit 0
;; ;;
s) s)

View File

@ -123,6 +123,15 @@ menuentry 'Configure loader' --id config {
echo "Booting..." echo "Booting..."
} }
menuentry 'Enter BIOS Setup' --id bios {
fwsetup
}
menuentry 'Start Memtest86+' --id memtest {
echo "Loading memtest86+..."
linux ${prefix}/memtest
}
if [ ${vesa_mode} = 1 ]; then if [ ${vesa_mode} = 1 ]; then
menuentry 'Change vesa to text video mode' --id videomode { menuentry 'Change vesa to text video mode' --id videomode {
set vesa_mode=0 set vesa_mode=0
@ -137,8 +146,3 @@ else
configfile ${prefix}/grub.cfg configfile ${prefix}/grub.cfg
} }
fi fi
menuentry 'Start Memtest86+' --id memtest {
echo "Loading memtest86+..."
linux ${prefix}/memtest
}