FS#37904 - [grub] 10_linux generates submenu without closing bracket with grub-mkconfig
Attached to Project:
Arch Linux
Opened by Felix Yan (felixonmars) - Monday, 25 November 2013, 10:24 GMT
Last edited by Tobias Powalowski (tpowa) - Saturday, 21 December 2013, 20:50 GMT
Opened by Felix Yan (felixonmars) - Monday, 25 November 2013, 10:24 GMT
Last edited by Tobias Powalowski (tpowa) - Saturday, 21 December 2013, 20:50 GMT
|
Details
Description:
I'm getting error trying to run grub-mkconfig, with latest grub in [testing]. A quick and dirty workaround works for me, though I don't know how to fix it properly. Details: In file /etc/grub.d/10_linux, I didn't really get it here: # If at least one kernel was found, then we need to # add a closing '}' for the submenu command. if ! test -e "/etc/arch-release" ; then if [ x"$is_top_level" != xtrue ]; then echo '}' fi fi So it adds "}" only when /etc/arch-release doesn't exist? But that file was included in [core]/filesystem 2013.05-2 I just removed those ifs and tried grub-mkconfig again, it now works flawlessly. Additional info: * package version(s) testing/grub 1:2.00.1282.g5ae5c54-1 * config and/or log files etc. Submenu that misses "}": submenu 'Advanced options for Arch Linux' $menuentry_id_option 'gnulinux-advanced-...' { Error: error: out of memory. error: syntax error. error: Incorrect command. error: syntax error. Syntax error at line 393 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 (line 393 was actually end of the file, which indicates the missing bracket '}') |
This task depends upon
Closed by Tobias Powalowski (tpowa)
Saturday, 21 December 2013, 20:50 GMT
Reason for closing: Fixed
Additional comments about closing: 2.02-beta1
Saturday, 21 December 2013, 20:50 GMT
Reason for closing: Fixed
Additional comments about closing: 2.02-beta1
'
Making sure the fallback initramfs entry is also created by /etc/grub.d/10_linux file requires some non-upstream hackery which is done by https://projects.archlinux.org/svntogit/packages.git/tree/trunk/archlinux_grub_mkconfig_fixes.patch?h=packages/grub . This patch will work for submenu disabled scenario but MAY NOT work for submenu enabled scenario.
Unfortunately the fallback initramfs usage is something unique to Arch (and its derivatives) that is used by majority of linux distros out there and unlikely to be supported by default by upstream GRUB in grub-mkconfig and/or 10_linux .
EDIT: If any one has a better patch please submit it, or even better try to get it incorporated upstream. Upstream does not like distro specific hacks in its source, so any to-be-submitted patch should not be specific/limited to Arch (and/or its derivatives).
Edit: Actually there is one minor problem that may be related to the patch. Versions in the menuentry show up missing a dash.
Example for linux /boot/vmlinuz-linux-3.12.3-1
Actual: menuentry 'Arch Linux, with Linux 3.12.31 kernel'
Expected: menuentry 'Arch Linux, with Linux 3.12.3-1 kernel'
sudo grub-mkconfig -o /boot/grub/grub.cfg
.
grub-mkconfig -o /boot/grub/grub.cfg
but when I run
grub-install --directory=/usr/lib/grub/i386-pc --target=i386-pc --boot-directory=/boot --recheck --debug /dev/sda
grub-install --directory=/usr/lib/grub/i386-pc --target=i386-pc --boot-directory=/boot --recheck --debug /dev/sdb
they both fail with gpt.mod missing.
I think that the guards of these ifs (the last two in /etc/grub.d/10_linux) contradicts the comments above them.
Changing the lines with
if ! test -e "/etc/arch-release"; then
to
if test -e "/etc/arch-release"; then
just let grub-mkconfig work fine.
You can also run the script standalone and copy its output to /etc/grub.d/40_custom or /boot/grub/custom.cfg (GRUB 2.00+). This script does not rely on /etc/grub.d/10_linux (shipped by GRUB upstream), which is the actual script generating the linux boot entries part of grub.cfg .
Please test 10_archlinux script and give feedback. If it works properly, then we can ditch the whole patch except the GRUB_COLOR part (of the current patch), which can be split easily.
Btw, why is Arch using a snapshot version of grub? I know it's supposed to be bleeding-edge but even ffmpeg is a "stable" version. Not to mentioned that it's using a LEGACY VERSION OF APACHE.
The policy of Arch is getting so inconsistent!