does 2.4 kernel need 2.4 initrd?

does 2.4 kernel need 2.4 initrd?

Post by Anders Lars » Thu, 08 Feb 2001 18:35:53




>I have a kernel building question:

>First must I have an initrd lilo entry to
>boot a scsi device (an adaptec controller).

No, not if you build the adaptec driver into the kernel.

Quote:>If yes, then

>Do I need to build a new initrd for 2.4 kernel.
>  or
>Can I use the 2.2 initrd with a 2.4 kernel.

The initrd must match the kernel *exactly*, i.e., you can't even use an
initrd-2.2.14-... with a 2.2.16 kernel.

Quote:>I am upgrading a redhat 7.0 system to use 2.4 kernel.

>When I tried to build a new initrd, it complains it cannot
>find my AIC-7xxx modules. When I config my scsi devices
>as modules I can build a new initrd, but my system won't boot up.
>I get a system panic at boot up complaining
>about a bad root device.

You *do* have the 2.4 modutils, do you?

Quote:>When I build the drivers in, it seems to work -
>but I'm not sure why or if that was what made it
>work as I was trying lots of things.

Sure it was - but you really only have to build the driver of the boot-
device into the kernel - you could leave the rest as modules.

Quote:>So, I am really confused,
>about scsi and initrd, because when
>the drivers are built in
>I cannot then build a new initrd.

Should still be possible *if* you have left something as modules.

Quote:>I need to do this upgrade to other systems,
>so I need to really understand this.

One pragmatic solution is to build anything that is needed to boot into
the kernel and leave the rest (which can be loaded later) as modules.
In that case, you don't need an initrd at all.

Quote:>(Do you really need to first
>build the drivers modular to build
>initrd, then make the drivers
>built-in in order to boot up??
>seems strange, I must be doing something
>else wrong).

Yes. The order should always be
build kernel, build & install modules, mkinitrd

HTH
  Anders

 
 
 

does 2.4 kernel need 2.4 initrd?

Post by Eric Taylo » Thu, 08 Feb 2001 18:51:20




> >When I build the drivers in, it seems to work -
> >but I'm not sure why or if that was what made it
> >work as I was trying lots of things.

> >So, I am really confused,
> >about scsi and initrd, because when
> >the drivers are built in
> >I cannot then build a new initrd.

> If the SCSI driver is built in you don't need initrd.  The initrd
> is a way to load a disk device driver before you can access the
> disk device that needs the disk device driver before the disk
> can be accessed.   Initrd creates a ramdisk from where the disk
> device driver can be installed.  If the device driver is built in
> there is no need to load the disk device driver, and therefore
> there is no need for an initial ramdisk, and thus no initrd.

> Villy

I am so DUMB!!!
No wonder I got a kernel panic.

If you were asked to read the disk
to get the disk driver that is needed
to read the disk before you can read the disk
then you would panic too!!

But now I am even more confused!!!!!
In order to build initrd, I HAD to do a
config saying that the scsi drivers were
modules. Otherwise building initrd complained
it could not find the scsi module.

But if I make the scsi driver a module, then
how does it get loaded when modules are loaded
after the root device is mounted????

Or does the initrd sort of preload the scsi module
before the root device gets accessed and it remains
loaded while the root device is switched?

Trying to think this one out feels like my brain
is being sucked into a black hole!

eric

 
 
 

does 2.4 kernel need 2.4 initrd?

Post by Villy Kru » Thu, 08 Feb 2001 20:16:36



>Or does the initrd sort of preload the scsi module
>before the root device gets accessed and it remains
>loaded while the root device is switched?

Exactly.  

Quote:>Trying to think this one out feels like my brain
>is being sucked into a black hole!

Don't make the scsi driver as modules, but build them in.  (You
already did that).
Then you forget about initrd.  End of story.

Villy

 
 
 

does 2.4 kernel need 2.4 initrd?

Post by Eric Taylo » Fri, 09 Feb 2001 03:15:48



> >I need to do this upgrade to other systems,
> >so I need to really understand this.

> One pragmatic solution is to build anything that is needed to boot into
> the kernel and leave the rest (which can be loaded later) as modules.
> In that case, you don't need an initrd at all.

> >(Do you really need to first
> >build the drivers modular to build
> >initrd, then make the drivers
> >built-in in order to boot up??
> >seems strange, I must be doing something
> >else wrong).

> Yes. The order should always be
> build kernel, build & install modules, mkinitrd

> HTH
>   Anders

Ok, so the only reason for initrd is when you
don't know what the boot device is on the
target system. Like in a redhat standard release cd.

I was wanting to build the kernel on one system
and copy it to other systems. But I don't know yet
what hardware these systems will have.  So, I guess
redhat uses initrd, but must have on the install
cd all the boot driver modules prebuilt and chooses
the right one based on the hardware it sees and builds
a custom initrd.

In my case, I guess I should forget that idea and
upgrade a standard installation from source; look
at what scsi device it has and build in that driver
only, then add a lilo entry without initrd for the 2.4
kernel.

Thanks All, it's been quite an education.

eric

 
 
 

does 2.4 kernel need 2.4 initrd?

Post by Villy Kru » Fri, 09 Feb 2001 17:14:52



>I was wanting to build the kernel on one system
>and copy it to other systems. But I don't know yet
>what hardware these systems will have.  So, I guess
>redhat uses initrd, but must have on the install
>cd all the boot driver modules prebuilt and chooses
>the right one based on the hardware it sees and builds
>a custom initrd.

No, the RH install CD contains a initrd which contains the inital
part of the install procedure, including asking the user or the
PCI table for what hardware is installed.  The install procedure,
still running from the initial ramdisk, then loads the required modules
also found in the initial ramdisk, as the CD is not yet accessible.

When the install is finished the last step is to build a customized
initrd file with the correct scsi driver and instrunction to load it,
and then include it in the lilo.

If you copy the initrd file to a tmp directory you can ungezip it and
mount it by using the loop device.  Then you can see what it contains.

If you don't have a SCSI disk the install procedure will build an
initrd file which is essential empty, that is, it doesn't do anything.

Villy