1. Ensure that the kernel supports RAMDisk boot.
2. Create the root file system (apply BusyBox or copy an existing file system).
3. Create a kernel image using script mkroot.sh: root.img.gz.
4. The uboot is downloaded root.img.gz to the card memory via TFTP.
5. After setting the startup parameters, boot is ready.
--------------------------------------------------------------------------
TFTP 0x21100000 rootfs.img.gz
setenv Bootargs mem=64m console=ttys0,115200 initrd=0x21100000,0x21fc74 root=/dev/ram0 rw init=/linuxrc
--------------------------------------------------------------------------
Configuring the Kernel
First extract the kernel to the working directory, then enter the kernel directory, execute the following statement.
#sudo su
#make Menuconfig (such as the user under Ubuntu cannot execute the command, execute the following command first, sudo apt-get install libncurses5-dev)
General setup-->[*] Initial RAM filesystem and RAM disk support
--[*]optimize for size
Device Drivers-->block Devices--><*>ram Block device Support
(4096) Default RAM disk Size (Kbytes)//If the RAMDisk you made earlier is 8192kb, write 8192
File System-<*> Second Extended FS Support//provides kernel-to-ext2 file systems
Exits the save configuration.
--------------------------------------------------------------------------
RAMDisk Making Scripts
#!/bin/sh
Umount./mnt
Test-e./mnt | | mkdir./mnt>/dev/null
DD If=/dev/zero of=rootfs.img bs=1024 count=8192
LOSETUP/DEV/LOOP1 rootfs.img
echo y | MKE2FS-M0 rootfs.img
sudo mount-o loop rootfs.img./mnt
echo "Create the Rootfs.img.gz"
sudo cp nfs/*./mnt-a
Sync
sudo umount./mnt
Gzip ROOTFS.IMG-V9
RAMDisk File System Production