Gentoo Archives: gentoo-user

From: Hilco Wijbenga <hilco.wijbenga@×××××.com>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] Grub2, chroot, initramfs
Date: Wed, 16 May 2012 02:55:16
Message-Id: CAE1pOi1EfHmegmeVzh_krMcdCRjnnApU065SppQVQBC+f_oA4g@mail.gmail.com
In Reply to: [gentoo-user] Grub2, chroot, initramfs by Paul Hartman
1 On 15 May 2012 19:37, Paul Hartman <paul.hartman+gentoo@×××××.com> wrote:
2 > Hi,
3 >
4 > I'm trying out grub2 for the first time on my old laptop. I'm
5 > following the guide at: https://wiki.gentoo.org/wiki/GRUB2_Quick_Start
6 > which seems easy enough. Basically just emerge it, install and go.
7 >
8 > However... two different questions:
9 >
10 > When I did this from a chroot, I just got the GRUB> prompt upon
11 > rebooting... no menu or anything. I can manually type "linux
12 > /boot/vmlinuz root=/dev/sda3" and then boot into my system. When I run
13 > grub2-mkconfig from within the chroot, I don't get any "Found linux
14 > image" lines. It does not create /boot/grub2/grub.cfg but rather
15 > grub.cfg.new. So I don't know if it's confused about where /boot is or
16 > what. Is there a trick to installing/updating grub2 config from within
17 > a chroot?
18
19 I don't really understand where the chroot comes into this but ... did
20 you add the "-o /boot/grub2/grub.cfg" part? I forgot that bit a few
21 times and then couldn't figure out why my changes weren't taking
22 effect. :-)
23
24 > Second, when running grub2-mkconfig from within my working gentoo
25 > system, it fails with "error: failed to get canonical path of
26 > /dev/root." which is apparently because I don't use an initramfs. I
27 > must manually run "ln -s /dev/sda3 /dev/boot" before it will work. Is
28 > there any trick to avoid having to do that every time? For now I have
29 > simply added that to my after-kernel-update script but I'm curious to
30 > know if grub2 knows how to handle this on its own somehow.
31 >
32 > Thanks,
33 > Paul
34 >

Replies

Subject Author
Re: [gentoo-user] Grub2, chroot, initramfs Paul Hartman <paul.hartman+gentoo@×××××.com>