天天看點

How to View, Modify and Recreate initrd.img

question:how do i view, modify and recreate the new initrd.img on ubuntu, debian, centos, fedora, red-hat, arch linux, or suse distributions?

initrd.imgis in gzip format.  so move initrd.img to initrd.gz as shown below.

unzip the initrd.gz file as shown below.

after unziping the initrd.gz file, the initrd is further in cpio ‘newc’ format. so extract the files from initrd usingcpio ‘newc’ formatas shown below.

note:info cpiowill give more information about ‘newc’ format.

now you can view the content of initrd.img file

after extracting the file as shown below, make appropriate modification to any of those files. then pack the files back into the archive using the following commands. pack the modified files back to cpio ‘newc’ format.

gzip the archive file.

move file as an image file. you can use the newinitrd.img as your new boot image.

本文出自 “” 部落格,請務必保留此出處

繼續閱讀