[syslinux] modifying initrd.img to run custom application

William Estrada MrUmunhum at popdial.com
Thu Dec 28 12:39:09 PST 2006


> 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




More information about the Syslinux mailing list