LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Red Hat (https://www.linuxquestions.org/questions/red-hat-31/)
-   -   RHEL 4 : how can I make initrd for kernel version different fromthe base kernel (https://www.linuxquestions.org/questions/red-hat-31/rhel-4-how-can-i-make-initrd-for-kernel-version-different-fromthe-base-kernel-710939/)

shpandya 03-12-2009 12:55 AM

RHEL 4 : how can I make initrd for kernel version different fromthe base kernel
 
Hi,



The RHEL 4 update 7 installation CD installs the kernel with version 2.6.9-78.EL and therefore must contain corresponding vmlinuz and initrd.img. However I would like to have an all modules initrd that is used during installation but for a different version (2.6.9-78.0.13.EL).

Is there a way in which I could obtain/make such an initrd?



Thanks,

Shyamal

chrism01 03-12-2009 01:01 AM

Try

mkinitrd /boot/initrd-$(uname -r).img $(uname -r)

builds an initrd for the current running kernel

This will force add a module (scsi_mod) that's not running now, but will be in the target system

mkinitrd --with=scsi_mod /boot/initrd-$(uname -r).img $(uname -r)

shpandya 03-12-2009 07:55 AM

Doesn't that make the initrd for the current hardware? how about if we want to have modules for other hardware? The Redhat installer CD has an initrd that contains many more modules than the one generated by mkinitrd.

chrism01 03-13-2009 11:26 PM

See my 2nd example: you can add modules to initrd using the --with=... or

2. Placing a filesystem-related directive in /etc/modprobe.conf:
echo "alias scsi_hostadapter qla2300" >> /etc/modprobe.conf
mkinitrd /boot/initrd-$(uname -r).img $(uname -r)
The commands above will result in at least the qla2300 module (plus any dependent modules) to be loaded into
the initial RAM disk.

3. Placing an executable file in /etc/sysconfig/mkinitrd/:
echo 'MODULES="$MODULES raid1"' > /etc/sysconfig/mkinitrd/raid1
chmod +x /etc/sysconfig/mkinitrd/raid1
mkinitrd /boot/initrd-$(uname -r).img $(uname -r)
This will result in the raid1 module to be loaded into the initial RAM disk.


Hope that helps.

Ps not sure how you'd do it for a different kernel...


All times are GMT -5. The time now is 04:39 PM.