Unpack/modify initrd image (TODO)

Linux specific questions/information are gathered here. The main thrust of topics are applied to Centos/RedHat(RH)/Debian/Ubuntu/Gentoo distributives

Unpack/modify initrd image (TODO)

Postby lik » Fri Jun 18, 2010 5:12 pm

Code: Select all
file /boot/initrd-2.6.18-194.8.1.el5.img
#/boot/initrd-2.6.18-194.8.1.el5.img: gzip compressed data, from Unix, last modified: Tue Jul 13 18:30:50 2010, max compression

Rename it to end in .gz and uncompress:
Code: Select all
gzip -d initrd-2.6.18-194.8.1.el5.img.gz
file initrd-2.6.18-194.8.1.el5.img
#initrd-2.6.18-194.8.1.el5.img: ASCII cpio archive (SVR4 with no CRC)

Let's open the compress cpio file:
Code: Select all
mkdir initrd_uncompressed
cd initrd_uncompressed
cpio -dumi < ../initrd-2.6.18-194.8.1.el5.img

To pack modified content back into initrd image do the following:
Code: Select all
find . |cpio -H newc -ov |gzip -c - > ../initrd-2.6.18-194.8.1.el5.img

http://sourceforge.net/apps/mediawiki/x ... ing_initrd
Posts: 497
Joined: Wed Dec 15, 2010 3:21 am

Return to Linux specific


  • Related topics
    Last post