Skip to contentSkip to conversation

GRUB 1.96 - unknown commands

DISCUSSION Chris Smart 3 participants 6 messages Jul 10, 2009

lore
Share & tools
lore
#0 lore raw

Hi all,

I'm trying to get GRUB2 to boot on an EFI system (Apple Mac) using grub.efi and rEFIt as the boot manager.

I have checked GRUB out of svn and built it with the following commands (on a 32bit Linux operating system):

./configure --with-platform=efi
make
./grub-mkimage -d . -o grub.efi gpt hfsplus fat ext2 normal chain boot configfile
sudo cp grub.efi *.mod fs.lst command.lst /efi/grub/

Upon a reboot, rEFIt detects the grub.efi and presents the option to boot it.

Without a grub.cfg configuration file, it boots straight to a GRUB 1.96 shell which looks good. There I have the help command and I can see all the modules I copied across.

I can also boot the kernel and initrd that I want by manually typing in the "linux", "initrd", and "boot" commands. Nice.

When I boot it with a config file however, it cannot parse the grub.cfg file and spits out errors about unknown commands. I am assuming that I have left out a module or something, but for the life of me I can't work out what I've done wrong!

Here is the simple grub.cfg that I am using:

set timeout=10
set default=0
menuentry "Linux" {
linux /efi/grub/vmlinuz
initrd /efi/grub/initrd
}

Here is what happens:

Boot PC to rEFIt
Select grub.efi boot option
Computer says "Starting grub.efi"
Computer goes to GRUB 1.96 shell

GRUB spits out errors:
Unknown command 'menuentry'
Unknown command '}'
Unknown command 'linux'
Unknown command 'initrd'
..and so on.

Once that happens, none of the commands work, even though I'm at the prompt. It's like the config has broken everything.

Any ideas?

I have seen this post on the mailing list, but it doesn't seem to match my issue. "http://lists.gnu.org/archive/html/grub-devel/2009-03/msg00389.html"

Thanks!
Chris

#1 lore raw

Hi,

Quoted 12 lines · Chris Smart

Here is the simple grub.cfg that I am using:

set timeout=10
set default=0
menuentry "Linux" {
linux /efi/grub/vmlinuz initrd /efi/grub/initrd
}

Here is what happens:

Quoted 8 lines

Boot PC to rEFIt
Select grub.efi boot option Computer says "Starting grub.efi" Computer goes to GRUB 1.96 shell

GRUB spits out errors:
Unknown command 'menuentry' Unknown command '}'

This *should* be impossible. These symbols are parsed by normal.mod and for a good purpose as you can see. Is it possible that lua integration has broken this? Support for the core scripting language is more important to me than any additional scripting language.

--
Marco

#2 lore raw
In reply to Chris Smart

Hi,

You need to add module sh, minicmd and linux.

Quoted 70 lines · Chris Smart

Hi all,

I'm trying to get GRUB2 to boot on an EFI system (Apple Mac) using grub.efi and rEFIt as the boot manager.

I have checked GRUB out of svn and built it with the following commands (on a 32bit Linux operating system):

./configure --with-platform=efi
make
./grub-mkimage -d . -o grub.efi gpt hfsplus fat ext2 normal chain boot configfile
sudo cp grub.efi *.mod fs.lst command.lst /efi/grub/

Upon a reboot, rEFIt detects the grub.efi and presents the option to boot it.

Without a grub.cfg configuration file, it boots straight to a GRUB 1.96 shell which looks good. There I have the help command and I can see all the modules I copied across.

I can also boot the kernel and initrd that I want by manually typing in the "linux", "initrd", and "boot" commands. Nice.

When I boot it with a config file however, it cannot parse the grub.cfg file and spits out errors about unknown commands. I am assuming that I have left out a module or something, but for the life of me I can't work out what I've done wrong!

Here is the simple grub.cfg that I am using:

set timeout=10
set default=0
menuentry "Linux" {
 linux /efi/grub/vmlinuz
 initrd /efi/grub/initrd
}

Here is what happens:

Boot PC to rEFIt
Select grub.efi boot option
Computer says "Starting grub.efi"
Computer goes to GRUB 1.96 shell

GRUB spits out errors:
Unknown command 'menuentry'
Unknown command '}'
Unknown command 'linux'
Unknown command 'initrd'
..and so on.

Once that happens, none of the commands work, even though I'm at the prompt. It's like the config has broken everything.

Any ideas?

I have seen this post on the mailing list, but it doesn't seem to match my issue. "http://lists.gnu.org/archive/html/grub-devel/2009-03/msg00389.html"

Thanks!
Chris

_______________________________________________
Grub-devel mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/grub-devel

Signature · 1 line
Bean
#3 lore raw

2009/7/10 Bean <[email protected]>:

Quoted 3 lines

Hi,

You need to add module sh, minicmd and linux.

Thank you, thank you!!

I don't mean to presume I know what I'm talking about, but should the Wiki entry on testing EFI be updated to reflect the fact that it needs these extra modules?
"http://grub.enbug.org/TestingOnEFI" "http://grub.enbug.org/TestingOnMacbook"

That's where I got the initial list from which I used to build grub.efi.. I did try to add all modules at one point, but when I did that it killed the machine.

So I figured it was a module issue, but I had no idea which one. Finally, after a week of pulling my hair out (and trying to learn about this EFI stuff from scratch) I emailed the list out of desperation.

Thank you again.. you have restored my sanity, for now! ;-)

Cheers,
-c

#4 lore raw
In reply to Bean

Hello,

Quoted 1 line · Bean

You need to add module sh, minicmd and linux.

What was the reason it was split up? Sorry, I must have missed a discussion.

I prefer scripting and normal.mod to be integrated, to prevent problems like these.

--
Marco

#5 lore raw
Quoted 11 lines · Marco Gerards

Hello,

Quoted 1 line · Bean

You need to add module sh, minicmd and linux.

What was the reason it was split up?  Sorry, I must have missed a discussion.

I prefer scripting and normal.mod to be integrated, to prevent problems like these.

Hi,

Some time ago, I split reader and parser, now normal.mod only contains the normal reader, parser is moved to module sh.mod. But normal.mod would tries to load sh.mod from disk. But for EFI, prefix is set to the same directory as grub.efi, not /efi/grub.

There are some advantage for splitting the parser. First, we can implement multiple parser, there are currently three of them, rescue, sh and lua. Reader is responsible for user input, now there are two, rescue and normal. Splitting the module also make it possible to fine tune the modules embedded in kernel.

Signature · 1 line
Bean