Home | Projects | Notes > Embedded Linux > Generating "initramfs" Using RFS

Generating "initramfs" Using RFS

 

What is initramfs?

 

Why is initramfs Necessary?

 

How to Store initramfs in RAM

There are two ways:

  1. Make initramfs built-in to the Linux kernel during the compilation, so when the Linux starts booting, it will place the initramfs in the RAM and mounts it as the initial root file system and continues.

  2. Load the initramfs from some other sources into RAM of your board and tell the Linux kernel about it (i.e., at which RAM address the initramfs is present) using the "kernel boot arguments".

 

How to Generate the initramfs

  1. Download and extract the sample root file system which is taken from TI software SDK.

    am335x_tiny_filesystem is used here.

  2. cd into the extracted directory and run the following 2 commands on terminal:

    L1: Generating a cpio archive

    L2: Generating a gz archive

    Check if you see initramfs.gz at the end of these steps.

  3. Install mkImage command.

    This will install all the U-boot related tools along with the mkImage utility.

  4. Make the initramfs U-boot friendly by attaching the U-boot header with the load address and other info.

    Great! Now you have the initramfs file which includes the U-boot header which can be used as RAM based file system when required.

 

 

References

Nayak, K. (2022). Embedded Linux Step by Step Using Beaglebone Black [Video file]. Retrieved from https://www.udemy.com/course/embedded-linux-step-by-step-using-beaglebone/