OpenWrt Quick Start

 

OpenWrt (official website www.openwrt.org) is an embedded Linux distribution that is currently used on routers. It is a highly modular, highly automated embedded Linux system with a powerful extension.

Unlike many other distributions for routers (mainstream router firmware is DD-WRT, Tomato, OpenWrt), OpenWrt is a full-featured, easy-to-modify router operating system written from scratch .

 

1, OpenWrt advantages

By quickly building an application platform with OpenWrt, OpenWrt integrates from cross-compiler, Linux kernel, file system and even bootloader to form an SDK environment. Its more than 3,000 packages (the number is still increasing), from the toolchain (Toolchain) to the kernel (Linux Kernel), to the packages (Packages), to the root file system (Rootfs) system, making users A simple make command can be used to quickly and easily customize an embedded system with specific functions to create firmware, greatly reducing the process of embedded software development.
When you are familiar with the basic development process of these embedded Linux, you are no longer limited to MIPS CPU wireless routers. You can try to transplant embedded Linux on other processors or non-wireless router systems, customize your own application software, and build a Complete embedded product.

The success of OpenWrt is that it file system is writable. The developer does not need to recompile the system after each modification, and can install some installation packages with commands like the Linux system on the PC, without manual configuration. It is more like a small Linux computer system.

 

2, OpenWrt version development

The platforms supported by OpenWrt include: Broadcom’s SoC, ARM, PowerPC, MIPS 24K R2, x86. It appeared to in the software application LuCiwith WebifUI and all the update packages headed.





Serial number
version
Release date
Code




1
10.03.1
December 2011
Backfire


2
12.09
April 2013
Attitude Adjustment


3
14.07
October 2014
Barrier Breaker


4
15.05
September 2015
Chaos Calmer


5
15.05.1
March 2016
Chaos Calmer


6
18.06
July 2018
-


 

3, OpenWrt source code





Serial number
Directory and files
description




1
/config
Store the configuration file of the entire system


2
/docs
It contains an introduction to the source code of the entire host machine, and there is also a Makefile to generate docs for the target system. Use make -C docs/to generate documentation for the target system


3
/feeds
The default download for the download management package feedsis packages, management, luci, routing,telephony


4
/include
Many of OpenWrt Makefileare stored here, a file named *.mkthis file is Makefilein being include, similar to the library files These files define the compilation process


5
/package
Stores the applicable packages in the OpenWrt system, including for each packageMakefile


6
/scripts
Stored some scripts, using bash, Python, perl and other scripting languages . The feedsfiles used for third-party package management are also in this directory during the compilation process. The scripts used are also placed in this directory. in


7
/target
OpenWrt source code can be compiled binary files suitable for various platforms, each platform in this directory define firmwareand kernelbuild process


8
/toolchain
The packages that compile the cross-compilation chain are : binutils, gcc, , libcetc.


9
/tools
At compile time, the host needs to use some tools. The tools contain the commands to get and compile these tools . There are Makefilefiles in the package , and some include one in patcheach Makefile. $(eval $(call HostBuild))This indicates that the tool is compiled for use on the host. of


12
Config.in
As include/toplevel.mkyou can see, this is the make menuconfigassociated file


13
feeds.conf.default
You can configure the address to use when downloading some third-party packages.


10
Makefile
Execute the makecommand entry file in the top level directory


11
rules.mk
It defines the Makefilenumber of used variants and functons

14
LICENSE
Software license


15
README
Basic software description: describes the basic process and dependent files of the compiled software


After compiling the OpenWrt source, some new directories will appear:





Serial number
table of Contents
description




1
/build_dir/host
Compile the tool software used by the host in this folder


2
/build_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2
Compile the target files of the target platform here, including individual packages and kernel files.


3
/build_dir/toolchain-mipsel_24kec+dsp_gcc-4.8-linaro_uClibc-0.9.33.2
Compile in this folder cross compile tools


4
/bin
Save the compiled binary file including: complete bin file, all ipk files


5
/dl
A lot of software used in the compilation process just started downloading the source code and it is not included. Instead, it is downloaded from other servers during the compilation process. Here is a unified save directory.


6
/staging_dir
It is used to save the build_dircompiled software in the directory, so it also build_dirhas the same subdirectory structure. For example target-XXX, the target platform compiled header file is saved in the folder. When we develop our own ipk file, the compilation process is in progress. , preprocessor header files, link dynamic libraries, static libraries are all in this subfolder


7
/tmp
During the compilation process, there are a large number of intermediate temporary files that need to be saved, all here.


8
/logs
The error message during the compilation process will only appear when the compilation error occurs.