Debian with the packages amd64-microcode / intel-microcode packages installed seems to use some kind of mess of an uncompressed cpio archive containing the CPU microcode followed by a gzip compressed cpio archive with the actual initrd contents. The only way I've ever been able to extract it is by using binwalk (apt install binwalk), which can both correctly list the structure:
binwalk /path/to/initrd
example output:
host ~ # binwalk /boot/initrd.img-5.10.0-15-amd64 DECIMAL HEXADECIMAL DESCRIPTION -------------------------------------------------------------------------------- 0 0x0 ASCII cpio archive (SVR4 with no CRC), file name: "kernel", file name length: "0x00000007", file size: "0x00000000" 120 0x78 ASCII cpio archive (SVR4 with no CRC), file name: "kernel/x86", file name length: "0x0000000B", file size: "0x00000000" 244 0xF4 ASCII cpio archive (SVR4 with no CRC), file name: "kernel/x86/microcode", file name length: "0x00000015", file size: "0x00000000" 376 0x178 ASCII cpio archive (SVR4 with no CRC), file name: "kernel/x86/microcode/.enuineIntel.align.0123456789abc", file name length: "0x00000036", file size: "0x00000000" 540 0x21C ASCII cpio archive (SVR4 with no CRC), file name: "kernel/x86/microcode/GenuineIntel.bin", file name length: "0x00000026", file size: "0x00455C00" 4546224 0x455EB0 ASCII cpio archive (SVR4 with no CRC), file name: "TRAILER!!!", file name length: "0x0000000B", file size: "0x00000000" 4546560 0x456000 gzip compressed data, has original file name: "mkinitramfs-MAIN_dTZaRk", from Unix, last modified: 2022-06-14 14:02:57 37332712 0x239A6E8 MySQL ISAM compressed data file Version 9
and extract the separate parts:
binwalk -e /path/to/initrd
example output:
host ~ # binwalk -e /boot/initrd.img-5.10.0-15-amd64 DECIMAL HEXADECIMAL DESCRIPTION -------------------------------------------------------------------------------- 0 0x0 ASCII cpio archive (SVR4 with no CRC), file name: "kernel", file name length: "0x00000007", file size: "0x00000000" 120 0x78 ASCII cpio archive (SVR4 with no CRC), file name: "kernel/x86", file name length: "0x0000000B", file size: "0x00000000" 244 0xF4 ASCII cpio archive (SVR4 with no CRC), file name: "kernel/x86/microcode", file name length: "0x00000015", file size: "0x00000000" 376 0x178 ASCII cpio archive (SVR4 with no CRC), file name: "kernel/x86/microcode/.enuineIntel.align.0123456789abc", file name length: "0x00000036", file size: "0x00000000" 540 0x21C ASCII cpio archive (SVR4 with no CRC), file name: "kernel/x86/microcode/GenuineIntel.bin", file name length: "0x00000026", file size: "0x00455C00" 4546224 0x455EB0 ASCII cpio archive (SVR4 with no CRC), file name: "TRAILER!!!", file name length: "0x0000000B", file size: "0x00000000" 4546560 0x456000 gzip compressed data, has original file name: "mkinitramfs-MAIN_dTZaRk", from Unix, last modified: 2022-06-14 14:02:57 37332712 0x239A6E8 MySQL ISAM compressed data file Version 9
This'll give you the separate parts in separate files, and now you can finally extract the proper cpio archive:
host ~ # ls -l _initrd.img-5.10.0-15-amd64.extracted insgesamt 187M drwxr-xr-x 3 root root 4,0K 14. Jun 17:53 cpio-root/ -rw-r--r-- 1 root root 114M 14. Jun 17:53 mkinitramfs-MAIN_dTZaRk -rw-r--r-- 1 root root 39M 14. Jun 17:53 0.cpio -rw-r--r-- 1 root root 35M 14. Jun 17:53 mkinitramfs-MAIN_dTZaRk.gz
host ~/_initrd.img-5.10.0-15-amd64.extracted # mkdir extracted host ~/_initrd.img-5.10.0-15-amd64.extracted # cd extracted host ~/_initrd.img-5.10.0-15-amd64.extracted/extracted # cat ../mkinitramfs-MAIN_dTZaRk | cpio -idmv --no-absolute-filenames [...]
host ~/_initrd.img-5.10.0-15-amd64.extracted/extracted # ll insgesamt 28K lrwxrwxrwx 1 root root 7 14. Jun 17:55 bin -> usr/bin/ drwxr-xr-x 3 root root 4,0K 14. Jun 17:55 conf/ drwxr-xr-x 7 root root 4,0K 14. Jun 17:55 etc/ lrwxrwxrwx 1 root root 7 14. Jun 17:55 lib -> usr/lib/ lrwxrwxrwx 1 root root 9 14. Jun 17:55 lib32 -> usr/lib32/ lrwxrwxrwx 1 root root 9 14. Jun 17:55 lib64 -> usr/lib64/ lrwxrwxrwx 1 root root 10 14. Jun 17:55 libx32 -> usr/libx32/ drwxr-xr-x 2 root root 4,0K 14. Jun 16:02 run/ lrwxrwxrwx 1 root root 8 14. Jun 17:55 sbin -> usr/sbin/ drwxr-xr-x 8 root root 4,0K 14. Jun 17:55 scripts/ drwxr-xr-x 8 root root 4,0K 14. Jun 17:55 usr/ -rwxr-xr-x 1 root root 6,2K 14. Jan 2021 init*