) Preparation
There must be a ready-to-use file system, assuming the directory is/rootfs
The Linux kernel needs to support ext2 file system and ramdisk support (the corresponding FS options should be checked)
2) create a ramdisk image on the PC
(1) dd If =/dev/Zero of = ramdisk. img bs = 1 k count = 4096.
The created image is 4 MB and can be modified as needed.
(2) mkfs. ext2-M0 ramdisk. img
Format ramdisk. IMG to ext2
(3) Mount-o loop ramdisk. img/mnt/ramdisk/
Mount ramdisk. IMG to the/mnt/ramdisk directory
(4) CP-A/rootfs/mnt/ramdisk
Copy all your file systems to the/mnt/ramdisk directory.
(5) umount/mnt/ramdisk
Detach a ramdisk
The available ramdisk. IMG image is generated.
(6) gzip-V9 ramdisk. img
Compressed image. I have never attached a compressed image. It should be okay.
3) modify the bootargs of the Development Board and add initrd = 0x336600,4096000
Here 0x3100000 is the address for loading the ramfs file system, and 4096000 is the size
Restart the Development Board and load the ramfs file system normally.