Gentoo Archives: gentoo-user

From: Michael Hampicke <gentoo-user@××××.biz>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] genkernel initramfs and grub2-mkconfig
Date: Mon, 04 Jun 2012 19:52:29
Message-Id: 4FCD1175.20309@hadt.biz
In Reply to: Re: [gentoo-user] genkernel initramfs and grub2-mkconfig by Paul Hartman
1 Am 04.06.2012 21:10, schrieb Paul Hartman:
2 > On Mon, Jun 4, 2012 at 1:40 PM, morlix <morlix@××××××.de> wrote:
3 >> Hello,
4 >>
5 >> does anybody of you know how to get the grub2-mkconfig script to
6 >> correctly detect initramfs and set the kernel parameter "root=" to
7 >> /dev/ram0 or just don't set the parameter at all.
8 >>
9 >> I'm using genkernel and want to use my generated initramfs, but
10 >> everytime grub2-mkconfig gets called it sets the kernel parameter root=
11 >> to my root partition and then the initramfs won't get used.
12 >>
13 >> I think manually editing /boot/grub2/grub.cfg and deleting the root=
14 >> parameter and setting real_root isn't a good choice for long term.
15 >
16 > The default scripts for grub2-mkconfig looks for a specific filename
17 > for the initramfs, related to the kernel filename. If you look in
18 > those scripts, you may be able to modify it to look at your filenames
19 > instead.
20
21 Paul is right, but you shouldn't need to modify anything. Here's what
22 grub2-mkconfig generates on my machine (first entry only):
23
24
25 menuentry 'Gentoo GNU/Linux' --class gentoo --class gnu-linux --class
26 gnu --class os $menuentry_id_option
27 'gnulinux-simple-713f1c17-1b9a-4967-ac05-d6a6a9ff60a5' {
28 load_video
29 set gfxpayload=keep
30 insmod gzio
31 insmod part_gpt
32 insmod ext2
33 set root='hd0,gpt2'
34 if [ x$feature_platform_search_hint = xy ]; then
35 search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt2
36 --hint-efi=hd0,gpt2 --hint-baremetal=ahci0,gpt2
37 e39917c2-b59e-4447-bcae-39a41c3816a7
38 else
39 search --no-floppy --fs-uuid --set=root
40 e39917c2-b59e-4447-bcae-39a41c3816a7
41 fi
42 echo 'Loading Linux x86_64-3.3.5-gentoo ...'
43 linux /kernel-genkernel-x86_64-3.3.5-gentoo
44 root=UUID=713f1c17-1b9a-4967-ac05-d6a6a9ff60a5 ro
45 echo 'Loading initial ramdisk ...'
46 initrd /initramfs-genkernel-x86_64-3.3.5-gentoo
47 }
48
49
50 And here are the file in /boot
51 # find /boot/ -name "*genkernel*"
52 /boot/kernel-genkernel-x86_64-3.3.5-gentoo
53 /boot/System.map-genkernel-x86_64-3.3.5-gentoo
54 /boot/initramfs-genkernel-x86_64-3.3.5-gentoo
55 /boot/kernel-genkernel-x86_64-3.3.5-gentoo.old
56 /boot/System.map-genkernel-x86_64-3.3.5-gentoo.old
57 /boot/initramfs-genkernel-x86_64-3.3.5-gentoo.old
58
59 It boots perfectly fine using my initramfs

Replies

Subject Author
Re: [gentoo-user] genkernel initramfs and grub2-mkconfig morlix <morlix@××××××.de>