public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-user] Help with ramdisk
@ 2005-08-17 16:51 Ognjen Bezanov
  2005-08-17 17:48 ` Matthew Cline
  2005-08-18  1:20 ` Richard Fish
  0 siblings, 2 replies; 5+ messages in thread
From: Ognjen Bezanov @ 2005-08-17 16:51 UTC (permalink / raw
  To: gentoo-user

Hi all,

Im building an x86 embedded distro using gentoo. Now i have been rather
successful. I have built the whole system and it works, while only
taking up 9mb (when gzipped).

Now my question is how to get linux to load the gzipped image file into
a ramdisk and use it as a root filesystem.

Running the system directly from the CF card works great, but when
trying to get it to run it in ram it fails
with "kernel panic: VFS: Unable to mount root fs on unknown-block(1,0)".

My attempt at running the system from ram is as follows:

(grub config file):

kernel /vmlinuz    initrd=/rootfs.gz   root=/dev/ram0

the rootfs.gz file is ~10Mb, and when uncompressed is an 100mb image
(most of the image is free space to
allow for future additions, this is a test bed).


Now I presume this is probably what is incorrect, in which case can
anyone help me regarding how to use
ramdisks as root devices. (googling about tells me that the initrd image
is not the root image, but rather
a pre-root mounting fs to prepare the system for booting).

P.S Please CC me as this mailinglist doesnt play nice with my email
account. thanks!

-- 
gentoo-user@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [gentoo-user] Help with ramdisk
  2005-08-17 16:51 [gentoo-user] Help with ramdisk Ognjen Bezanov
@ 2005-08-17 17:48 ` Matthew Cline
  2005-08-18  1:20 ` Richard Fish
  1 sibling, 0 replies; 5+ messages in thread
From: Matthew Cline @ 2005-08-17 17:48 UTC (permalink / raw
  To: gentoo-user

On 8/17/05, Ognjen Bezanov <ognjen@mailshack.com> wrote:
> Hi all,
> 
> Im building an x86 embedded distro using gentoo. Now i have been rather
> successful. I have built the whole system and it works, while only
> taking up 9mb (when gzipped).
> 
> Now my question is how to get linux to load the gzipped image file into
> a ramdisk and use it as a root filesystem.
> 
> Running the system directly from the CF card works great, but when
> trying to get it to run it in ram it fails
> with "kernel panic: VFS: Unable to mount root fs on unknown-block(1,0)".
> 
> My attempt at running the system from ram is as follows:
> 
> (grub config file):
> 
> kernel /vmlinuz    initrd=/rootfs.gz   root=/dev/ram0
> 
> the rootfs.gz file is ~10Mb, and when uncompressed is an 100mb image
> (most of the image is free space to
> allow for future additions, this is a test bed).
> 
> 
> Now I presume this is probably what is incorrect, in which case can
> anyone help me regarding how to use
> ramdisks as root devices. (googling about tells me that the initrd image
> is not the root image, but rather
> a pre-root mounting fs to prepare the system for booting).
>

I'm not in front of my linux box right now, but try this for a grub config:

kernel /vmlinuz root=/rootfs.gz


HTH, 

Matt

-- 
gentoo-user@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [gentoo-user] Help with ramdisk
  2005-08-17 16:51 [gentoo-user] Help with ramdisk Ognjen Bezanov
  2005-08-17 17:48 ` Matthew Cline
@ 2005-08-18  1:20 ` Richard Fish
  2005-08-18 20:41   ` Ognjen Bezanov
  1 sibling, 1 reply; 5+ messages in thread
From: Richard Fish @ 2005-08-18  1:20 UTC (permalink / raw
  To: gentoo-user; +Cc: ognjen

Is this an initrd or initramfs (aka, cpio.gz) image?

If it is initrd, you should have a /linuxrc script to initialize the 
system.  For grub, you will need:

	kernel /vmlinuz root=/dev/ram0 init=/linuxrc
	initrd=/rootfs.gz

Then your linuxrc script must *not* exit.  It will probably need to call 
/sbin/init with something like:

    exec /sbin/init $@

In your case, /linuxrc probably doesn't need to do much of anything else.


If it is initrams, then you just need to create a /init script and place 
the same "exec /sbin/init..." inside it.  You do not need the init= 
option for the kernel in the grub configuration.

For some more info, take a look at 
/usr/src/linux/Documentation/early-userspace/README

HTH

-Richard

Ognjen Bezanov wrote:

>Hi all,
>
>Im building an x86 embedded distro using gentoo. Now i have been rather
>successful. I have built the whole system and it works, while only
>taking up 9mb (when gzipped).
>
>Now my question is how to get linux to load the gzipped image file into
>a ramdisk and use it as a root filesystem.
>
>Running the system directly from the CF card works great, but when
>trying to get it to run it in ram it fails
>with "kernel panic: VFS: Unable to mount root fs on unknown-block(1,0)".
>
>My attempt at running the system from ram is as follows:
>
>(grub config file):
>
>kernel /vmlinuz    initrd=/rootfs.gz   root=/dev/ram0
>
>the rootfs.gz file is ~10Mb, and when uncompressed is an 100mb image
>(most of the image is free space to
>allow for future additions, this is a test bed).
>
>
>Now I presume this is probably what is incorrect, in which case can
>anyone help me regarding how to use
>ramdisks as root devices. (googling about tells me that the initrd image
>is not the root image, but rather
>a pre-root mounting fs to prepare the system for booting).
>
>P.S Please CC me as this mailinglist doesnt play nice with my email
>account. thanks!
>
>  
>
-- 
gentoo-user@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [gentoo-user] Help with ramdisk
  2005-08-18  1:20 ` Richard Fish
@ 2005-08-18 20:41   ` Ognjen Bezanov
  2005-08-19 15:40     ` Richard Fish
  0 siblings, 1 reply; 5+ messages in thread
From: Ognjen Bezanov @ 2005-08-18 20:41 UTC (permalink / raw
  To: gentoo-user

Richard Fish wrote:

> Is this an initrd or initramfs (aka, cpio.gz) image?
>
> If it is initrd, you should have a /linuxrc script to initialize the
> system.  For grub, you will need:
>
>     kernel /vmlinuz root=/dev/ram0 init=/linuxrc
>     initrd=/rootfs.gz
>
> Then your linuxrc script must *not* exit.  It will probably need to
> call /sbin/init with something like:
>
>    exec /sbin/init $@
>
> In your case, /linuxrc probably doesn't need to do much of anything else.
>
>
> If it is initrams, then you just need to create a /init script and
> place the same "exec /sbin/init..." inside it.  You do not need the
> init= option for the kernel in the grub configuration.
>
> For some more info, take a look at
> /usr/src/linux/Documentation/early-userspace/README
>
> HTH
>
> -Richard
>
> Ognjen Bezanov wrote:
>
>> Hi all,
>>
>> Im building an x86 embedded distro using gentoo. Now i have been rather
>> successful. I have built the whole system and it works, while only
>> taking up 9mb (when gzipped).
>>
>> Now my question is how to get linux to load the gzipped image file into
>> a ramdisk and use it as a root filesystem.
>>
>> Running the system directly from the CF card works great, but when
>> trying to get it to run it in ram it fails
>> with "kernel panic: VFS: Unable to mount root fs on unknown-block(1,0)".
>>
>> My attempt at running the system from ram is as follows:
>>
>> (grub config file):
>>
>> kernel /vmlinuz    initrd=/rootfs.gz   root=/dev/ram0
>>
>> the rootfs.gz file is ~10Mb, and when uncompressed is an 100mb image
>> (most of the image is free space to
>> allow for future additions, this is a test bed).
>>
>>
>> Now I presume this is probably what is incorrect, in which case can
>> anyone help me regarding how to use
>> ramdisks as root devices. (googling about tells me that the initrd image
>> is not the root image, but rather
>> a pre-root mounting fs to prepare the system for booting).
>>
>> P.S Please CC me as this mailinglist doesnt play nice with my email
>> account. thanks!
>>
>>  
>>
>
Thanks, that was helpful. Now the system finds the root fs and loads it.
But the system still wont boot. It tells me "RAMDISK: Compressed image
found at block 0"  as a final kernel message, then just sits there (for
ages).  At lease its closer to functioning then before, but there are a
few bugs to iron out.

What could be wrong?

Thanks in advance

-- 
gentoo-user@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [gentoo-user] Help with ramdisk
  2005-08-18 20:41   ` Ognjen Bezanov
@ 2005-08-19 15:40     ` Richard Fish
  0 siblings, 0 replies; 5+ messages in thread
From: Richard Fish @ 2005-08-19 15:40 UTC (permalink / raw
  To: gentoo-user

Ognjen Bezanov wrote:

>
>Thanks, that was helpful. Now the system finds the root fs and loads it.
>But the system still wont boot. It tells me "RAMDISK: Compressed image
>found at block 0"  as a final kernel message, then just sits there (for
>ages).  At lease its closer to functioning then before, but there are a
>few bugs to iron out.
>
>What could be wrong?
>
>  
>

Check that your /linuxrc script inside the initrd has exec permissions.  
Also, you might want to place an:

echo "Hello from linuxrc"

message near the top of the script to see if the kernel is executing it.

I assume that the initrd image has /dev/console, /dev/null, and /dev/zero?

-Richard

-- 
gentoo-user@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2005-08-19 15:51 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-08-17 16:51 [gentoo-user] Help with ramdisk Ognjen Bezanov
2005-08-17 17:48 ` Matthew Cline
2005-08-18  1:20 ` Richard Fish
2005-08-18 20:41   ` Ognjen Bezanov
2005-08-19 15:40     ` Richard Fish

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox