FS#38234 - [grub] grub-mkconfig -o fails with syntax error but produces correct file

Attached to Project: Arch Linux
Opened by alex (kabolt) - Sunday, 22 December 2013, 18:33 GMT
Last edited by Tobias Powalowski (tpowa) - Saturday, 11 January 2014, 07:06 GMT
Task Type Bug Report
Category Packages: Core
Status Closed
Assigned To Tobias Powalowski (tpowa)
Architecture All
Severity High
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 11
Private No


on every of my two pcs grub-mkconfig -o gives an error. From one of the pcs I know that it used to work.
I think the error exists since the last grub update (I use the latest version).

Generating grub configuration file ...
Found theme: /boot/grub/themes/starfield/theme.txt
Found linux image: /boot/vmlinuz-linux
Found initrd image: /boot/initramfs-linux.img
error: out of memory.
error: syntax error.
error: Incorrect command.
error: syntax error.
Syntax error at line 167
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
/bllba.conf.new file attached.done

the theme doesn't seems to be the problem because my other pc hasn't the theme setting set and the same problem
This task depends upon

Closed by  Tobias Powalowski (tpowa)
Saturday, 11 January 2014, 07:06 GMT
Reason for closing:  Fixed
Comment by alex (kabolt) - Sunday, 22 December 2013, 18:37 GMT
the file is not completely correct: the swap partition is listed as linux system. Maybe this is the issue.
Comment by Smlb (smlb) - Monday, 23 December 2013, 22:07 GMT
At the moment the only one solution seems to be this: add GRUB_DISABLE_SUBMENU=y to your /etc/default/grub and regenerate grub.cfg `grub-mkconfig -o /boot/grub/grub.cfg`
Comment by Sean V Kelley (seanvk) - Wednesday, 25 December 2013, 06:07 GMT
Came across this bug just today, pretty much breaks any grub install following the wiki. Why is Arch using a grub snapshot and not a release? The one solution above does act as a work around, but is not the root cause.
Comment by lieven moors (lievenmoors) - Wednesday, 25 December 2013, 11:38 GMT
Came across this bug too, but the generated grub.cfg was not correct in my case. In particular, I could see that a parenthesis was missing to close a menu item containing submenus.
Comment by Smlb (smlb) - Wednesday, 25 December 2013, 11:41 GMT
In my case I installed in UEFI, legacy mode didn't work for me.
Comment by James Spencer (jspenc) - Wednesday, 25 December 2013, 17:08 GMT
Could you please explain in some more detail how I can set GRUB_DISABLE_SUBMENU=y which file is this in? I can't see any files in etc/default/grub.. I am working through the getting started guide and am a bit flummoxed as what to do as I can't install a boot loader?
Comment by Smlb (smlb) - Wednesday, 25 December 2013, 17:57 GMT
You have to edit /etc/default/grub and add GRUB_DISABLE_SUBMENU=y to the config and regenerate grub.cfg
Comment by James Spencer (jspenc) - Wednesday, 25 December 2013, 18:20 GMT
Thanks for your your fast reply, all seems to be working now. I was mistaken in thinking that the file was a dir..
Comment by Wuestenschiff (Wuestenschiff) - Saturday, 28 December 2013, 14:24 GMT
Hi im exipiriencing this Bug on my first arch-install... This is quite annoying but i managed to create a config with both the disable_menue and the 10_archlinux fixes. Nevertheless my Laptop refuses to boot from the drive. Can some1 confirm the fixes to work on a new install with GPD-BIOS?

Shold i try syslinux? What am I suposed to do with the boot-bios partition in that case?
Comment by Star Brilliant (m13253) - Sunday, 29 December 2013, 04:14 GMT
Add duplicate  FS#38304 

P.S. I think this is not a upstream bug. It is an Arch bug. Because /etc/grub.d/10_linux line 293 is added by Arch developers, i.e. not exist in upstream repo.
Comment by Zhuoyun Wei (wzyboy) - Sunday, 29 December 2013, 07:55 GMT
I encountered this bug as well. To determine if this is caused by my setup (BIOS + GPT), I create a new VirtualBox machine with BIOS + MBR setup and install a new Arch system in it with only "base" and "grub".

However, when I try to run "grub-mkconfig", I still get the same complain on syntax error. The generated grub.cfg does have a open "{" but no closing "}", which caused the complain about "syntax error".

As Smlb said, adding a line GRUB_DISABLE_SUBMENU=y in /etc/default/grub and re-generate grub.cfg will not cause any error.
Comment by Dave Cottlehuber (dch) - Saturday, 04 January 2014, 22:49 GMT
Please fix soon, this breaks all new installs.

Attachment in FS#337904 fixes this for me, https://bugs.archlinux.org/task/37904?getfile=11318