1

An embedded Linux device I am working with has the following kernel parameter:

root=/dev/ram0

Additionally, the kernel image is bundled together with an initrd and device tree to make a flattened image tree, or FIT image.

When fully booted the device does not have persistent storage. That is, anything written to the file system is completely volatile. Considering the root= parameter passed to the kernel, this is not surprising.

My questions is: How does this work?

  • I do know that Uboot copies the kernel into ram and executes it with a bootm command, but where do the filesystem files come from? Are they contained within the initrd? My understanding of an initrd is that it is a temporary construct. If so, it would be an offset into FIT image blob. So, how is just passing root=/dev/ram0 sufficient for the kernel to know where its file system is?

  • Does the kernel perform introspection and read the FIT image's header to determine placement of constituent components?

  • How are file system changes supported inside a FIT image considering it will be packed together with both the kernel and device tree blob?

0

I do know that Uboot copies the kernel into ram and executes it with a bootm command, but where do the filesystem files come from?

Before you can boot your fitImage you have to load it into RAM. After this you can start it with bootm. Inside the fit image you can define the Load Address and Entry Point for the kernel for example.

Are they contained within the initrd? My understanding of an initrd is that it is a temporary construct. If so, it would be an offset into FIT image blob. So, how is just passing root=/dev/ram0 sufficient for the kernel to know where its file system is?

It depends on your system what the definition of filesystem is. There are a few systems running completely from a RAMDISK and just storing configuration into any kind of NVRAM or Flash.

Other systems use the RAMDisk to check where to find the root filesystem. For example to scan USB-Bus, SATA or SD-Cards. When the root filesystem is mounted the boot process continuous with this partition. Due to the fact that init needs to run from PID 1. Some tricks are needed.

Does the kernel perform introspection and read the FIT image's header to determine placement of constituent components?

No the fitImage is parsed by u-boot. How the u-boot passes the addresses where the DTB and RAMDISK is located at depends on the used Platform AFAIK.

How are file system changes supported inside a FIT image considering it will be packed together with both the kernel and device tree blob?

When changes to the filesystems are needed on a regular basis you should consider to use something more flexible. But this depends on the hardware you are using. SD-Card, NAND, NOR or spinning disks.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.