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:
Code:
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
root@debian:~#
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/ :
Code:
# All work is done in a temporary directory
mkdir /tmp/initrdmount
# Mount the image file directly
mount -o loop /boot/initrd.img-2.6.13 /tmp/initrdmount
#Investigate its content, etc.
cd /tmp/initrdmount
#Once done un-mount it:
umount /tmp/initrdmount
Ok I was able to mount it and I could see the contents also:
Code:
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
root@debian:~#
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:
Code:
root@debian:/tmp/initrdmount# touch test
touch: cannot touch `test': Read-only file system
root@debian:/tmp/initrdmount#
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.
THanks