Results 1 to 3 of 3
I copy isolinux/initrd.img from RedHat 6.2 DVD to local floder. I want to add a file to initrd.img. I tried many command(gunzip,cpio...), but failed. I run "file initrd.img" and it ...
- 01-11-2012 #1Just Joined!
- Join Date
- Jan 2012
- Posts
- 2
How to rebuild RedHat 6.2 isolinux/initrd.img?
I copy isolinux/initrd.img from RedHat 6.2 DVD to local floder. I want to add a file to initrd.img. I tried many command(gunzip,cpio...), but failed. I run "file initrd.img" and it shows "initrd.img: data". But I can mount it with command "mount -t sysfs initrd.img /mnt/initrd", but I can not add file to it. Could anybody help?
- 01-11-2012 #2Just Joined!
- Join Date
- Jan 2012
- Posts
- 2
I found the solution:
1) Extract
mv initrd.img initrd.img.xz
xz --format=lzma initrd.img.xz --decompress
mkdir initrd-new
cd initrd-new
cpio -ivdum < ../initrd.img
2) Add/delete/modify files
3) Build
find . -print |cpio -o -H newc | xz --format=lzma > ../initrd.img
- 01-26-2012 #3Just Joined!
- Join Date
- Jan 2012
- Location
- Rowlett, TX
- Posts
- 4
Extract:
Compress:Code:mkdir initrd && cd initrd gzip -cd < ../initrd.img | cpio -id
Code:find . -print0 | cpio --null -o --format=newc | gzip -9 > ../initrd.img


Reply With Quote