This is in a VM with no kernel sources on disk, with a static (no-module) kernel. I can't think of any part of the initrd that needs kernel source bits. I'd expect genkernel to just build me an initrd, but: # genkernel initramfs --luks --no-ramdisk-modules * Gentoo Linux Genkernel; Version 3.4.45.1 * Running with options: initramfs --luks --no-ramdisk-modules * Using genkernel.conf from /etc/genkernel.conf * Sourcing arch-specific config.sh from /usr/share/genkernel/arch/x86_64/config.sh .. * Sourcing arch-specific modules_load from /usr/share/genkernel/arch/x86_64/modules_load .. * ERROR: kernel source directory "/usr/src/linux" was not found! * * -- Grepping log... -- * * Running with options: initramfs --luks --no-ramdisk-modules * Using genkernel.conf from /etc/genkernel.conf * Sourcing arch-specific config.sh from /usr/share/genkernel/arch/x86_64/config.sh .. * Sourcing arch-specific modules_load from /usr/share/genkernel/arch/x86_64/modules_load .. * * ERROR: kernel source directory "/usr/src/linux" was not found! * * -- End log... -- * * Please consult /var/log/genkernel.log for more information and any * errors that were reported above. * * Report any genkernel bugs to bugs.gentoo.org and * assign your bug to genkernel@gentoo.org. Please include * as much information as you can in your bug report; attaching * /var/log/genkernel.log so that your issue can be dealt with effectively. * * Please do *not* report compilation failures as genkernel bugs!
CANTFIX at the moment: Since https://gitweb.gentoo.org/proj/genkernel.git/commit/?id=0042cf39f3efd3ed14a9a8a363b82cb43117b4e4 we depend on gen_init_cpio which is part of kernel sources: > * initramfs: >> Initializing... > * >> Appending devices cpio data... > Adding devices to cpio: > dir /dev 0755 0 0 > nod /dev/console 660 0 0 c 5 1 > nod /dev/null 660 0 0 c 1 3 > nod /dev/zero 660 0 0 c 1 5 > nod /dev/tty0 600 0 0 c 4 0 > nod /dev/tty1 600 0 0 c 4 1 > nod /dev/ttyS0 600 0 0 c 4 64 > /usr/share/genkernel/gen_initramfs.sh: line 80: /usr/src/linux/usr/gen_init_cpio: No such file or directory
*** Bug 616734 has been marked as a duplicate of this bug. ***
Like posted in bug 491636, need for gen_init_cpio was addressed via https://gitweb.gentoo.org/proj/genkernel.git/commit/?id=dcfc952708ed4d6f7ffd303178d7b72e79c6aa3c Keep in mind: If you are going to build a static kernel you have to tell genkernel.