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

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
archenroot
Apprentice
Apprentice


Joined: 13 Dec 2011
Posts: 203
Location: Lake Macha, Czech republic

PostPosted: Wed Sep 07, 2016 1:50 pm    Post subject: grub-mkconfig doesn't detect custom named initrd Reply with quote

I am using configured genkernel for building my kernels in automated way.

I configured KNAME parameter in /etc/genkernel.conf:
Code:
# =========MISC KERNEL CONFIGURATION============
#
# Tag the kernel and ramdisk with a name:
# If not defined the option defaults to
# 'genkernel'
KNAME="zeuskernel"


The result of files in /boot is:
Code:
zeus boot # ls -la
total 11296
drwxr-xr-x  5 root root    4096 Sep  7 15:52 .
drwxr-xr-x 23 root root    4096 Jul 14 06:09 ..
drwxr-xr-x  2 root root    4096 Aug 23 11:12 backup
drwxr-xr-x  6 root root    4096 Sep  7 15:47 grub
-rw-r--r--  1 root root 2645712 Sep  7 15:42 initramfs-zeuskernel-x86_64-4.4.6-gentoo
-rw-r--r--  1 root root       0 Aug 13 21:22 .keep
-rw-r--r--  1 root root 5339808 Sep  7 15:42 kernel-zeuskernel-x86_64-4.4.6-gentoo
drwx------  2 root root   16384 Dec 20  2013 lost+found
-rw-r--r--  1 root root 3525519 Sep  7 15:42 System.map-zeuskernel-x86_64-4.4.6-gentoo


When I regenerate grub2 configuration it ends up like this:
Code:
zeus src # grub-mkconfig -o /boot/grub/grub.cfg
Generating grub configuration file ...
Found linux image: /boot/kernel-zeuskernel-x86_64-4.4.6-gentoo
done


So, initrd not found. I changed the KNAME back to default "genkernel" and regenerated files, so I have in my folder:
Code:
zeus boot # ls -la
total 22560
drwxr-xr-x  5 root root    4096 Sep  7 15:57 .
drwxr-xr-x 23 root root    4096 Jul 14 06:09 ..
drwxr-xr-x  2 root root    4096 Aug 23 11:12 backup
drwxr-xr-x  6 root root    4096 Sep  7 15:47 grub
-rw-r--r--  1 root root 2644340 Sep  7 15:57 initramfs-genkernel-x86_64-4.4.6-gentoo
-rw-r--r--  1 root root 2645712 Sep  7 15:42 initramfs-zeuskernel-x86_64-4.4.6-gentoo
-rw-r--r--  1 root root       0 Aug 13 21:22 .keep
-rw-r--r--  1 root root 5339808 Sep  7 15:57 kernel-genkernel-x86_64-4.4.6-gentoo
-rw-r--r--  1 root root 5339808 Sep  7 15:42 kernel-zeuskernel-x86_64-4.4.6-gentoo
drwx------  2 root root   16384 Dec 20  2013 lost+found
-rw-r--r--  1 root root 3525519 Sep  7 15:57 System.map-genkernel-x86_64-4.4.6-gentoo
-rw-r--r--  1 root root 3525519 Sep  7 15:42 System.map-zeuskernel-x86_64-4.4.6-gentoo


So I have same files doubled each set with different nick name, reruning the grub-mkconfig of grub2 will result in:
Code:
zeus boot # grub-mkconfig -o /boot/grub/grub.cfg
Generating grub configuration file ...
Found linux image: /boot/kernel-zeuskernel-x86_64-4.4.6-gentoo
Found initrd image: /boot/initramfs-genkernel-x86_64-4.4.6-gentoo
Found linux image: /boot/kernel-genkernel-x86_64-4.4.6-gentoo
Found initrd image: /boot/initramfs-genkernel-x86_64-4.4.6-gentoo
done


So there are 2 issues in general:
1. in case of custom KNAME and only single kernel files exists -> grub-mkconfig omits initrd to be detected
2. in case of working(default "genkernel" value) KNAME initrd exists -> grub-mkconfig link this to non-relevant kernel
Code:
Found linux image: /boot/kernel-zeuskernel-x86_64-4.4.6-gentoo
Found initrd image: /boot/initramfs-genkernel-x86_64-4.4.6-gentoo


I am not sure here if it is problem with genkernel which generates file names incompatible with grub2 or bug in grub2 string pattern definition. Any suggestion?
_________________
Emperor wants to control outer space Yoda wants to explore inner space that's the fundamental difference between good and bad sides of the Force
Back to top
View user's profile Send private message
fedeliallalinea
Bodhisattva
Bodhisattva


Joined: 08 Mar 2003
Posts: 21791
Location: here

PostPosted: Wed Sep 07, 2016 2:15 pm    Post subject: Reply with quote

The problem is /etc/grub.d/10_linux used by grub-mkconfig (see bug),
the only name accepted for initramfs are:
Code:
           "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}"

_________________
Questions are guaranteed in life; Answers aren't.
Back to top
View user's profile Send private message
archenroot
Apprentice
Apprentice


Joined: 13 Dec 2011
Posts: 203
Location: Lake Macha, Czech republic

PostPosted: Wed Sep 07, 2016 2:23 pm    Post subject: Reply with quote

Ok, thx for info about bug and the file with patterns, so upstream related.

On the other hand I found second issue not described/occurred in the refereed bug notes. In my case when 1 detectable initrd exists, it is linked to wrong kernel.
Code:
Found linux image: /boot/kernel-zeuskernel-x86_64-4.4.6-gentoo
Found initrd image: /boot/initramfs-genkernel-x86_64-4.4.6-gentoo


I will add this additional behavior description into bug comments directly or should I open new bug?

For info I am using in the moment sys-boot/grub-2.02_beta2-r9:
_________________
Emperor wants to control outer space Yoda wants to explore inner space that's the fundamental difference between good and bad sides of the Force
Back to top
View user's profile Send private message
fedeliallalinea
Bodhisattva
Bodhisattva


Joined: 08 Mar 2003
Posts: 21791
Location: here

PostPosted: Wed Sep 07, 2016 2:34 pm    Post subject: Reply with quote

archenroot wrote:
I will add this additional behavior description into bug comments directly or should I open new bug?

Imo add new information (the problem is the same) specifying the second issue.
_________________
Questions are guaranteed in life; Answers aren't.
Back to top
View user's profile Send private message
archenroot
Apprentice
Apprentice


Joined: 13 Dec 2011
Posts: 203
Location: Lake Macha, Czech republic

PostPosted: Wed Sep 07, 2016 3:11 pm    Post subject: Reply with quote

done
_________________
Emperor wants to control outer space Yoda wants to explore inner space that's the fundamental difference between good and bad sides of the Force
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo 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