Grub2 is being adpoted my many of the linux distributions at the moment. Has anyone experience of adding their Haiku partition? I've poked around some of the Grub2 docs but I'm still lost.
I'm sorry, but this is the *wrong* way! Actually, grub.cfg is unwritable on purpose! It is generated using the scripts in /etc/grub.d/ on every update or kernel installation. So all your changes are lost after updating Grub 2!
The scripts are executed alphabetical. So you have to add a script an name it according to the desired position. E.g. if you like to be Haiku the first entry, name it 06_Haiku. If you want to have the entry at the bottom position, give it the highest number (e.g. 40_).
The content of the script must be the following:
#! /bin/sh -e
echo "Adding Haiku entry" >&2
menuentry "Haiku R1 alpha" {
## change to your partition, the first partition on your first hard drive
## is (hd0,1), the third partition on your 2nd hd is (hd1,3) and so on...
set root=(hdX,Y)
chainloader +1
}
After that, make the script executable by typing
$ chmod +x 40_Haiku
(or whatever you named it) and update Grub 2 using
Thanks for your replies. kwurzel, thank you - that looks like what I've seen in the grub documentation but I couldn't figure out how to use it for my situation. Much appreciated!!
Maybe I am missing something, but I get a "menuentry not found" error on running sudo update-grub from Kubuntu 9.10. It finds everything else just fine. The things from the os_prober script and the Linux kernels. As well as memtest. Any suggestions?
Could I ask the meaning of the >&2 ?
This was very helpful, and immediately allowed me to add Haiku to Grub but I'd like to get a better grasp of what that part of the script is doing.
Comments
Re: Adding Haiku to Grub2 menu
Just add an entry at the end of /boot/grub/grub.cfg
Here's mine (Ubuntu system):
### END /etc/grub.d/40_custom ###
menuentry "haiku" {
set root=(hd0,3)
chainloader +1
}
Adapt "root= ..." as necessary.
Enjoy!
Re: Adding Haiku to Grub2 menu
I forgot to say that grub.cfg is not writeable by default. You have to make this file writeable before editing it.
Re: Adding Haiku to Grub2 menu
I'm sorry, but this is the *wrong* way! Actually, grub.cfg is unwritable on purpose! It is generated using the scripts in /etc/grub.d/ on every update or kernel installation. So all your changes are lost after updating Grub 2!
The scripts are executed alphabetical. So you have to add a script an name it according to the desired position. E.g. if you like to be Haiku the first entry, name it 06_Haiku. If you want to have the entry at the bottom position, give it the highest number (e.g. 40_).
The content of the script must be the following:
#! /bin/sh -e echo "Adding Haiku entry" >&2 menuentry "Haiku R1 alpha" { ## change to your partition, the first partition on your first hard drive ## is (hd0,1), the third partition on your 2nd hd is (hd1,3) and so on... set root=(hdX,Y) chainloader +1 }After that, make the script executable by typing
(or whatever you named it) and update Grub 2 using
or whatever your distribution uses.
Re: Adding Haiku to Grub2 menu
Thanks for your replies. kwurzel, thank you - that looks like what I've seen in the grub documentation but I couldn't figure out how to use it for my situation. Much appreciated!!
Re: Adding Haiku to Grub2 menu
Maybe I am missing something, but I get a "menuentry not found" error on running sudo update-grub from Kubuntu 9.10. It finds everything else just fine. The things from the os_prober script and the Linux kernels. As well as memtest. Any suggestions?
Re: Adding Haiku to Grub2 menu
I had the same problem, add these two lines containing EOF and it should do the trick (replace X and Y according to your disk setup).
#! /bin/sh -e echo "Adding Haiku entry" >&2 cat << EOF menuentry "Haiku R1 alpha" { set root=(hdX,Y) chainloader +1 } EOFRe: Adding Haiku to Grub2 menu
Could I ask the meaning of the >&2 ?
This was very helpful, and immediately allowed me to add Haiku to Grub but I'd like to get a better grasp of what that part of the script is doing.
Re: Adding Haiku to Grub2 menu
why are You still messing around with GRUB?
try GAG (http://gag.sourceforge.net/).
Re: Adding Haiku to Grub2 menu
GAG is quite good actually. I have used it on quite a few occasions. I think it even has an option for BeOS. :P
Guru
Re: Adding Haiku to Grub2 menu
and.... in gpt?
...set root=(hdX,gptY)...
menuentry "Haiku R1 alpha" {
set root=(hdX,gptY)
chainloader +1
}