Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] Booting gentoo from... Non-gentoo GRUB2?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
ivdok
n00b
n00b


Joined: 11 Oct 2013
Posts: 6

PostPosted: Fri Oct 11, 2013 7:49 pm    Post subject: [SOLVED] Booting gentoo from... Non-gentoo GRUB2? Reply with quote

Guys, I'm sorry once again, but I want to make somethink unorthodox with the bootin' process.
Here's the deal - I have already-installed GRUB2 on /dev/sda by Arch Linux - it's my main OS atm. I want to not to overwrite it - it's already installed.
I added these lines into /etc/grub.d/40_custom (on hd0,0):
Code:
#!/bin/sh
exec tail -n +3 $0
menuentry "GENTOO" {
title  Gentoo Linux
root   (hd0,1)
kernel /boot/gentoo-kernel root=/dev/sda2 ro
}

It seems like it's okay, as for me, but in the end it shows only already existing partitions:
Code:
[root@localhost ~]# grub-mkconfig -o /boot/grub/grub.cfg
Generating grub.cfg ...
Found linux image: /boot/vmlinuz-linux
Found initrd image: /boot/initramfs-linux.img
done

Where did I make an error, and is there a way to not to install & replace existing GRUB2?


Last edited by ivdok on Sat Oct 12, 2013 4:54 pm; edited 1 time in total
Back to top
View user's profile Send private message
DONAHUE
Watchman
Watchman


Joined: 09 Dec 2006
Posts: 7651
Location: Goose Creek SC

PostPosted: Sat Oct 12, 2013 5:19 am    Post subject: Reply with quote

assuming grub2 is on the first partition of BIOS's first hard drive to boot: (hd0,1)
assuming the kernel is at and named: /boot/gentoo-kernel in partition /dev/sda2

#!/bin/sh
exec tail -n +3 $0
menuentry "GENTOO" {
set root=(hd0,1)
linux /boot/gentoo-kernel root=/dev/sda2
boot
}


see https://help.ubuntu.com/community/Grub2/CustomMenus
and https://wiki.archlinux.org/index.php/GRUB
_________________
Defund the FCC.
Back to top
View user's profile Send private message
creaker
l33t
l33t


Joined: 14 Jul 2012
Posts: 651

PostPosted: Sat Oct 12, 2013 5:34 am    Post subject: Reply with quote

Why wouldn't to boot into Arch and just run grub-mkconfig without 40_custom editing?
It will add new menu entry for your Gentoo to grub menu. Of course, you have to have os-prober installed.
Back to top
View user's profile Send private message
ivdok
n00b
n00b


Joined: 11 Oct 2013
Posts: 6

PostPosted: Sat Oct 12, 2013 4:53 pm    Post subject: Reply with quote

Thanks for reply, everybody!
This was solved by os-prober + genkernel via chroot from liveusb. It works, so I will mark it as Solved.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum