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".
Created attachment 364128 [details, diff] The patch adding the correct guessing option for genkernel-generated initramfs files
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.