public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-user] genkernel initramfs and grub2-mkconfig
@ 2012-06-04 18:40 morlix
  2012-06-04 19:10 ` Paul Hartman
  0 siblings, 1 reply; 4+ messages in thread
From: morlix @ 2012-06-04 18:40 UTC (permalink / raw
  To: Gentoo User

[-- Attachment #1: Type: text/plain, Size: 565 bytes --]

Hello,

does anybody of you know how to get the grub2-mkconfig script to
correctly detect initramfs and set the kernel parameter "root=" to
/dev/ram0 or just don't set the parameter at all.

I'm using genkernel and want to use my generated initramfs, but
everytime grub2-mkconfig gets called it sets the kernel parameter root=
to my root partition and then the initramfs won't get used.

I think manually editing /boot/grub2/grub.cfg and deleting the root=
parameter and setting real_root isn't a good choice for long term.

Kind regards,

morlix


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 262 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [gentoo-user] genkernel initramfs and grub2-mkconfig
  2012-06-04 18:40 [gentoo-user] genkernel initramfs and grub2-mkconfig morlix
@ 2012-06-04 19:10 ` Paul Hartman
  2012-06-04 19:50   ` Michael Hampicke
  0 siblings, 1 reply; 4+ messages in thread
From: Paul Hartman @ 2012-06-04 19:10 UTC (permalink / raw
  To: gentoo-user

On Mon, Jun 4, 2012 at 1:40 PM, morlix <morlix@morlix.de> wrote:
> Hello,
>
> does anybody of you know how to get the grub2-mkconfig script to
> correctly detect initramfs and set the kernel parameter "root=" to
> /dev/ram0 or just don't set the parameter at all.
>
> I'm using genkernel and want to use my generated initramfs, but
> everytime grub2-mkconfig gets called it sets the kernel parameter root=
> to my root partition and then the initramfs won't get used.
>
> I think manually editing /boot/grub2/grub.cfg and deleting the root=
> parameter and setting real_root isn't a good choice for long term.

The default scripts for grub2-mkconfig looks for a specific filename
for the initramfs, related to the kernel filename. If you look in
those scripts, you may be able to modify it to look at your filenames
instead.



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [gentoo-user] genkernel initramfs and grub2-mkconfig
  2012-06-04 19:10 ` Paul Hartman
@ 2012-06-04 19:50   ` Michael Hampicke
  2012-06-05  8:13     ` morlix
  0 siblings, 1 reply; 4+ messages in thread
From: Michael Hampicke @ 2012-06-04 19:50 UTC (permalink / raw
  To: gentoo-user



Am 04.06.2012 21:10, schrieb Paul Hartman:
> On Mon, Jun 4, 2012 at 1:40 PM, morlix <morlix@morlix.de> wrote:
>> Hello,
>>
>> does anybody of you know how to get the grub2-mkconfig script to
>> correctly detect initramfs and set the kernel parameter "root=" to
>> /dev/ram0 or just don't set the parameter at all.
>>
>> I'm using genkernel and want to use my generated initramfs, but
>> everytime grub2-mkconfig gets called it sets the kernel parameter root=
>> to my root partition and then the initramfs won't get used.
>>
>> I think manually editing /boot/grub2/grub.cfg and deleting the root=
>> parameter and setting real_root isn't a good choice for long term.
> 
> The default scripts for grub2-mkconfig looks for a specific filename
> for the initramfs, related to the kernel filename. If you look in
> those scripts, you may be able to modify it to look at your filenames
> instead.

Paul is right, but you shouldn't need to modify anything. Here's what
grub2-mkconfig generates on my machine (first entry only):


menuentry 'Gentoo GNU/Linux' --class gentoo --class gnu-linux --class
gnu --class os $menuentry_id_option
'gnulinux-simple-713f1c17-1b9a-4967-ac05-d6a6a9ff60a5' {
        load_video
        set gfxpayload=keep
        insmod gzio
        insmod part_gpt
        insmod ext2
        set root='hd0,gpt2'
        if [ x$feature_platform_search_hint = xy ]; then
          search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt2
--hint-efi=hd0,gpt2 --hint-baremetal=ahci0,gpt2
e39917c2-b59e-4447-bcae-39a41c3816a7
        else
          search --no-floppy --fs-uuid --set=root
e39917c2-b59e-4447-bcae-39a41c3816a7
        fi
        echo    'Loading Linux x86_64-3.3.5-gentoo ...'
        linux   /kernel-genkernel-x86_64-3.3.5-gentoo
root=UUID=713f1c17-1b9a-4967-ac05-d6a6a9ff60a5 ro
        echo    'Loading initial ramdisk ...'
        initrd  /initramfs-genkernel-x86_64-3.3.5-gentoo
}


And here are the file in /boot
# find /boot/ -name "*genkernel*"
/boot/kernel-genkernel-x86_64-3.3.5-gentoo
/boot/System.map-genkernel-x86_64-3.3.5-gentoo
/boot/initramfs-genkernel-x86_64-3.3.5-gentoo
/boot/kernel-genkernel-x86_64-3.3.5-gentoo.old
/boot/System.map-genkernel-x86_64-3.3.5-gentoo.old
/boot/initramfs-genkernel-x86_64-3.3.5-gentoo.old

It boots perfectly fine using my initramfs



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [gentoo-user] genkernel initramfs and grub2-mkconfig
  2012-06-04 19:50   ` Michael Hampicke
@ 2012-06-05  8:13     ` morlix
  0 siblings, 0 replies; 4+ messages in thread
From: morlix @ 2012-06-05  8:13 UTC (permalink / raw
  To: gentoo-user

[-- Attachment #1: Type: text/plain, Size: 4042 bytes --]

I thought if root= is not set to /dev/ram0 the kernel doesn't use the
initramfs as "first" root.

The server is on a remote location so i can't see if it correctly starts
the /linuxrc in the initramfs.

The server boots without problems, i just wanted to check if root=
shouldn't be set to root=/dev/ram0, so that my initramfs will be used.

Here is the interesting part on my machine:

menuentry 'Gentoo GNU/Linux' --class gentoo --class gnu-linux --class
gnu --class os $menuentry_id_option 'gnulinux-simple-f14c5701-d
305-4bd7-9655-f20f5877a5aa' {
        load_video
        insmod gzio
        insmod part_gpt
        insmod part_gpt
        insmod diskfilter
        insmod mdraid1x
        insmod ext2
        set root='mduuid/4aff33622e32377381237e3004a4b8bc'
        if [ x$feature_platform_search_hint = xy ]; then
          search --no-floppy --fs-uuid --set=root
--hint='mduuid/4aff33622e32377381237e3004a4b8bc'
71d9e42f-84b7-4e16-bd07-b88d09c4f
513
        else
          search --no-floppy --fs-uuid --set=root
71d9e42f-84b7-4e16-bd07-b88d09c4f513
        fi
        echo    'Loading Linux x86_64-3.2.11-hardened_20120601-1 ...'
        linux   /kernel-genkernel-x86_64-3.2.11-hardened_20120601-1
root=UUID=f14c5701-d305-4bd7-9655-f20f5877a5aa ro dolvm domdadm r
eal_root=UUID=f14c5701-d305-4bd7-9655-f20f5877a5aa
        echo    'Loading initial ramdisk ...'
        initrd  /initramfs-genkernel-x86_64-3.2.11-hardened_20120601-1
}


Thanks for your answers!

Am 04.06.2012 21:50, schrieb Michael Hampicke:
> 
> 
> Am 04.06.2012 21:10, schrieb Paul Hartman:
>> On Mon, Jun 4, 2012 at 1:40 PM, morlix <morlix@morlix.de> wrote:
>>> Hello,
>>>
>>> does anybody of you know how to get the grub2-mkconfig script to
>>> correctly detect initramfs and set the kernel parameter "root=" to
>>> /dev/ram0 or just don't set the parameter at all.
>>>
>>> I'm using genkernel and want to use my generated initramfs, but
>>> everytime grub2-mkconfig gets called it sets the kernel parameter root=
>>> to my root partition and then the initramfs won't get used.
>>>
>>> I think manually editing /boot/grub2/grub.cfg and deleting the root=
>>> parameter and setting real_root isn't a good choice for long term.
>>
>> The default scripts for grub2-mkconfig looks for a specific filename
>> for the initramfs, related to the kernel filename. If you look in
>> those scripts, you may be able to modify it to look at your filenames
>> instead.
> 
> Paul is right, but you shouldn't need to modify anything. Here's what
> grub2-mkconfig generates on my machine (first entry only):
> 
> 
> menuentry 'Gentoo GNU/Linux' --class gentoo --class gnu-linux --class
> gnu --class os $menuentry_id_option
> 'gnulinux-simple-713f1c17-1b9a-4967-ac05-d6a6a9ff60a5' {
>         load_video
>         set gfxpayload=keep
>         insmod gzio
>         insmod part_gpt
>         insmod ext2
>         set root='hd0,gpt2'
>         if [ x$feature_platform_search_hint = xy ]; then
>           search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt2
> --hint-efi=hd0,gpt2 --hint-baremetal=ahci0,gpt2
> e39917c2-b59e-4447-bcae-39a41c3816a7
>         else
>           search --no-floppy --fs-uuid --set=root
> e39917c2-b59e-4447-bcae-39a41c3816a7
>         fi
>         echo    'Loading Linux x86_64-3.3.5-gentoo ...'
>         linux   /kernel-genkernel-x86_64-3.3.5-gentoo
> root=UUID=713f1c17-1b9a-4967-ac05-d6a6a9ff60a5 ro
>         echo    'Loading initial ramdisk ...'
>         initrd  /initramfs-genkernel-x86_64-3.3.5-gentoo
> }
> 
> 
> And here are the file in /boot
> # find /boot/ -name "*genkernel*"
> /boot/kernel-genkernel-x86_64-3.3.5-gentoo
> /boot/System.map-genkernel-x86_64-3.3.5-gentoo
> /boot/initramfs-genkernel-x86_64-3.3.5-gentoo
> /boot/kernel-genkernel-x86_64-3.3.5-gentoo.old
> /boot/System.map-genkernel-x86_64-3.3.5-gentoo.old
> /boot/initramfs-genkernel-x86_64-3.3.5-gentoo.old
> 
> It boots perfectly fine using my initramfs


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 262 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-06-05  8:15 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-06-04 18:40 [gentoo-user] genkernel initramfs and grub2-mkconfig morlix
2012-06-04 19:10 ` Paul Hartman
2012-06-04 19:50   ` Michael Hampicke
2012-06-05  8:13     ` morlix

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox