View Full Version : How to modify initrd.img ?

24th June 2006, 12:50 PM

I was recently trying to get Suspend 2 working on FC5,
i know i can get it working out of the box but i really wanted compile it and learn a few things,

Now the problem is that i have a swap partition on an LVM,
so suspend 2 cannot directly access it,
ie initrd.img must enable the LVM first and then it would be able to resume from there,
so i need to edit "init" script inside initrd.img

I tried but with no success
i (g)unziped the initrd.img
i hard a hard time figuring out that thet now have initrd in cpio format,
so (un)cpio-ed the image further
i obtained its contents, now i can see the init script and other directories (sbin,etc, etc..)
i add the line
echo > /proc/suspend2/do_resume
just after the LVM mounts and before the root fs mount,

i then cpio it into an archive
then gzip it
then rename it as initrd.img and place it in the /boot
restart,but now its hung ! uncompressing kernel and just hangs ... no further output

i think i messed up somewhere with cpio
can some one help me out
xask wuz here