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 |
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. |
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. |
All times are GMT -5. The time now is 04:05 PM. |