How to set up iso directory grub.cfg

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
User avatar
BenjiWiebe
Posts: 20
Joined: Thu Feb 07, 2013 9:47 pm
Location: Durham, Kansas
Contact:

How to set up iso directory grub.cfg

Post by BenjiWiebe »

I am following the steps in the C# OSDev series, except I am writing the kernel in C. I am using grub2. My directory layout:

Code: Select all

.:
boot  kernel.bin

./boot:
grub2

./boot/grub2:
grub.cfg
Contents of grub.cfg:

Code: Select all

multiboot /kernel.bin
boot
But I get a grub prompt when I run

Code: Select all

grub2-mkrescue -o image.iso iso
and boot the image.iso.

Anyone have any ideas?
egos
Member
Member
Posts: 612
Joined: Fri Nov 16, 2007 1:59 pm

Re: How to set up iso directory grub.cfg

Post by egos »

Contents of grub.cfg:

Code: Select all

multiboot /kernel.bin
boot
Is that all? Try this:

Code: Select all

menuentry "Run my kernel" {
multiboot /kernel.bin
}
If you have seen bad English in my words, tell me what's wrong, please.
jnc100
Member
Member
Posts: 775
Joined: Mon Apr 09, 2007 12:10 pm
Location: London, UK
Contact:

Re: How to set up iso directory grub.cfg

Post by jnc100 »

Grub2 looks for its configuration file in /boot/grub/grub.cfg (not /boot/grub2/grub.cfg).

Regards,
John.
User avatar
BenjiWiebe
Posts: 20
Joined: Thu Feb 07, 2013 9:47 pm
Location: Durham, Kansas
Contact:

Re: How to set up iso directory grub.cfg

Post by BenjiWiebe »

jnc100 wrote:Grub2 looks for its configuration file in /boot/grub/grub.cfg (not /boot/grub2/grub.cfg).

Regards,
John.
Thanks!! That fixed it. I wonder why, but in Fedora 17 (what I currently run) the grub.cfg file is located only in /boot/grub2. The only file in /boot/grub is /boot/grub/splash.xpm.gz. Hmmm... Interesting.
User avatar
Kazinsal
Member
Member
Posts: 559
Joined: Wed Jul 13, 2011 7:38 pm
Libera.chat IRC: Kazinsal
Location: Vancouver
Contact:

Re: How to set up iso directory grub.cfg

Post by Kazinsal »

BenjiWiebe wrote:
jnc100 wrote:Grub2 looks for its configuration file in /boot/grub/grub.cfg (not /boot/grub2/grub.cfg).

Regards,
John.
Thanks!! That fixed it. I wonder why, but in Fedora 17 (what I currently run) the grub.cfg file is located only in /boot/grub2. The only file in /boot/grub is /boot/grub/splash.xpm.gz. Hmmm... Interesting.
The GRUB2 installer can take an argument to change the directory in which it looks for (some) things.
Post Reply