pankaj takawale
2006-Dec-28 13:06 UTC
[syslinux] modifying initrd.img to run custom application
Im n/w booting machine with kernel - vmlinuz and initrd initrd.img. I copied vmlinuz & initrd.img from RHEL4 iso. I want to modify initrd.img so that when 2nd stage boot loader loads initrd, my custom application gets executed. linuxrc in initrd.img is sym-link to /sbin/init. My steps: 1. Renamed linuxrc to linuxrc1 2. created new linuxrc script & invoked "/linuxrc1" from script (Once initialization is done - i can invoke my custom application) But I get "Kernel Panic" error while booting. EXT2-fs: unable to read superblock isofs_fill_super: bread failed, dev=md1, iso_blknum=16, block=32 kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(9,1) I also tried creating initrd.img from scratch from mkird script mentioned at http://www-128.ibm.com/developerworks/linux/library/l-initrd.html. But I get same error. Please suggest the correct steps to modify initrd.img so that I can invoke my custom application. __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com
William Estrada
2006-Dec-28 20:39 UTC
[syslinux] modifying initrd.img to run custom application
> Message: 1 > Date: Thu, 28 Dec 2006 05:06:58 -0800 (PST) > From: pankaj takawale <pankaj_takawale at yahoo.com> > Subject: [syslinux] modifying initrd.img to run custom application > To: syslinux at zytor.com> Im n/w booting machine with kernel - vmlinuz and > initrd initrd.img. > I copied vmlinuz & initrd.img from RHEL4 iso. > > I want to modify initrd.img so that when 2nd stage > boot loader loads initrd, my custom application gets > executed.What applications are you running? Do they need to be started before the rest of the system? I have done it by executing the start up at 'init 4' level. Put what you want to do in /etc/rcd.4. Change inittab to make your system start init 4. Make the last program ('S99Start' for example) change to init 3, 5 or whatever you want.> > But I get "Kernel Panic" error while booting. > EXT2-fs: unable to read superblock > isofs_fill_super: bread failed, dev=md1, > iso_blknum=16, block=32 > kernel panic - not syncing: VFS: Unable to mount root > fs on unknown-block(9,1)You get this because the the file system was not installed correctly at boot time. Your boot loader will load the Kernel and then your initrdr.img mounted as '/', The root file system must be mounted and a 'pivot' is done to make it '/'.> Please suggest the correct steps to modify initrd.img > so that I can invoke my custom application.If you really want to change inittrd.img(?), you can decompress it, mount it on a loopback, modify what you want to change, umount it and recompress it. I have done it both ways. Do 'file' on your initrd.img to see what kind of compress data file it is. Some systems use gzip other use other compreesion program. From example: file /boot/initrd-2.6.17-1.2157_FC5.img /boot/initrd-2.6.17-1.2157_FC5.img: gzip compressed data, from Unix, last modified: Thu Aug 3 11:08:51 2006, max compression Let me know if you need more help. -- Thanks for your time. William Estrada Email : MrUmunhum at popdial dot com Resume : www.Mt-Umunhum-Wireless.net/resume/william_estrada.html HTTP : www.Mt-Umunhum-Wireless.net