Gentoo Archives: gentoo-user

From: morlix <morlix@××××××.de>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] genkernel initramfs and grub2-mkconfig
Date: Tue, 05 Jun 2012 08:15:18
Message-Id: 4FCDBF97.4020902@morlix.de
In Reply to: Re: [gentoo-user] genkernel initramfs and grub2-mkconfig by Michael Hampicke
1 I thought if root= is not set to /dev/ram0 the kernel doesn't use the
2 initramfs as "first" root.
3
4 The server is on a remote location so i can't see if it correctly starts
5 the /linuxrc in the initramfs.
6
7 The server boots without problems, i just wanted to check if root=
8 shouldn't be set to root=/dev/ram0, so that my initramfs will be used.
9
10 Here is the interesting part on my machine:
11
12 menuentry 'Gentoo GNU/Linux' --class gentoo --class gnu-linux --class
13 gnu --class os $menuentry_id_option 'gnulinux-simple-f14c5701-d
14 305-4bd7-9655-f20f5877a5aa' {
15 load_video
16 insmod gzio
17 insmod part_gpt
18 insmod part_gpt
19 insmod diskfilter
20 insmod mdraid1x
21 insmod ext2
22 set root='mduuid/4aff33622e32377381237e3004a4b8bc'
23 if [ x$feature_platform_search_hint = xy ]; then
24 search --no-floppy --fs-uuid --set=root
25 --hint='mduuid/4aff33622e32377381237e3004a4b8bc'
26 71d9e42f-84b7-4e16-bd07-b88d09c4f
27 513
28 else
29 search --no-floppy --fs-uuid --set=root
30 71d9e42f-84b7-4e16-bd07-b88d09c4f513
31 fi
32 echo 'Loading Linux x86_64-3.2.11-hardened_20120601-1 ...'
33 linux /kernel-genkernel-x86_64-3.2.11-hardened_20120601-1
34 root=UUID=f14c5701-d305-4bd7-9655-f20f5877a5aa ro dolvm domdadm r
35 eal_root=UUID=f14c5701-d305-4bd7-9655-f20f5877a5aa
36 echo 'Loading initial ramdisk ...'
37 initrd /initramfs-genkernel-x86_64-3.2.11-hardened_20120601-1
38 }
39
40
41 Thanks for your answers!
42
43 Am 04.06.2012 21:50, schrieb Michael Hampicke:
44 >
45 >
46 > Am 04.06.2012 21:10, schrieb Paul Hartman:
47 >> On Mon, Jun 4, 2012 at 1:40 PM, morlix <morlix@××××××.de> wrote:
48 >>> Hello,
49 >>>
50 >>> does anybody of you know how to get the grub2-mkconfig script to
51 >>> correctly detect initramfs and set the kernel parameter "root=" to
52 >>> /dev/ram0 or just don't set the parameter at all.
53 >>>
54 >>> I'm using genkernel and want to use my generated initramfs, but
55 >>> everytime grub2-mkconfig gets called it sets the kernel parameter root=
56 >>> to my root partition and then the initramfs won't get used.
57 >>>
58 >>> I think manually editing /boot/grub2/grub.cfg and deleting the root=
59 >>> parameter and setting real_root isn't a good choice for long term.
60 >>
61 >> The default scripts for grub2-mkconfig looks for a specific filename
62 >> for the initramfs, related to the kernel filename. If you look in
63 >> those scripts, you may be able to modify it to look at your filenames
64 >> instead.
65 >
66 > Paul is right, but you shouldn't need to modify anything. Here's what
67 > grub2-mkconfig generates on my machine (first entry only):
68 >
69 >
70 > menuentry 'Gentoo GNU/Linux' --class gentoo --class gnu-linux --class
71 > gnu --class os $menuentry_id_option
72 > 'gnulinux-simple-713f1c17-1b9a-4967-ac05-d6a6a9ff60a5' {
73 > load_video
74 > set gfxpayload=keep
75 > insmod gzio
76 > insmod part_gpt
77 > insmod ext2
78 > set root='hd0,gpt2'
79 > if [ x$feature_platform_search_hint = xy ]; then
80 > search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt2
81 > --hint-efi=hd0,gpt2 --hint-baremetal=ahci0,gpt2
82 > e39917c2-b59e-4447-bcae-39a41c3816a7
83 > else
84 > search --no-floppy --fs-uuid --set=root
85 > e39917c2-b59e-4447-bcae-39a41c3816a7
86 > fi
87 > echo 'Loading Linux x86_64-3.3.5-gentoo ...'
88 > linux /kernel-genkernel-x86_64-3.3.5-gentoo
89 > root=UUID=713f1c17-1b9a-4967-ac05-d6a6a9ff60a5 ro
90 > echo 'Loading initial ramdisk ...'
91 > initrd /initramfs-genkernel-x86_64-3.3.5-gentoo
92 > }
93 >
94 >
95 > And here are the file in /boot
96 > # find /boot/ -name "*genkernel*"
97 > /boot/kernel-genkernel-x86_64-3.3.5-gentoo
98 > /boot/System.map-genkernel-x86_64-3.3.5-gentoo
99 > /boot/initramfs-genkernel-x86_64-3.3.5-gentoo
100 > /boot/kernel-genkernel-x86_64-3.3.5-gentoo.old
101 > /boot/System.map-genkernel-x86_64-3.3.5-gentoo.old
102 > /boot/initramfs-genkernel-x86_64-3.3.5-gentoo.old
103 >
104 > It boots perfectly fine using my initramfs

Attachments

File name MIME type
signature.asc application/pgp-signature