You are not logged in.

#1 2017-09-21 21:56:58

Leafy Greens
Member
Registered: 2017-09-16
Posts: 21

[SOLVED] Error running grub-mkconfig with menu entries from wiki

I'm setting up a dual boot system in BIOS-MBR mode with arch and win7 on my new laptop. I set up windows as normal, and then after much poking around, I finally got arch installed and running. Since I had had trouble with it in previous attempts, I decided to wait until I finished installing before configuring GRUB to boot into windows.

I added the following text into /etc/grub.d/40_custom as given in this wiki page:

if [ "${grub-platform}" == "pc" ]; then
  menuentry "Microsoft Windows Vista/7/8/8.1/10 BIOS-MBR" {
    insmod part_msdos
    insmod ntfs
    insmod search_fs_uuid
    insmod ntldr
    search --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1 F0A6268DA626547E
    ntldr /ntldr
  }
fi

But when I ran grub-mkconfig -o /boot/grub/grub.cfg I got this error text:

[root@(hostname) ~]#grub-mkconfig -o /boot/grub/grub.cfg
Generating grub configuration file...
Found linux image: /boot/vmlinuz-linux.img
Found initrd image(s) in /boot: intel-ucode.img initramfs-linux-fallback.img
Found fallback initrd image(s) in /boot: intel-ucode.img initramfs-linux-fallback.img
error: syntax error.
error: Incorrect command.
error: syntax error.
Syntax error at line 169
Syntax errors detected in generated GRUB configuration file.
Ensure 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.

Since the only thing I changed between the wiki page and my own file was to put in the uuid of my windows boot partition instead of the uuid from the example, I'm not sure what the problem could be. Just like in the example, /dev/sda1 is my windows boot partition, with sda2 being my C: drive in windows. Forum and google searches didn't have anything useful, so I'm hoping someone can show me where I went wrong.

Last edited by Leafy Greens (2017-09-22 03:02:40)


Explicit um est volumen
(The scroll has been completely unrolled)

Offline

#2 2017-09-21 22:10:02

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: [SOLVED] Error running grub-mkconfig with menu entries from wiki

What is on line 169?


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#3 2017-09-21 22:56:15

Leafy Greens
Member
Registered: 2017-09-16
Posts: 21

Re: [SOLVED] Error running grub-mkconfig with menu entries from wiki

jasonwryan wrote:

What is on line 169?

Of course that would have to be the one thing I forget to put in the original post. Here:

169 #if [ "${grub-platform}" == "pc" ]; then

It looks like GRUB commented out the lines that caused the error, but other than that, exactly as I entered them. Maybe the brackets and braces are incorrectly formatted?


Explicit um est volumen
(The scroll has been completely unrolled)

Offline

#4 2017-09-22 00:23:59

2ManyDogs
Forum Fellow
Registered: 2012-01-15
Posts: 4,645

Re: [SOLVED] Error running grub-mkconfig with menu entries from wiki

Leafy Greens wrote:
if [ "${grub-platform}" == "pc" ]; then
arch wiki wrote:
if [ "${grub_platform}" == "pc" ]; then

Do you see the difference?

Last edited by 2ManyDogs (2017-09-22 00:24:17)

Offline

#5 2017-09-22 03:01:21

Leafy Greens
Member
Registered: 2017-09-16
Posts: 21

Re: [SOLVED] Error running grub-mkconfig with menu entries from wiki

2ManyDogs wrote:
Leafy Greens wrote:
if [ "${grub-platform}" == "pc" ]; then
arch wiki wrote:
if [ "${grub_platform}" == "pc" ]; then

Do you see the difference?

Aha! Man, I hate underscores sometimes. That fixed it, thanks!


Explicit um est volumen
(The scroll has been completely unrolled)

Offline

Board footer

Powered by FluxBB