1 |
Is this an initrd or initramfs (aka, cpio.gz) image? |
2 |
|
3 |
If it is initrd, you should have a /linuxrc script to initialize the |
4 |
system. For grub, you will need: |
5 |
|
6 |
kernel /vmlinuz root=/dev/ram0 init=/linuxrc |
7 |
initrd=/rootfs.gz |
8 |
|
9 |
Then your linuxrc script must *not* exit. It will probably need to call |
10 |
/sbin/init with something like: |
11 |
|
12 |
exec /sbin/init $@ |
13 |
|
14 |
In your case, /linuxrc probably doesn't need to do much of anything else. |
15 |
|
16 |
|
17 |
If it is initrams, then you just need to create a /init script and place |
18 |
the same "exec /sbin/init..." inside it. You do not need the init= |
19 |
option for the kernel in the grub configuration. |
20 |
|
21 |
For some more info, take a look at |
22 |
/usr/src/linux/Documentation/early-userspace/README |
23 |
|
24 |
HTH |
25 |
|
26 |
-Richard |
27 |
|
28 |
Ognjen Bezanov wrote: |
29 |
|
30 |
>Hi all, |
31 |
> |
32 |
>Im building an x86 embedded distro using gentoo. Now i have been rather |
33 |
>successful. I have built the whole system and it works, while only |
34 |
>taking up 9mb (when gzipped). |
35 |
> |
36 |
>Now my question is how to get linux to load the gzipped image file into |
37 |
>a ramdisk and use it as a root filesystem. |
38 |
> |
39 |
>Running the system directly from the CF card works great, but when |
40 |
>trying to get it to run it in ram it fails |
41 |
>with "kernel panic: VFS: Unable to mount root fs on unknown-block(1,0)". |
42 |
> |
43 |
>My attempt at running the system from ram is as follows: |
44 |
> |
45 |
>(grub config file): |
46 |
> |
47 |
>kernel /vmlinuz initrd=/rootfs.gz root=/dev/ram0 |
48 |
> |
49 |
>the rootfs.gz file is ~10Mb, and when uncompressed is an 100mb image |
50 |
>(most of the image is free space to |
51 |
>allow for future additions, this is a test bed). |
52 |
> |
53 |
> |
54 |
>Now I presume this is probably what is incorrect, in which case can |
55 |
>anyone help me regarding how to use |
56 |
>ramdisks as root devices. (googling about tells me that the initrd image |
57 |
>is not the root image, but rather |
58 |
>a pre-root mounting fs to prepare the system for booting). |
59 |
> |
60 |
>P.S Please CC me as this mailinglist doesnt play nice with my email |
61 |
>account. thanks! |
62 |
> |
63 |
> |
64 |
> |
65 |
-- |
66 |
gentoo-user@g.o mailing list |