Centos_7 OPENWRT Eclipse Environment Building and dr.com Development notes

Source: Internet
Author: User
Tags git clone

Recently embarked on the development of OpenWrt, so learning to do some of this preparation and the preparation of the following procedures. This paper is mainly divided into three parts:

One: Kernel compilation.

1,linux compilation environment and the preparation of source code

2, installation of common software (make Menuconfig)

3, OpenWrt porting of some software for Tp-link wr740n

4, Kernel compilation

II: OPENWRT Eclipse Build Environment

1,OPENWRT platform-dependent package installation

2,eclipse Configuration of the environment

3, Remote Debugging settings

Three: Writing and porting of dr.com movement on OPENWRT

1, the analysis of the source code

2, the source of the transplant

3, the realization of the function

4, the operation and installation of the program

Four, reference

A: 1, build environment and the preparation of the source code

The compilation of the kernel needs to be done in a Linux environment, so the system is pre-installed. Pre-installed dependency packages are required for CentOS.

Yum Install subversion binutils bzip2 gcc gcc-c++ gawk gettext flex ncurses-devel zlib-devel make patch unzip Perl-extutil S-makemaker  

Get the source code through GIT, the source address can be Google search for the version you need. Source code download from here https://downloads.openwrt.org/

git clone git://git.openwrt.org/14.07/openwrt.git

Enter the source directory and download the relevant package

CD openwrt./scripts/feeds update-a./scripts/feeds install-a

2, installation of common software (make Menuconfig)

The configuration of the Linux kernel is relatively user-friendly, and using make menuconfig greatly simplifies the operation.

Make Defconfigmake Prereqmake menuconfig

The choice of specific software can refer to here http://www.right.com.cn/forum/thread-83746-1-1.html, no longer more than the introduction. If you do not want to add any software, you can simply make the following changes:

Target Systme---> modified to its own platform CPU model

Target Profile---> modified to its own model, mine is Tp-link wr740n

Target Images---> SUASHFS--->

LuCI---> Collection---> LuCI

LuCI---> Applications--->luci-app-samba

When you are finished, exit save.

3, OpenWrt porting of some software for Tp-link wr740n

For the domestic model and the domestic model slightly different, so the original source of the port part of the need to make simple changes.

(1) Resolve the error in the LAN4 location of the WAN port. Locate the file mach-tl-wr741nd-v4.c,/target/linux/ar71xx/files/arch/mips/ath79/the code in the directory (your source directory) ath79_setup_ar933x_phy4_ Switch (true, true); Change to Ath79_setup_ar933x_phy4_switch (false, False), or delete it directly.

(2) solve the problem of the lamp position is not correct. LAN4 lights in the WAN location, only need to modify the macro definition of the above file section, the Tl_wr741ndv4_gpio_led_wan modified to 13, TL_WR741NDV4_GPIO_LED_LAN4 modified.

(3) Turn on the wifi switch, package/kernel/mac80211/files/lib/wifi/mac80211.sh see REMOVE This lines to enable WiFi, so you need to comment out the following line of code can be enabled WiFi is up.

4, Kernel compilation

Kernel compilation process requires networking, will download a large number of compiled dependency packages, some URLs will not download, you can download http://dl.zjuqsc.com/router/openwrt/dl/here to the source directory./DL directory.

Use this command to compile make-j5 v=99 2>&1 |tee build.log |grep-i error, the log will be in the current source directory, for the first compilation is best not to use the-j parameter, easy to error when errors are found. Kernel compilation takes about a few hours, depending on the machine and network environment.

II: 1,OPENWRT platform-dependent package installation

In order to achieve OpenWrt online debugging, OpenWrt end need to install some IPK package, you can download (https://downloads.openwrt.org/) according to their corresponding version to download the corresponding package, the package needs to download the following:

(1), dropbear or OpenSSH installed & connections can be established

(2), libstdcpp (optional for C + +)

(3), Openssh-sftp-server

(3), Gdbserver

(4), libthread-db

Download the package to the directory of the samba server that you copied to OpenWrt (build it up in advance), and then use the command opkg install your package. IPK If you need any package to download the installation, I have to say that the openwrt depends on the package is still quite good.

2,eclipse Configuration of the environment

The official description of the eclipse-related configuration, but the content is too old. To blog time the latest version of eclipse-cpp-luna-sr2-linux-gtk-x86_64.tar.gz, you can download the download software from here, to the appropriate directory. The installation was completed.

The latest version of Eclipse has integrated the capabilities of Crosss Compiler and Remote System Explorer.

New project Create a new project:menu→file→new C + + project, always next until here, add it as your CPU.

You can create a new built-in Hello World project to test whether your configuration is correct, and if correct, compile the result below.

23:58:57 * * * * Rebuild of configuration Debug for project Openwrt_test ****info:internal Builder are used for Buildmips-ope nwrt-linux-g++-o0-g3-wall-c-fmessage-length=0-o SRC/OPENWRT_TEST.O. /src/openwrt_test.cpp mips-openwrt-linux-g++-o openwrt_test src/openwrt_test.o23:58:59 Build Finished (took 2s.533ms)

3, Remote Debugging settings  

Reference:

Http://wiki.openwrt.org/doc/howto/buildroot.exigence

Centos_7 OPENWRT Eclipse Environment Building and dr.com Development notes

Related Article

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.