1830210 Members
2296 Online
109999 Solutions
New Discussion

Linux initrd

 
admin1979
Super Advisor

Linux initrd

Hi Folks,

We have been using SLES 10 Linux Customised OS so far. Recently our system could not detect one of the fibre cards.
Now we have downloaded the required drivers that should make the card recognised by the system.
What we need to do so that when we install the OS from scratch the system automatically loads the drivers in the sense post installation the card is ready to be used?
I have heard about initird. Does it help here or kernel compilation ??

Please suggest.

Thanks,
admin
6 REPLIES 6
Ralph Grothe
Honored Contributor

Re: Linux initrd

Hi admin1979,

though I'm really not into SLES at all (we use RHEL),
I guess that in this respect an answer wouldn't be that distro specific.
To my knowledge, in your initial ram disk you only require those drivers that are essential to boot the kernel and mount your rootfs.
So I would guess that if you don't intend to boot your kernel from one of your SAN disks or need to mount one such device in the initial boot stage that you then don't need to modify your initrd image file.
If you are curious to see what drivers/modules are contained in your initrd then you could unzip the image and dump the contained cpio archive to some temporary filesystem (at least the following should work under RHEL, and their relatively dated kernels)
e.g.

# mkdir /tmp/initrd && cd /tmp/initrd
# gzip -dc /boot/initrd-$(uname -r).img | cpio -id

then you could look for the modules contained under /tmp/initrd/lib or have a look at the init script /tmp/initrd/init to find out which modules get loaded
e.g.
# egrep insmod\|modprobe /tmp/initrd/init

If you really think that you need to create a new or customize your initrd you could theoretically just modify the extracted cpio archive by adding some required module and editing init and finally cpio-ing it out (i.e. -o...), gziping it and copying it back into /boot.
However, the recommended way would be to use some tool (script) like mkinitrd (under RHEL, which also has a manpage).

Madness, thy name is system administration
admin1979
Super Advisor

Re: Linux initrd

Thanks you are spot on in first place.
We dont need to recognise this Fibre card in the initial phase of booting.
So initird option is not mandatory.
But then the question is , if not through initrd then whats the other option?
Please clarify that.


Thanks,
admin
J. Maestre
Honored Contributor

Re: Linux initrd

Use /etc/modprobe.conf or the conf files under /etc/modprobe.d/ (depending on the distro) to define what modules should be loaded on boot.

If I remember corrently you can also use yast, going to system -> sysconf editor -> System -> kernel -> MODULES_LOADED_ON_BOOT -> add your module (driver) name there.
admin1979
Super Advisor

Re: Linux initrd

Ok thanks but what next? Suppose I mention the required driver name and boot the system and find that the required module is loaded correctly. So then how do I import it into our customised OS ?
So that it is avialable after every installations.

Thanx,
admin
Matti_Kurkela
Honored Contributor

Re: Linux initrd

The sysconf editor in YaST mostly makes changes into files in the /etc/sysconfig directory. In this case, the file is /etc/sysconfig/kernel. In that file, there's a variable MODULES_LOADED_ON_BOOT. This is what tells the /etc/rc.d/boot.loadmodules script which modules to load at system boot time.

If your post-install customization sets the correct value to the MODULES_LOADED_ON_BOOT variable in this file, the script will automatically load the module(s) at system boot time.

If the module requires any options, your post-install customization should also drop a file with the appropriate "options " line into /etc/modprobe.d directory. You are free to choose the name of the file: all the files in this directory are read by modprobe when it loads modules.

MK
MK
admin1979
Super Advisor

Re: Linux initrd

As mentioned above.