grub.cfg: clean up messages, be less verbose

This commit is contained in:
Leah Rowe 2021-12-29 06:23:57 +00:00
parent 86d4ca9b50
commit 9b1499fd1e
1 changed files with 5 additions and 12 deletions

View File

@ -42,18 +42,15 @@ function try_user_config {
done done
} }
function search_grub { function search_grub {
echo -n "Attempting to load grub.cfg from: " echo -n "Attempting to load grub.cfg from '${1}' devices"
for i in 0 1 2 3 4 5 6 7 8 9 10 11; do for i in 0 1 2 3 4 5 6 7 8 9 10 11; do
echo "\nTrying disk ${1}${i}"
for part in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20; do for part in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20; do
echo "\nTrying partiton ${part}"
try_user_config "(${1}${i},${part})" try_user_config "(${1}${i},${part})"
done done
# raw devices e.g. (ahci0) instead of (ahci0,1) # raw devices e.g. (ahci0) instead of (ahci0,1)
echo "\nTrying to boot to a raw disk ..."
try_user_config "(${1}${i})" try_user_config "(${1}${i})"
echo # Insert newline
done done
echo # Insert newline
} }
function try_isolinux_config { function try_isolinux_config {
@ -67,18 +64,15 @@ function try_isolinux_config {
done done
} }
function search_isolinux { function search_isolinux {
echo "\nAttempting to parse isolinux/syslinux config from '${1}' devices"
for i in 0 1 2 3 4 5 6 7 8 9 10 11; do for i in 0 1 2 3 4 5 6 7 8 9 10 11; do
echo "\nAttempting to parse isolinux menu from ${1}${i}"
for part in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20; do for part in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20; do
echo "\nTrying partiton ${part}"
try_isolinux_config "(${1}${i},${part})" try_isolinux_config "(${1}${i},${part})"
done done
# raw devices e.g. (usb0) instead of (usb0,1) # raw devices e.g. (usb0) instead of (usb0,1)
echo "\nTrying raw usb device ..."
try_isolinux_config "(${1}${i})" try_isolinux_config "(${1}${i})"
echo # Insert newline
done done
echo # Insert newline
} }
menuentry 'Load Operating System (incl. fully encrypted disks) [o]' --hotkey='o' { menuentry 'Load Operating System (incl. fully encrypted disks) [o]' --hotkey='o' {
search_grub ahci search_grub ahci
@ -109,9 +103,8 @@ menuentry 'Load Operating System (incl. fully encrypted disks) [o]' --hotkey='o
done done
set pager=0 set pager=0
echo -n "Attempting to cryptomount: " echo -n "Attempting to unlock encrypted volumes"
for dev in ${ahcidev} ${atadev} ${lvmvol} ${raidvol}; do for dev in ${ahcidev} ${atadev} ${lvmvol} ${raidvol}; do
echo -n "${dev} "
if cryptomount "${dev}" ; then break ; fi if cryptomount "${dev}" ; then break ; fi
done done
set pager=1 set pager=1