Using BuildRoot to compile the file system

Source: Internet
Author: User

Using BuildRoot to compile the file system
2015-1-9


Using BuildRoot to make the file system is very convenient, the compiled file system is directly available, without adding scripts and other troublesome work, a lot of libraries and apps can
Add directly to the file system, such as commonly used udhcpc,tftp. In this paper, we take ZYNQ 7010 as an example to make a RAMDisk file system, which is developed in Z-turn
Run on board.


1. Execute make arch=arm menuconfig in the BuildRoot directory
Target options configuration, which is configured according to the CPU's manual



2. Toolchain settings, this does not use the BuildRoot compiled GCC, using the external GCC to compile the file system



Main note External Toolchain kernel headers series (3.0.x) This option is set, select the kernel version number of the compilation tool, file
Sourcery_codebench_lite_for_xilinx_gnu_linux/arm-xilinx-linux-gnueabi/libc/usr/include/linux/version.h
Save the version number (each compilation tool has this file), is a decimal, convert it to 16 binary can be seen in the version number, as my version.h is so
#define Linux_version_code 196609
#define Kernel_version (A,b,c) (((a) <<) + ((b) << 8) + (c))
Version 196609 of the 16 is 0x30001, the version number is 3.00.01, is 3.0.1, so here to choose 3.0.x


3. Settings for System configration


/dev Management Select Mdev to automatically create a device node in the/dev directory when it is started.
This feature also requires the kernel to be mated, and the kernel needs to be configured:
Device drivers->generic Driver Options: Select the following two
[*] Maintain a DEVTMPFS filesystem to mount At/dev
[*] AutoMount Devtmpfs At/dev, after the kernel mounted the Rootfs


The configuration of the console is also under System configration
[*] Run a Getty (Login prompt) after boot
Getty Options--->
(ttyPS0) TTY Port--Configure the serial number and rate here.
BaudRate (115200)--->
(VT100) Term environment variable
() Other options to pass to Getty



4. Additional Configuration Instructions
As long as these 3 items are configured, the compiled equivalent of a minimal file system, if you need to add other apps, you can
Target packages is configured inside, other options can be used without moving.


5. Compiling
Enter make, if the app is compiled for the first time, it will be downloaded automatically from the Internet to the DL directory, and the next compilation will not be downloaded.
Compiled file system in Output/image/rootfs.tar, use this file to make RAMDisk


6. Making RAMDisk
To make RAMDisk requires GENEXT2FS, the tool can be compiled with BuildRoot:
Host Utilities
[*] Host GENEXT2FS selected this, compiled genext2fs in output/build/host-genext2fs-1.4.1 directory


To the Output/image directory, unzip the file system to the Rootfs directory
[Email protected]:images$ mkdir Rootfs
[Email protected]:images$ sudo tar-xvf rootfs.tar-c rootfs


Generate RAMDisk File
[Email protected]:images$ sudo./genext2fs-b 8192-d rootfs Ramdisk.image
[Email protected]:images$ ls
GENEXT2FS ramdisk.image Rootfs Rootfs.tar


Compress ramdisk.image with gzip, generate ramdisk.image.gz
[Email protected]:images$ gzip-9 ramdisk.image
[Email protected]:images$ ls
GENEXT2FS ramdisk.image.gz Rootfs Rootfs.tar

Add a file header with Mkimage to generate a new uramdisk.image.gz for u-boot use
[Email protected]:images$ mkimage-a arm-t ramdisk-c gzip-n ramdisk-d ramdisk.image.gz uramdisk.image.gz
Image Name:ramdisk
CREATED:FRI Jan 9 18:07:48 2015
Image type:arm Linux RAMDisk Image (gzip compressed)
Data size:2376529 Bytes = 2320.83 KB = 2.27 MB
Load address:00000000
Entry point:00000000


Copy uramdisk.image.gz to SD card, boot from SD card, set kernel parameter to mount RAMDisk file system.

Using BuildRoot to compile the file system

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.