Hi, I have an initrd image for my Debian 2.6.13 kernel and I wanted to modify a file in the initrd. I know how to view the contents but I don't know what I have to do in order to change it because it mounts the initrd image as a READ-ONLY filesystem.
Here is what I did:
root@debian:~# file -z /boot/initrd.img-2.6.13 /boot/initrd.img-2.6.13: Linux Compressed ROM File System data, little endian size 1372160 version #2 sorted_dirs CRC 0x30bc9195, edition 0, 879 blocks, 123 files
Looks like my initrd image is cramfs type. so next I tried accessing the contents by following this website's instruction http://www.ducea.com/2006/06/24/insp...n-initrd-file/
# All work is done in a temporary directory
# Mount the image file directly
mount -o loop /boot/initrd.img-2.6.13 /tmp/initrdmount
#Investigate its content, etc.
#Once done un-mount it:
Ok I was able to mount it and I could see the contents also:
root@debian:~# ls /tmp/initrdmount/
bin dev2 keyscripts linuxrc.conf proc scripts usr
bin2 devfs lib loadmodules sbin sys var
dev etc linuxrc mnt script tmp
Everything is fine till now(atleast it appears), but now when I tried to create a file in the initrd, I got the following message:
root@debian:/tmp/initrdmount# touch test
touch: cannot touch `test': Read-only file system
Is there any way I can mount it as read-write file system? Also what will be the steps (in summary) once I am able to modify the files inside initrd, to get my new initrd image going.