HowTo Edit Initrd.img in RHEL/CentOS 6.x

on April 16 | in Linux | by | with 2 Comments

In this howto I will describe how to edit initrd.img from iso file to add new drivers in RHEL 6.x. We face an issue to add 40G t4_tom chelsio card driver inside initrd.img to start kickstart installation from Network. The initrd.img comes with RHEL 6.x ISO doesn’t contain this driver and hence we were unable to start kickstart installation from network. Chelsio provided DriverDisk but it doesn’t work because it require to provide it using any dvd or usb drive, which is impossible if you installing large number of nodes and away from your DataCenter. This method can work for any add/edit initrd.img file. For my work I used RHEL 6.5. Before doing it you should have one server running with RHEL 6.5 and updated driver.

1. Get Initrd.img from ISO

 2. Extract Initrd.img

Before extract rename initrd.img to initrd.img.xz because its compressed with xz and will remove its extension and rename again with initrd.img

 3. Copy Required Driver

I will used already installed chelsio driver from chelsio script. We were using same directory tree,

 4. Update driver information from modules.* to initrd.img modules.* files.

I will used chelsio driver information here and it can be different for you. You need to confirm which hardware driver you will used to insert in initrd.img and its information from modules.* files.

5. Generate modules.*.bin files inside initrd.img

This will recreate all modules.*.bin files using required driver information using modules.* files. This required because without this initrd.img will unable to load newly inserted driver.

 6. Generate updated Initrd.img

Your initrd.img is ready and you can used this new initrd.img to replaced stock initrd.img to start kickstart installation or network boot.

If you have any question please use comments.

Pin It

related posts

2 Responses to HowTo Edit Initrd.img in RHEL/CentOS 6.x

  1. tam007 says:

    I am getting the below reply while I pass the parameter –decompress. Can anyone help me on this?

    [root@localhost work]# xz –format=lzma initrd.img.xz –-decompress
    xz: –-decompress: No such file or directory
    [root@localhost work]#

  2. @TAM007: its single – in the decompress not the double –. Please use like this


Leave a Reply

Your email address will not be published. Required fields are marked *

« »