Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 492774

Summary: sys-boot/grub-2.00_p5107-r2 fails to automatically pick up genkernel-generated initramfs files while using grub2-mkconfig
Product: Gentoo Linux Reporter: Sergey Temerkhanov <temerkhanov>
Component: [OLD] Core systemAssignee: Gentoo's Team for Core System packages <base-system>
Status: RESOLVED UPSTREAM    
Severity: normal CC: floppym
Priority: Normal Keywords: PATCH
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: The patch adding the correct guessing option for genkernel-generated initramfs files

Description Sergey Temerkhanov 2013-11-28 10:02:19 UTC
When using 'grub2-mkconfig -o /boot/grub/grub.cfg' command to create a grub-2 configuration file, the script fails to find the initramfs files if those are named like "initramfs-<kernel_name>-<architecture>-<version>" (like ) as the genkernel names them with the --kernname=kernel_name parameter. This leads to a number of problems varying from simple usage of device names instead of UUIDs to inability to boot without manual correction of grub configuration. 

Reproducible: Always

Steps to Reproduce:
1. emerge \>sys-boot/grub-2 sys-kernel/genkernel
2. grub2-mkconfig -o /boot/grub/grub.cfg
3. genkernel --kernname=<kernel_name> --install all
4. Get 3 files in the /boot: {System.map, initramfs,kernel}-<architecture>-<version>
5. grub2-mkconfig -o /boot/grub/grub.cfg



Actual Results:  
There are boot menu entries without "initrd" clauses and with device file names instead of uuids for the "root" parameter at the "linux" lines which one has to correct manually.

Expected Results:  
Boot menu entries with proper "initrd" clauses and with uuids for the "root" parameter at the "linux" lines without any need to manually correct the config.

That is caused by the list of possible initramfs file names in the /etc/grub.d/10_linux script being insufficient. The proposed patch adds the missing entry which is produced from the kernel file name by simple replacement of the word "kernel" by "initramfs".
Comment 1 Sergey Temerkhanov 2013-11-28 10:07:25 UTC
Created attachment 364128 [details, diff]
The patch adding the correct guessing option for genkernel-generated initramfs files
Comment 2 Mike Gilbert gentoo-dev 2013-12-09 23:39:51 UTC
Please submit your patch on the grub-devel mailing list for review.

https://lists.gnu.org/mailman/listinfo/grub-devel

You should also include an appropriate entry in the ChangeLog file.

GRUB is entering a feature-freeze on December 17, so please submit this before then to have it included in the next version of GRUB.

Feel free to reopen this bug once upstream has approved the patch.