LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   load real filesystem from initramfs (https://www.linuxquestions.org/questions/linux-newbie-8/load-real-filesystem-from-initramfs-4175502017/)

david_8274 04-16-2014 11:49 PM

load real filesystem from initramfs
 
Hi,

I am working on an embedded linux system.
I am using kernel 2.6. Based on what I have read, the 2.6 kernel always use initramfs. My question is, what modification I need to make and where should I make them so initramfs will load and pass control to a real filesystem?(the real filesystem is in one of the partitions in and external NAND flash)

Thanks,
Wei Xu

Emerson 04-17-2014 05:26 PM

Are you talking about initramfs or initrd?

david_8274 04-17-2014 06:02 PM

@Emerson,

I am using kernel 2.6 so it will be initramfs.

Thanks,
Wei

syg00 04-17-2014 07:57 PM

An initramfs is always created, but you don't have to use it - by default it's empty. If you can build all the support you need into the kernel, just pretend the initramfs doesn't exist.

If you need to wait for the flash drive to come ready before proceeding, you might need to build the archive - have a look in ../Documentation/filesystems/ramfs-rootfs-initramfs.txt in your kernel source tree. It has good explanation, aad some extra references at the bottom.

rknichols 04-18-2014 12:34 AM

The magic of switching from an initramfs to a new root filesystem is done by the pivot_root command and system call. See "man 8 pivot_root" and "man 2 pivot_root" for details.


All times are GMT -5. The time now is 01:44 PM.