Em 19/08/2011 10:48, Alan McKinnon <alan.mckin...@gmail.com> escreveu:
On Fri 19 August 2011 13:12:25 fra...@gmail.com did opine thusly:

> I the case I don't need a initram, I guess that the grub line for
> parameter passing to the kernel would be empty. Am I wrong?

Yes.

Using or not using kernel parameters has nothing to do with whether
you use an initramfs or not.

It's the initrd line in grub you do not need.

>
> I was just looking on how to build my own initram. What is it
> supposed to do anyway?

First, it's initramfs (the previous incarnation was initrd). You
should use the correct name.

An initramfs is a filesystems image stored on disk in a place that
grub can find. It contains a kernel, essential drivers and other bits
and pieces. When booting, grub finds the image, bangs it into memory
and instructs the cpu to start executing at a known point.

Why is this useful?

For Gentoo it usually isn't (there are times when it is - see below).
Binary distros like Ubuntu and Fedora absolutely require this. These
distros do not know what hardware you have and what drivers you
require, so they supply drivers for everything. But Ubuntu cannot
possibly compile into the kernel every possible driver you might need
to boot as the list would be huge (every known floppy, CD, USB, every
known MFM, IDE, SATA, SCSI, netboot, Fibre and more driver for a
start), so what they do instead is probe the hardware at boot time,
find out what you have, and load the driver modules you DO need.

This is the problem. The kernel wants to load disk drivers so that it
can access the disk and continue booting. Where are the drivers? Well,
they are on the disk. Oops, circular problem.

The difficulty is not finding and loading drivers, it's how do you get
the disk driver off the disk before you have the disk driver in
memory? (think chicken and egg here).

An initramfs solves this nicely. Grub shoved a disk image into memory
when it booted. The kernel knows how to access it's memory it doesn't
need a driver for that. And now the files containing the needed
drivers are on a virtual disk *in memory*. The kernel loads them, and
can now access the real physical disks.

Lots more complicated stuff then happens, like getting rid of the
virtual filesystem from the initramfs and mounting the real filesystem
from disk at /, but that's beyond the scope of this mail.

Gentoo mostly doesn't need any of this because you do know your
hardware and can just compile your disk drivers into the kernel - this
is the very thing that Ubuntu cannot do.

Some Gentoo users still need an initramfs, such as booting off drives
in a RAID configuration. They need the RAID drivers first to read the
disks so use an initramfs to fix this little problem exactly as Ubunut
fixes their problem.

Make sense?


Completely! Thanks a lot.

So I guess that my problem is to find an appropriate pair of driver and hard disk operating mode.

--
alan dot mckinnon at gmail dot com


Thanks again
Francisco

Reply via email to