Grub-customizer broke GRUB config, syntax error

While trying to update my grub configuration I get this output:

$ sudo grub-mkconfig -o /boot/grub/grub.cfg
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-linux-tkg-bmq
Found initrd image: /boot/intel-ucode.img /boot/initramfs-linux-tkg-bmq.img
Found fallback initrd image(s) in /boot: initramfs-linux-tkg-bmq-fallback.img
Found linux image: /boot/vmlinuz-linux510
Found initrd image: /boot/intel-ucode.img /boot/initramfs-linux510.img
Found linux image: /boot/vmlinuz-linux-tkg-bmq
Found initrd image: /boot/intel-ucode.img /boot/initramfs-linux-tkg-bmq.img
Found fallback initrd image(s) in /boot: initramfs-linux-tkg-bmq-fallback.img
Found linux image: /boot/vmlinuz-linux510
Found initrd image: /boot/intel-ucode.img /boot/initramfs-linux510.img
Found Windows Boot Manager on /dev/[email protected]/efi/Microsoft/Boot/bootmgfw.efi
Detecting snapshots ...
Info: Separate boot partition not detected 
Found snapshot: 2020-12-12 15:45:44 | timeshift-btrfs/snapshots/2020-12-12_15-45-44/@
Found snapshot: 2020-12-11 16:48:59 | timeshift-btrfs/snapshots/2020-12-11_16-48-58/@
Found snapshot: 2020-12-11 16:00:01 | timeshift-btrfs/snapshots/2020-12-11_16-00-01/@
Found snapshot: 2020-12-10 16:00:01 | timeshift-btrfs/snapshots/2020-12-10_16-00-01/@
Found snapshot: 2020-12-09 16:56:16 | timeshift-btrfs/snapshots/2020-12-09_16-56-16/@
Found snapshot: 2020-12-09 16:00:01 | timeshift-btrfs/snapshots/2020-12-09_16-00-01/@
Found snapshot: 2020-12-08 21:21:38 | timeshift-btrfs/snapshots/2020-12-08_21-21-38/@
Found snapshot: 2020-12-07 21:27:48 | timeshift-btrfs/snapshots/2020-12-07_21-27-48/@
Found 8 snapshot(s)
error: syntax error.
error: Incorrect command.
error: syntax error.
Syntax error at line 246
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.

This is the part of the grub.new.cfg file where it says the syntax error is

### BEGIN /etc/grub.d/61_custom ###
# This file provides an easy way to add custom menu entries.  Simply type the
# menu entries you want to add after this comment.  Be careful not to change
# the 'exec tail' line above.
if [ ${grub_platform} == "efi" ]; then
fi >>>#syntax error is this line<<<
menuentry "Shutdown" --class shutdown {
        echo "System shutting down..."
        halt
}
menuentry "Restart" --class restart {
        echo "System rebooting..."
        reboot
}
menuentry "Firmware Setup (UEFI)" --class recovery {
                fwsetup
}
>### END /etc/grub.d/61_custom ###

moving the 61_custom file out of grub.d fixes the issue, but also removes the Garuda grub theme

The fi should be below the final } of the final menuentry.

Why is it in the wrong place? Have you used grub-customizer or made some other manual change?

3 Likes

I used grub-customizer to move the grub entries, other than that, no manual changes

1 Like

How gohlip says so nice, use GC if you like but do not ask for help!
GC=grub-customizer

Change headline to
grub-customizer default error

3 Likes

So, yes. You made a change to the GRUB configuration and you broke it. :wink:

2 Likes

Oops, I've never had a problem with customizer before, and since I used customizer first and got the same error when trying to manually update the config I didn't realise that it was customizer that broke it. Certainly my bad, thank you :stuck_out_tongue:

2 Likes

there's a looong thread about issues with grub customizer. You can check it out, but there are only a few decent suggestions and a lot of rambling. https://forum.garudalinux.org/t/grub-customizer/1731

4 Likes