I'm using genkernel-4.0.0_beta3 and executing `genkernel --menuconfig --firmware all`. When genkernel starts appending firmware files to initramfs, ls prints errors: * >> Appending firmware cpio data ... ls: cannot access './lib/firmware/brcm/brcmfmac43430a0-sdio.ONDA-V80': No such file or directory ls: cannot access 'PLUS.txt': No such file or directory * >> Appending modules cpio data ... In /lib/firmware/brcm path, there is 'brcmfmac43430a0-sdio.ONDA-V80 PLUS.txt' file which contains 1 space in name. It seems that genkernel doesn't handle it correctly. Reproducible: Always Steps to Reproduce: 1. emerge '=sys-kernel/gentoo-sources-5.2.1' 2. eselect kernel set linux-5.2.1-gentoo 3. genkernel --menuconfig --firmware all Actual Results: Genkernel prints: * >> Appending firmware cpio data ... ls: cannot access './lib/firmware/brcm/brcmfmac43430a0-sdio.ONDA-V80': No such file or directory ls: cannot access 'PLUS.txt': No such file or directory * >> Appending modules cpio data ... Expected Results: Genkernel should print: * >> Appending firmware cpio data ... * >> Appending modules cpio data ... and correctly handle filenames containing spaces.
The file should be present in initramfs. Can you confirm? The reported ls error is coming from log_future_cpio_content()'s ls call (https://gitweb.gentoo.org/proj/genkernel.git/tree/gen_initramfs.sh?h=v4.0.0_beta3#n173). In next version I'll use "find . -print0..." to address this problem.
I don't know how to list the contents of initramfs... I tried `lsinitrd /boot/initramfs-genkernel-x86_64-5.2.1-gentoo`: Image: initramfs-genkernel-x86_64-5.2.1-gentoo: 186M ======================================================================== Version: Arguments: dracut modules: ======================================================================== drwxr-xr-x 3 root root 0 Jul 16 10:49 . drwxr-xr-x 3 root root 0 Jul 16 10:49 kernel drwxr-xr-x 3 root root 0 Jul 16 10:49 kernel/x86 drwxr-xr-x 2 root root 0 Jul 16 10:49 kernel/x86/microcode -rw-r--r-- 1 root root 30546 Jul 16 10:49 kernel/x86/microcode/AuthenticAMD.bin -rw-r--r-- 1 root root 6081536 Jul 16 10:49 kernel/x86/microcode/GenuineIntel.bin ======================================================================== and `cpio -t < /boot/initramfs-genkernel-x86_64-5.2.1-gentoo`: . kernel kernel/x86 kernel/x86/microcode kernel/x86/microcode/GenuineIntel.bin kernel/x86/microcode/AuthenticAMD.bin 11940 blocks either there's no firmware, or I'm doing something wrong.
I just verified that with the old genkernel, initramfs is compressed and after uncompressing it contains firmware files. But with new genkernel it's uncompressed cpio archive that contains only microcode files, though the size of that archive is comparable to the size of old initramfs. Binwalk shows there's bzip2 compressed data after cpio archive... not sure if that's correct (for booting the system): 0 0x0 ASCII cpio archive (SVR4 with no CRC), file name: ".", file name length: "0x00000002", file size: "0x00000000" [...] 6082172 0x5CCE7C ASCII cpio archive (SVR4 with no CRC), file name: "kernel/x86/microcode/AuthenticAMD.bin", file name length: "0x00000026", file size: "0x00007752" 6112868 0x5D4664 ASCII cpio archive (SVR4 with no CRC), file name: "TRAILER!!!", file name length: "0x0000000B", file size: "0x00000000" 6113280 0x5D4800 bzip2 compressed data, block size = 900k [...]
Well, with binwalk and appended MCU CPIO it's a little bit tricky to get to initramfs. It's easier to re-run with --no-microcode-initramfs and maybe add --no-compress-initramfs as well.
I split the /boot/initramfs-genkernel-x86_64-5.2.1-gentoo, uncompressed bzip2 archive and lsinitrd shows that the firmware file is there: -rw-r--r-- 1 root root 989 Jul 16 10:46 lib/firmware/brcm/brcmfmac43430a0-sdio.ONDA-V80\ PLUS.txt Still not sure if this new format of initramfs is correct.
The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/proj/genkernel.git/commit/?id=e55a6c5c7a39a17bea902301125092e1952a931c commit e55a6c5c7a39a17bea902301125092e1952a931c Author: Thomas Deutschmann <whissi@gentoo.org> AuthorDate: 2019-07-16 11:31:13 +0000 Commit: Thomas Deutschmann <whissi@gentoo.org> CommitDate: 2019-07-16 12:16:00 +0000 gen_initramfs.sh: Use find with -print0 parameter to support files with whitespaces Bug: https://bugs.gentoo.org/689952 Signed-off-by: Thomas Deutschmann <whissi@gentoo.org> gen_initramfs.sh | 58 ++++++++++++++++++++++++++++---------------------------- 1 file changed, 29 insertions(+), 29 deletions(-)
The format is correct. It's coming from your kernel configuration. My initramfs will use XZ for example. See https://gitweb.gentoo.org/proj/genkernel.git/tree/gen_initramfs.sh?h=v4.0.0_beta3#n1616: We check which compression method your kernel supports...
I didn't mean the compression, but all tools think it's uncompressed cpio archive. I wonder how kernel will know where to find /init, I doubt it will guess there's compressed initramfs file after that cpio archive...
(In reply to Mariusz Ceier from comment #8) > I didn't mean the compression, but all tools think it's uncompressed cpio > archive. I wonder how kernel will know where to find /init, I doubt it will > guess there's compressed initramfs file after that cpio archive... I'm talking about the format of /boot/initramfs-genkernel-x86_64-5.2.1-gentoo. Sorry if that wasn't clear.
The format is correct. We are doing exactly what's shown in https://www.kernel.org/doc/Documentation/x86/microcode.txt: > cat ucode.cpio $INITRD.orig > $INITRD However, tools out there cannot handle concatenated initrd's very well. Next beta will produce initramfs which will be supported by dracut's lsinitrd tool (I only have to add some meta data).
(In reply to Thomas Deutschmann from comment #10) > The format is correct. We are doing exactly what's shown in > https://www.kernel.org/doc/Documentation/x86/microcode.txt: > Oh, great. Thanks for referencing this. I don't have any more comments to add to this issue ;)
beta4 is now available, thank you for the report.