Compile openwrt in Centos7

Source: Internet
Author: User

Compile openwrt in Centos7
1. download the latest openwrt source code

git clone https://github.com/openwrt/openwrt.git
2. Download feeds
Run $./scripts/feeds update-a $./scripts/feeds install-.
3. Configure the environment
Make defconfig check required dependencies $ sudo yum-y install gcc binutils patch bzip2 flex bison make autoconf gettext texinfo unzip sharutils libncurses5-dev ncurses-term zlib1g-dev wget perl-Thread-Queue openssl-devel zlib- static ncurses-devel gcc-c ++ $ make prereq $ make menuconfig

You can configure options in the text dialog box. The most important configuration items are:

Target system (Target system type)

Package selection)

Build system settings (compile system settings)

Kernel modules (Kernel module)

[*] Indicates that the package is selected for compilation and installed in firmware;

[M] indicates that the software package is selected for compilation but not installed in firmware.

When you exit Menuconfig, the system prompts whether to save the configuration.

4. Compile
  • Generally, use a simple command:

    $ make
  • To speed up a multi-core processor system (for example, a 3-core processor ):

    $ make –j 3
  • Compile in the background and use idle I/O resources and CPU performance (for example, using a dual-core processor)

    $ onice -c 3 nice -n 20 make -j 2
  • Compile a separate software package (for example, in the cups Software Package ):

    $ make package/cups/compile V=99
  • If you need to analyze the compilation error information for special reasons:

    $ make V=99 2>&1 |tee build.log |grep -i error

    Note: Save all compiled output information in build. log and print the error information on the screen.

  • An Application of Complex commands

    $ ionice -c 3 nice -n 20 make -j 2 V=99 CONFIG_DEBUG_SECTION_MISMATCH=y 2>&1 |tee build.log |egrep -i '(warn|error)'

    Note: Save all compiled output information in build. log, and print the error and warning information on the screen. The compilation process uses a dual-core CPU, occupying background resources.

5. Image Generation location

The newly generated image is stored in the new bin directory by default.

$ ls bin/*
6. Cleanup
$ make clean 

In addition to clearing the generated directory, you also want to clear the cross-compilation tool (and tool chain directory)

$ make dirclean

Clear all related items, including downloaded software packages, configuration files, and feed content:

$ make distclean
7. Install openwrt

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.