Comment 10 for bug 1308833

Revision history for this message
tuxayo (tuxayo) wrote :

# Same error
I also got this bug on 4 installs at least (Arch, Manjaro, Linux Mint) since the last two years at least. After doing modifications with grub-customizer (usually deleting many redundant entries), my config wouldn't apply although the the GUI and console output show no errors (that seems a separate issue to have grub-mkconfig failing and grub-customizer not noticing it).

So now when running grub-mkconfig I got:

Generating grub configuration file ...
Found theme: /boot/grub/themes/Antergos-Default/theme.txt
Found linux image: /boot/vmlinuz-linux
Found initrd image: /boot/initramfs-linux.img
Found fallback initramfs image: /boot/initramfs-linux-fallback.img
Found linux image: /boot/vmlinuz-linux
Found initrd image: /boot/initramfs-linux.img
Found fallback initramfs image: /boot/initramfs-linux-fallback.img
Found Antergos Linux release 16.4 (ISO-Rolling) on /dev/sda8
Found memtest86+ image: /boot/memtest86+/memtest.bin
Found memtest86+ image: /boot/memtest86+/memtest.bin
error: syntax error.
error: Incorrect command.
error: syntax error.
Syntax error at line 218
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.
done

# New detail to help finding the cause
I've found that my grub.cfg.new has CRLF end of lines at the exact line of the error.
As you can see in the attached screenshots @miketut, @remington, @terriyu have the same issues.
However, this in not the case for @2cv67, so you might suffer an unrelated bug.

The main question now is how do these CRLF EOLs end up in our generated files?
None of the files in my /etc/grub.d/ contains CRLF EOLs

# Workaround
I was able to apply my new grub config by doing:
dos2unix grub.cfg.new
And then replace the old grub.cfg by the now sanitized one.