LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 08-10-2012, 11:05 AM   #1
heavymetalhero
LQ Newbie
 
Registered: Aug 2012
Posts: 2

Rep: Reputation: Disabled
questions on rootfs mouting and on initramfs functionning details


Hello all,
I need some information concerning rootfs and initramfs.
I have read a lot of stuff on this but some questions remain.

I need to understand how rootfs is mounted with the initramfs procedure.

Things I know: __initramfs_start symbol is defined in vmlinux.lds.S (in the .init section)
During boot, "populate_rootfs()" calls "unpack_to_roofs()" and after "decompress_method()" is called to check the magic number of the compression used to pack initramfs_data.cpio.<comp>. This magic number is expected at __initramfs_start adress. If a valid magic number is found, the name of the compressor is returned to "unpack_to_roofs()". Then the un<comp> routine (example: ungzip, unlzma ..) is called.

Are these things correct?

if so, the initramfs_data.cpio archive should already been in memory (at __initramfs_start) during boot.
So how to copy initramfs.cpio archive to __initramfs_start?

Where is the initramfs_data.cpio.<comp> placed in memory after it is decompressed.

Thanks in advance for your help.
Regards
 
Old 08-11-2012, 04:08 AM   #2
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,140

Rep: Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123
Read the ramfs-rootfs-initramfs.txt file in ../Documentation/filesystems/

There are (nowadays) two distinct initramfs potentially present during the boot process - you are looking at the code for the newer resident one.
 
Old 08-14-2012, 05:02 AM   #3
heavymetalhero
LQ Newbie
 
Registered: Aug 2012
Posts: 2

Original Poster
Rep: Reputation: Disabled
Thanks for your answer.

Indeed, I have already read this document.

As I explained, I am confused concerning the initramfs procedure.
I really need to understand how the initramfs cpio archive is provided to the kernel.

__initramfs_start is defined in the vmlinux.lds.S: initramfs_data.cpio.gz should be expanded to this point.
But how and when?
During kernel build, when initramfs_data.cpio.gz is created?
During boot? If so, how and where it is done?

Thanks in advance.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Initramfs with decrypting a luks root partition questions dman777 Linux - Software 3 05-18-2011 09:58 AM
[SOLVED] Creating initramfs as inbuilt to the kernel and as permanent rootfs ramalingampc2008 Linux - Software 5 11-17-2010 11:42 PM
questions about "htop" details SaintDanBert Linux - Software 4 09-23-2010 11:03 AM
mouting cd seefrank Linux - Newbie 2 04-09-2002 12:38 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 10:51 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration