RAMDisk File System Production

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.