分类: LINUX
2013-08-22 13:24:00
In case of Ubuntu 12.04 the initramfs image is a CPIO image with LZMA compression.
You can decompress it by the following:
mkdir /tmp/ubuntu_boot
cd /tmp/ubuntu_boot
cat /cdrom/casper/initrd.lz | lzcat | cpio -i
You can do your modifications (for example the above one)
And compress it again (watch out for the correct cpio parameters!) like this:
cd /tmp/ubuntu_boot
find . | cpio --quiet --dereference -o -H newc | lzma -c9 > /tmp/initrd_new.lz