FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Redhat > Fedora User

 
 
LinkBack Thread Tools
 
Old 11-30-2007, 12:50 PM
"Tom Horsley"
 
Default during fedora boot, what picks up the initrd.img from /boot?

> 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?

When it says "RedHat Nash" near the beginning of the boot then
goes away for a half hour (OK, maybe not that long :-) it is
processing the init script from the initrd.img file (nash is
the name for the shell-like program that interprets the script).

--
fedora-list mailing list
fedora-list@redhat.com
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
 
Old 11-30-2007, 01:01 PM
"Robert P. J. Day"
 
Default during fedora boot, what picks up the initrd.img from /boot?

On Fri, 30 Nov 2007, Tom Horsley 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?
>
> When it says "RedHat Nash" near the beginning of the boot then goes
> away for a half hour (OK, maybe not that long :-) it is processing
> the init script from the initrd.img file (nash is the name for the
> shell-like program that interprets the script).

but what is the step that *takes* you to the kernel's corresponding
/boot/initrd.img file in the first place? that's what i'm trying to
figure out.

rday
================================================== ======================
Robert P. J. Day
Linux Consulting, Training and Annoying Kernel Pedantry
Waterloo, Ontario, CANADA

http://crashcourse.ca
================================================== ======================

--
fedora-list mailing list
fedora-list@redhat.com
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
 
Old 11-30-2007, 01:42 PM
"Mikkel L. Ellertson"
 
Default during fedora boot, what picks up the initrd.img from /boot?

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.
>
> rday
>
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.

Mikkel
--

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

--
fedora-list mailing list
fedora-list@redhat.com
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
 
Old 11-30-2007, 02:33 PM
"Robert P. J. Day"
 
Default during fedora boot, what picks up the initrd.img from /boot?

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.

================================================== ======================
Robert P. J. Day
Linux Consulting, Training and Annoying Kernel Pedantry
Waterloo, Ontario, CANADA

http://crashcourse.ca
================================================== ======================

--
fedora-list mailing list
fedora-list@redhat.com
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
 
Old 11-30-2007, 03:20 PM
"Mikkel L. Ellertson"
 
Default 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!

--
fedora-list mailing list
fedora-list@redhat.com
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
 
Old 11-30-2007, 05:32 PM
Tony Nelson
 
Default during fedora boot, what picks up the initrd.img from /boot?

At 10:33 AM -0500 11/30/07, 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? ...
...

According to `info grub` 13.3.7 initrd, GRUB loads the image and sets the
"appropriate parameters in the Linux setup area in memory." I see the
initrd in the kernel docs "boot.txt".
--
__________________________________________________ __________________
TonyN.:' <mailto:tonynelson@georgeanelson.com>
' <http://www.georgeanelson.com/>

--
fedora-list mailing list
fedora-list@redhat.com
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
 
Old 11-30-2007, 08:56 PM
John Summerfield
 
Default during fedora boot, what picks up the initrd.img from /boot?

Robert P. J. Day wrote:

i'm sure i'm going to regret asking this only seconds after i hit

Probably, a little later than a few seconds:-)


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.



What interprets these?
title Scientific Linux SL (2.6.18-8.1.15.el5xen)
root (hd0,0)
kernel /xen.gz-2.6.18-8.1.15.el5
module /vmlinuz-2.6.18-8.1.15.el5xen ro
root=/dev/VolGroup00/LogVol00

module /initrd-2.6.18-8.1.15.el5xen.img
savedefault


The bootloader loads it, of course. That's how multiboot works.

For the grubby details, you'll need to read the kernel and/or bootloads
source.


--

Cheers
John

-- spambait
1aaaaaaa@coco.merseine.nu Z1aaaaaaa@coco.merseine.nu
-- Advice
http://webfoot.com/advice/email.top.php
http://www.catb.org/~esr/faqs/smart-questions.html
http://support.microsoft.com/kb/555375

You cannot reply off-list:-)

--
fedora-list mailing list
fedora-list@redhat.com
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
 
Old 12-02-2007, 02:26 PM
"Robert P. J. Day"
 
Default during fedora boot, what picks up the initrd.img from /boot?

On Fri, 30 Nov 2007, Mikkel L. Ellertson wrote:

> 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.

i've learned the hard way not to trust the in-kernel documentation,
but i did eventually track down what i was after.

for interested parties, in the kernel source tree,
include/asm-x86/bootparam.h:

/* The so-called "zeropage" */
struct boot_params {
...
struct setup_header hdr; /* setup header */
...
}

and at the top of that very same file, we have:

struct setup_header {
...
__u32 ramdisk_image;
__u32 ramdisk_size;
...
}

in the 32-bit case, that info is extracted during system boot in
arch/x86/kernel/setup_32.c thusly:

#ifdef CONFIG_BLK_DEV_INITRD
if (boot_params.hdr.type_of_loader && boot_params.hdr.ramdisk_image) {
unsigned long ramdisk_image = boot_params.hdr.ramdisk_image;
unsigned long ramdisk_size = boot_params.hdr.ramdisk_size;
unsigned long ramdisk_end = ramdisk_image + ramdisk_size;
unsigned long end_of_lowmem = max_low_pfn << PAGE_SHIFT;
...

etc, etc.

so i'm good.

rday
--
================================================== ======================
Robert P. J. Day
Linux Consulting, Training and Annoying Kernel Pedantry
Waterloo, Ontario, CANADA

http://crashcourse.ca
================================================== ======================

--
fedora-list mailing list
fedora-list@redhat.com
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
 
Old 12-02-2007, 07:48 PM
John Summerfield
 
Default during fedora boot, what picks up the initrd.img from /boot?

Robert P. J. Day wrote:



...

etc, etc.

so i'm good.



You are. You should set up a consultancy.

--
fedora-list mailing list
fedora-list@redhat.com
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
 
Old 12-02-2007, 09:31 PM
Richard England
 
Default during fedora boot, what picks up the initrd.img from /boot?

John Summerfield wrote:

Robert P. J. Day wrote:



...

etc, etc.

so i'm good.



You are. You should set up a consultancy.


... :-) Did you read Robert's signature? :-)


I quote:

Robert P. J. Day
Linux Consulting, Training and Annoying Kernel Pedantry


Or were you just being snarky? :-)



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

Thread Tools




All times are GMT. The time now is 09:17 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org