1. BusyBox compilation tool, including Bin, sbin, USR, linuxrc.
2. Add related important directories: dev, etc, mnt, Proc, Sys, LIB, VAR, tmp.
3. Add related device files in dev.
Mknod-m 666 ttyS0 C 4 64
Mknod-m 666 NULL C 1 3
Mknod-m 666 Console C 5 1
Mtd0 C 90 0
MTD1 C 90 2
MTD2 C 90 4
Mtdblock0 B 31 0
Mtdblock1 B 31 1
Files related to Telnet:
PTMX C 5 2
mkdir dev/pts
4. etc Directory file: Inittab, Init.d/rcs, Fstab, profile, group, Shadow, passwd.
Please refer to the relevant documentation under ROOTFS.
5. Save the relevant content to Rootfs and generate the rootfs.img.gz (RAMDisk) from the following script.
#!/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 rootfs/*./mnt-a
Sync
sudo umount./mnt
Gzip ROOTFS.IMG-V9
6. Download to memory via Uboot and configure Bootargs.
Take at91sam9260 as an example:
TFTP 0x21100000 rootfs.img.gz
setenv Bootargs mem=64m console=ttys0,115200 initrd=0x21100000,0x800000 root=/dev/ram0 rw init=/linuxrc
7. Boot to test the RAMDisk file system.
Simple File System Building RAMDisk