Jump to content











Photo
- - - - -

Grub2 Manual


  • Please log in to reply
26 replies to this topic

#26 Icecube

Icecube

    Gold Member

  • Team Reboot
  • 1063 posts
  •  
    Belgium

Posted 28 March 2011 - 09:52 PM

How can i call grub.cfg that resides within boot/grub2/ folder? tried below commands but none of them worked (rather it opened up default grub.cfg under boot/grub/ folder)

a. linux /boot/grub2/core.img

b. multiboot /boot/grub2/core.img

So is there any way I can define/set the GRUB2 home directory as /boot/grub2/...?

I think the multiboot line is the right line to properly boot core.img (it supports the multiboot protocol).
I am not aware of a parameter that allows you to specify the working directory for the config file.
The only way to let it use /boot/grub2/grub.cfg as config file, will probably be by modify /boot/grub2/core.img in a hexeditor, by replacing /boot/grub with /boot/grub2 af offset 0x21c:
00000200  ea cf 82 00 00 00 04 00  88 39 00 00 d8 6f 00 00  |.........9...o..|

00000210  bd 54 00 00 ff ff ff ff  ff ff ff ff 2f 62 6f 6f  |.T........../boo|

00000220  74 2f 67 72 75 62 00 00  00 00 00 00 00 00 00 00  |t/grub..........|

00000230  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|

00000240  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|

00000250  00 00 00 00 00 00 00 00  00 00 00 00 02 b0 ad 1b  |................|
If you want to load another grub2 config file from grub2, you can use "configfile /boot/grub2/grub.cfg".
If you want to load another burg config file from burg, you can use "configfile /boot/burg2/burg.cfg".
If you want to load another burg config file than the default one when using grub2, you will need to hexedit that burg core.img file.
If you want to load another grub2 config file than the default one when using burg, you will need to hexedit that grub2 core.img file.

#27 pokemon1

pokemon1

    Member

  • Members
  • 87 posts
  •  
    United Kingdom

Posted 28 March 2011 - 10:15 PM

<The only way to let it use /boot/grub2/grub.cfg as config file, will probably be by modify /boot/grub2/core.img in a hexeditor, by replacing /boot/grub with /boot/grub2 af offset 0x21c:>

You are awasome Icecube :happy_dance:

Managed to load boot/burg2/burg.cfg succesfully, made by day.

FYI - while going through the grub2 manual, i found some options to set custom home directory while compiling but nothing shows that can do realitime/on the fly custom home directory.
http://members.iinet...h Commands.html

Obviously hex editing (adding just a suffix) is not a big deal, and i must thank you for your suggestion.

Regards.

Edited by pokemon1, 28 March 2011 - 10:19 PM.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users