Here are some tips for debugging strategies for grub.
During the boot process, you can press the Pause|Break key on your keyboard, and press Return to resume.
echo
See in the manual: 14.3.13 echo.
Use echo
statements:
echo 'Loading initial ramdisk...'
or:
if [ -e /boot/grub/example/test1.cfg ]; then
echo "Here"
else
echo "There"
fi
configuration file
See also in the official manual the section: "5.4 Embedding a configuration file into GRUB".
Logs