working with initrd.img files

You may have occasion to edit the contents of an initrd.img file. If so, here is how:

Extract the contents of the image

gunzip < your-initrd.img | cpio -i --make-directories

Now make your edits and then repackage the initrd

find . | cpio -o -H newc | gzip -9 > your-new-initrd.img

Leave a Reply

Your email address will not be published. Required fields are marked *