LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Red Hat
User Name
Password
Red Hat This forum is for the discussion of Red Hat Linux.

Notices


Reply
  Search this Thread
Old 03-12-2009, 12:55 AM   #1
shpandya
LQ Newbie
 
Registered: Feb 2009
Posts: 6

Rep: Reputation: 0
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
 
Old 03-12-2009, 01:01 AM   #2
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,355

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
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)
 
Old 03-12-2009, 07:55 AM   #3
shpandya
LQ Newbie
 
Registered: Feb 2009
Posts: 6

Original Poster
Rep: Reputation: 0
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.
 
Old 03-13-2009, 11:26 PM   #4
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,355

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
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...

Last edited by chrism01; 03-13-2009 at 11:27 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
how to make initrd.img for your kernel without boot disk? donaldtalbert Linux - Software 1 06-19-2005 10:30 PM
making kernel RPM. does not make initrd file mindcry Linux - Software 5 08-12-2004 10:20 PM
Help me figure out which kernel and initrd version i have from a live cd prompt. Pls n0xide Linux - Newbie 1 03-06-2004 01:50 PM
initrd support for kernel version 2.4.22 hangover Linux - Newbie 2 12-16-2003 11:49 AM
New Kernel 2.4.22 won't make initrd jon1591 Linux - Newbie 3 12-13-2003 02:09 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Red Hat

All times are GMT -5. The time now is 06:10 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration