Re: during fedora boot, what picks up the initrd.img from /boot?



Robert P. J. Day wrote:
On Fri, 30 Nov 2007, Mikkel L. Ellertson wrote:

Robert P. J. Day wrote:
i'm sure i'm going to regret asking this only seconds after i
hit ENTER, but at what point during the boot process does the
kernel's corresponding /boot/initrd.img file kick in and get used?

i'm following along reading the logic of initramfs and early
userspace, and can see where a compressed cpio archive can be
incorporated into the kernel image itself. fair enough.

but how does the /boot/initrd.img (which is itself a compressed
cpio image) get processed during boot? it's certainly not passed
as an argument to the kernel as i can see via /proc/cmdline. so
how does it affect the boot sequence? thanks.

I believe that Grub loads the image, and then passes the location to
the kernel at boot. Support for the file system of initrd.img has to
be built into the kernel.

but *how* does grub pass that info? that's the question here. on my
f8 system, the contents of /proc/cmdline is simply:

ro root=/dev/f8/root rhgb quiet

so how exactly is the kernel notified about the location of that
external initrd.img file? i'm guessing i might just start reading
through the early kernel code to see where it figures that out.

rday

p.s. is my question making any sense? maybe i'm just phrasing it
badly.

I don't believe the kernel is ever told the location of the file on
the disk. The initrd option tells grub the file to load. Grub then
loads the file into system memory. I am not sure, but I believe the
address that Grub loaded it to in memory is passed in a register.
But it may be in a fixed place in the block of data passed to the
kernel, along with the options in the kernel line. I suspect that
this is covered in the Grub info page if you want to know exactly
how it is managed. I have never cared enough about the exact method
to dig into it. It is also possible to boot a kernel without using
an initrd file if you build all the drivers needed to access the
root file system into the kernel.

You may also want to take a look at the initrd.txt file in the
kernel documentation tree.

Mikkel
--

Do not meddle in the affairs of dragons,
for thou art crunchy and taste good with Ketchup!

Attachment: signature.asc
Description: OpenPGP digital signature

--
fedora-list mailing list
fedora-list@xxxxxxxxxx
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list

Relevant Pages

  • Re: Naming harddisks (Linux)
    ... But I also see that for an USB drive it uses /dev/sdas the ... Does GRUB recognize SCSI drives? ... The first step in understanding the boot process is to ... The bootloader's job is to load the OSs kernel. ...
    (comp.os.linux.misc)
  • Re: changing default os in grub
    ... > I've just installed a 2.6.8 kernel in Sarge and was ... > hoping the adjustment to grub would return Sarge to ... # Put static boot stanzas before and/or after AUTOMAGIC KERNEL LIST ... # This entry automatically added by the Debian installer for an existing ...
    (Debian-User)
  • Re: booting linux using a floppy
    ... which kernel of the list to boot from. ... Note that this will at this point remove your ability to boot into windows. ... I think I recall that you said the grub loader... ... and grub will search for a partition containing grub's stage2 file ...
    (comp.os.linux.misc)
  • Re: Debian bootable on external USB-harddisk
    ... > They are all on the external harddisk since I want to boot from this ... >> fail if you have placed the kernel and initrd on the external ... >> available from BIOS. ... >> grub stage one on the external disk. ...
    (comp.os.linux.setup)
  • Re: Installing grub for a different computer
    ... > root ... > menu - I guess there's only one kernel present). ... Boot with the floppy ... After entering the commands above for root, kernel and initrd grub is ...
    (Fedora)