need some clarifications concerning rootf mounting

5 messages, 2 authors, 2012-08-20 · open the first message on its own page

need some clarifications concerning rootf mounting

From: stl <hidden>
Date: 2012-08-08 09:01:20

Hello all,
I need some explanations concerning the ways to mount rootf during boot.

I have read some documents (notably the very useful How to use initramfs by
Rob Landley)
and dug into the source code, but some doubts remain.

If I well understood, there is 2 differents procedures to mount the rootfs:
- using the old way: init ramdisk
- using the initramfs support (which appears to be really more efficient)

The fonction "populate_rootfs()" seems to be a crucial point of the
procedure:
it calls a first time "unpack_to_roofs()" with __initramfs_start and
__initramfs_size
as arguments, and if initrd_start is not NULL, calls one more time
"unpack_to_rootfs()"
with initrd_start and (initrd_end-initrd_start) as arguments.

What's really happening during the first unpack_to_rootfs() ?
Does the kernel unpack the iniramfs.cpio (created either by supplying a
valid cpio one
or a config file through CONFIG_INITRAMFS_SOURCE) from __initramfs_start
(defined in vmlinux.lds.S)?

If I aim to use initramfs support, should I do something with
initrd_start/end and CONFIG_BLK_DEV_RAM stuffs?

Thanks in advance for your help and clarifications.

Regards
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20120808/8d918576/attachment.html 

need some clarifications concerning rootf mounting

From: stl <hidden>
Date: 2012-08-14 10:15:03

I have dug a little more, and if I well understand, the
initramfs_data.cpio.gz should be
expanded from __initramfs_start (defined in vmlinux.lds.S)

But when and how is it done?
And by who?
Architecture specific code? bootloader, or setup_arch() memory
initialisation function?
Or the kernel itself and automatically during kernel build? Or during boot?

In my case, the initramfs_data.cpio.gz is not present at __initramfs_start.
When the kernel tries to find the compression magic number
("decompress_method() function),
it complains and panic with the following message:

kernel panic: junk in compressed archive

(I precise that I am porting Linux-2.6.37 to a new architecture)

Thanks in advance for your help and advices.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20120814/20bca118/attachment.html 

need some clarifications concerning rootf mounting

From: Rahul Bedarkar <hidden>
Date: 2012-08-14 10:44:19

On Tue, Aug 14, 2012 at 3:45 PM, stl [off-list ref] wrote:
I have dug a little more, and if I well understand, the
initramfs_data.cpio.gz should be
expanded from __initramfs_start (defined in vmlinux.lds.S)

But when and how is it done?
And by who?
Architecture specific code? bootloader, or setup_arch() memory
initialisation function?
Or the kernel itself and automatically during kernel build? Or during boot?

In my case, the initramfs_data.cpio.gz is not present at __initramfs_start.
When the kernel tries to find the compression magic number
("decompress_method() function),
it complains and panic with the following message:

kernel panic: junk in compressed archive
It is essential to have rootfs otherwise you will not able to compete
kernel boot process.
If you try to compile kernel without rootfs, it will give you error.
In your case, kernel found that initramfs_data.cpio.gz does not
contain anything. you might have did touch to initramfs_data.cpio.gz
to ignore error ?

Thanks,
Rahul B.
(I precise that I am porting Linux-2.6.37 to a new architecture)

Thanks in advance for your help and advices.

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies at kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

need some clarifications concerning rootf mounting

From: stl <hidden>
Date: 2012-08-16 09:31:19

Thanks for your answer.

Ok, here is what I have exactly done:

- compiled with my uClibc cross-compiler a simple hello world program.
- written a basic config file in linux-2.6.37/usr, creating a dev/console,
a /init from /usr/hello and some other dirs.
- edited the .config file with CONFIG_INITRAMFS_SOURCE =
......./usr/config_file and selected CONFIG_INITRAMFS_COMPRESSION_GZIP=y
- built the kernel
- launched vmlinux and received the "kernel panic: junk in compressed
archive" error message

In the source code, initrd_start ans initrd_end appears.
if i want to use initramfs support (and not initrd support), should I do
something special in "setup_arch()" in order to initialize these symbols?

thakns in advance
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20120816/1dbdc199/attachment-0001.html 

need some clarifications concerning rootf mounting

From: Rahul Bedarkar <hidden>
Date: 2012-08-20 08:02:09

You haven't build your root file system. I believe we give path to
root file system in CONFIG_INITRAMFS_SOURCE.
There are different ways to build root file system, like buildroot.
http://buildroot.uclibc.org/

-Rahul B.

On Thu, Aug 16, 2012 at 3:01 PM, stl [off-list ref] wrote:
Thanks for your answer.

Ok, here is what I have exactly done:

- compiled with my uClibc cross-compiler a simple hello world program.
- written a basic config file in linux-2.6.37/usr, creating a dev/console, a
/init from /usr/hello and some other dirs.
- edited the .config file with CONFIG_INITRAMFS_SOURCE =
......./usr/config_file and selected CONFIG_INITRAMFS_COMPRESSION_GZIP=y
- built the kernel
- launched vmlinux and received the "kernel panic: junk in compressed
archive" error message

In the source code, initrd_start ans initrd_end appears.
if i want to use initramfs support (and not initrd support), should I do
something special in "setup_arch()" in order to initialize these symbols?

thakns in advance
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help