I was trying to update grub due to some changes and I found the following error:
sudo update-grub
[sudo] password for ZXYZXY:
Verification successful
Generating grub configuration file ...
Found theme: /boot/grub/themes/deepin-fallback/theme.txt
Found background image: /boot/grub/themes/deepin-fallback/background.jpg
Warning: os-prober will be executed to detect other bootable partitions.
Its output will be used to detect bootable binaries on them and create new boot entries.
Adding boot menu entry for UEFI Firmware Settings ...
Syntax errors are detected in generated GRUB config file.
Ensure that there are no errors in /etc/default/grub
and /etc/grub.d/* files or please file a bug report with
/boot/grub/grub.cfg.new file attached.
I found the following error:
Aborted. Press any key to exit.root@heaven-beyond:/boot/grub# cat /etc/grub.d/41_custom
#!/bin/sh
cat <
if [ -f ${config_directory}/custom.cfg ]; then
source ${config_directory}/custom.cfg
elif [ -z "${config_directory}" -a -f $prefix/custom.cfg ]; then
source $prefix/custom.cfg
fi
EOF
I noticed that the file: /etc/grub.d/41_custom is missing some brackets {} in the {prefix} variable. I added the brackets and now I was able to update grub successfully.
#!/bin/sh
cat <
if [ -f ${config_directory}/custom.cfg ]; then
source ${config_directory}/custom.cfg
elif [ -z "${config_directory}" -a -f ${prefix}/custom.cfg ]; then
source ${prefix}/custom.cfg
fi
EOF
Generating grub configuration file ...
Found theme: /boot/grub/themes/deepin-fallback/theme.txt
Found background image: /boot/grub/themes/deepin-fallback/background.jpg
Warning: os-prober will be executed to detect other bootable partitions.
Its output will be used to detect bootable binaries on them and create new boot entries.
Adding boot menu entry for UEFI Firmware Settings ...
done
Hi,
I was trying to update grub due to some changes and I found the following error:
sudo update-grub
[sudo] password for ZXYZXY:
Verification successful
Generating grub configuration file ...
Found theme: /boot/grub/themes/deepin-fallback/theme.txt
Found background image: /boot/grub/themes/deepin-fallback/background.jpg
Warning: os-prober will be executed to detect other bootable partitions.
Its output will be used to detect bootable binaries on them and create new boot entries.
Adding boot menu entry for UEFI Firmware Settings ...
Syntax errors are detected in generated GRUB config file.
Ensure that there are no errors in /etc/default/grub
and /etc/grub.d/* files or please file a bug report with
/boot/grub/grub.cfg.new file attached.
I found the following error:
Aborted. Press any key to exit.root@heaven-beyond:/boot/grub# cat /etc/grub.d/41_custom
#!/bin/sh
cat < if [ -f ${config_directory}/custom.cfg ]; then
source ${config_directory}/custom.cfg
elif [ -z "${config_directory}" -a -f $prefix/custom.cfg ]; then
source $prefix/custom.cfg
fi
EOF
I noticed that the file: /etc/grub.d/41_custom is missing some brackets {} in the {prefix} variable. I added the brackets and now I was able to update grub successfully.
#!/bin/sh
cat < if [ -f ${config_directory}/custom.cfg ]; then
source ${config_directory}/custom.cfg
elif [ -z "${config_directory}" -a -f ${prefix}/custom.cfg ]; then
source ${prefix}/custom.cfg
fi
EOF
Generating grub configuration file ...
Found theme: /boot/grub/themes/deepin-fallback/theme.txt
Found background image: /boot/grub/themes/deepin-fallback/background.jpg
Warning: os-prober will be executed to detect other bootable partitions.
Its output will be used to detect bootable binaries on them and create new boot entries.
Adding boot menu entry for UEFI Firmware Settings ...
done