How to modify initrd.img
I have an application which runs in offline mode(machine boot from product CD & app runs). That product CD has customized RHEL kernel.which doesn't have SSH package/binaries/libraries. I have to embed this package with the CD so that i can connect that target system remotely.
For that purpose, i want to modify initrd.img kernel image file & but the mounted directory of this image file wouldn't be able to accomodate all the binaries/libraries of ssh.( error: ..files couldn't copy: no more space left on the device)
So, I tried to create new initrd.img & copied all the existing files of old initrd.img alng with the new ssh package. I followed the following steps:
dd if=/dev/zero of=initrd bs=1024 count=100000
losetup /dev/loop3 initrd
mkfs.ext3 /dev/loop3 mkfs -t ext2 /dev/loop3
mount /dev/loop3 /mnt
cp -dpR newInitrdfiles/* /mnt/
losetup -d /dev/loop3
gzip -9 initrd
mv initrd.gz initrd.img
But with this new image, the system is not booting up.
It is throwing the following error:-
INIT: running level 3
INIT: no more processes in this run level.
I am very much sure that this problem occurs due to new initrd.img file only.
So how can i modify initrd.img or create new initrd.img file, so that i can embed this package into the product CD?
So please, can any one help me out?
Thanks in advance.
command for creating initrd images
man it for options