2

With lsinitramfs I see a bunch of files. And this is I've got after run cpio -idv < initrd.img-4.15.0-24-generic command:

kernel
kernel/x86
kernel/x86/microcode
kernel/x86/microcode/.enuineIntel.align.0123456789abc
kernel/x86/microcode/GenuineIntel.bin
574 blocks

How do I extract the file correctly?

tenjohn
  • 361

2 Answers2

0

Install dracut Deb package first. It provides tool called skipcpio:

apt install dracut

Create temporary directory and extract given initramfs file into it:

mkdir ~/temp
cd ~/temp
/usr/lib/dracut/skipcpio /boot/initrd.img-4.18.0-25-generic | gunzip -c | cpio -idm
Greg W
  • 17
  • 1
    Warning! installing dracut will remove initramfs-tools and other potentially used and useful packages and will rebuild your initramfs which will moot what you were trying to unpack in the first place. (At least I found out before I rebooted). Apparently the trick is: unmkinitramfs -v /boot/initrd.img . – Seth Robertson Apr 12 '23 at 02:09
0

Warning! installing dracut will remove initramfs-tools and other potentially used and useful packages and will rebuild your initramfs which will moot what you were trying to unpack in the first place.

Use this standard tool:

unmkinitramfs -v /boot/initrd.img out_directory

P.S. It's better to write correct answers in Answers, not in Comments.

midenok
  • 792
  • 1
  • 8
  • 13