Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
grub2-mkconfig doesn't detect initrd
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
devilkin
n00b
n00b


Joined: 18 Nov 2005
Posts: 15

PostPosted: Wed Apr 25, 2012 11:56 am    Post subject: grub2-mkconfig doesn't detect initrd Reply with quote

Hello Folks,

Recently (re)installed Gentoo, built kernel with genkernel and custom configuration, and it deposited a nice bzimage + initrd:

Code:
# ls -l /boot
total 7129
drwxr-xr-x 4 root root    1024 Apr 18 17:40 grub2
-rw-r--r-- 1 root root 3402655 Apr 20 12:06 initramfs-genkernel-x86_64-3.2.12-gentoo
-rw-r--r-- 1 root root 2209264 Apr 20 12:00 kernel-genkernel-x86_64-3.2.12-gentoo
drwx------ 2 root root   12288 Apr 18 14:47 lost+found
-rw-r--r-- 1 root root 1641455 Apr 20 12:00 System.map-genkernel-x86_64-3.2.12-gentoo


Unfortunately, when I wanted to update my grub2 config with grub2-mkconfig, it didn't detect the initrd, and didn't include it in the config.

Grub version is sys-boot/grub 2.00_beta3-r1.

example of grub2-mkconfig:
Code:
## BEGIN /etc/grub.d/10_linux ###
Found linux image: /boot/kernel-genkernel-x86_64-3.2.12-gentoo
menuentry 'Gentoo GNU/Linux' --class gentoo --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-b4019261-0c0c-478b-a2c0-7cf16e08a6f2' {
        load_video
        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  c3dadd34-40dc-4129-8228-954121ab7b38
        else
          search --no-floppy --fs-uuid --set=root c3dadd34-40dc-4129-8228-954121ab7b38
        fi
        echo    'Loading Linux x86_64-3.2.12-gentoo ...'
        linux   /kernel-genkernel-x86_64-3.2.12-gentoo root=/dev/mapper/macbook-root ro dolvm rootfstype=ext4
}
submenu 'Advanced options for Gentoo GNU/Linux' $menuentry_id_option 'gnulinux-advanced-b4019261-0c0c-478b-a2c0-7cf16e08a6f2' {
        menuentry 'Gentoo GNU/Linux, with Linux x86_64-3.2.12-gentoo' --class gentoo --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-x86_64-3.2.12-gentoo-advanced-b4019261-0c0c-478b-a2c0-7cf16e08a6f2' {
                load_video
                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  c3dadd34-40dc-4129-8228-954121ab7b38
                else
                  search --no-floppy --fs-uuid --set=root c3dadd34-40dc-4129-8228-954121ab7b38
                fi
                echo    'Loading Linux x86_64-3.2.12-gentoo ...'
                linux   /kernel-genkernel-x86_64-3.2.12-gentoo root=/dev/mapper/macbook-root ro dolvm rootfstype=ext4
        }
        menuentry 'Gentoo GNU/Linux, with Linux x86_64-3.2.12-gentoo (recovery mode)' --class gentoo --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-x86_64-3.2.12-gentoo-recovery-b4019261-0c0c-478b-a2c0-7cf16e08a6f2' {
                load_video
                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  c3dadd34-40dc-4129-8228-954121ab7b38
                else
                  search --no-floppy --fs-uuid --set=root c3dadd34-40dc-4129-8228-954121ab7b38
                fi
                echo    'Loading Linux x86_64-3.2.12-gentoo ...'
                linux   /kernel-genkernel-x86_64-3.2.12-gentoo root=/dev/mapper/macbook-root ro single dolvm rootfstype=ext4
        }
}

### END /etc/grub.d/10_linux ###


As you can see - no initrd. The code in /etc/grub/10_linux looks good for initrd detection, so I have no clue as to why it doesn't pick it up...

Anyone any idea?
Back to top
View user's profile Send private message
Arkhelion
Apprentice
Apprentice


Joined: 07 Sep 2010
Posts: 151
Location: France

PostPosted: Wed Apr 25, 2012 1:28 pm    Post subject: Reply with quote

The code for initrd is buggy in 10-linux because the $version contains $arch, so it looks for "initramfs-genkernel-x86_64-x86_64-3.3.2-gentoo" for instance. You have to correct the $version variable affectation or use "initramfs-genkernel-$(version)" without $arch to make it work.

EDIT : BTW I reinstalled grub-1.99 because 2.00_betaX (tries them all) couldn't find my LVM volumes (boot-on-realpart - root on LVM here), didn't have time to dig it up, so I just downgraded.
_________________
Arkhelion


Last edited by Arkhelion on Wed Apr 25, 2012 1:39 pm; edited 1 time in total
Back to top
View user's profile Send private message
devilkin
n00b
n00b


Joined: 18 Nov 2005
Posts: 15

PostPosted: Wed Apr 25, 2012 1:31 pm    Post subject: Reply with quote

Thanks, that did the trick. I guess I'll either look for a bug report or file one ;)
Back to top
View user's profile Send private message
jinn
n00b
n00b


Joined: 18 Mar 2004
Posts: 3
Location: London, UK

PostPosted: Mon Aug 27, 2012 10:47 am    Post subject: Reply with quote

For completeness the actual patterns searched for by grub2-mkconfig are the following:
Code:

for i in
        '"initrd.img-${version}"'
        '"initrd-${version}.img"'
        '"initrd-${version}.gz"'
        '"initrd-${version}"'
        '"initramfs-${version}.img"'
        '"initrd.img-${alt_version}"'
        '"initrd-${alt_version}.img"'
        '"initrd-${alt_version}"'
        '"initramfs-${alt_version}.img"'
        '"initramfs-genkernel-${version}"'
        '"initramfs-genkernel-${alt_version}"'
        '"initramfs-genkernel-${GENKERNEL_ARCH}-${version}"'
        '"initramfs-genkernel-${GENKERNEL_ARCH}-${alt_version}"'
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware 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