OpenWrt Learning Notes Introductory article

Source: Internet
Author: User
Tags gettext svn svn update
OpenWrt Getting Started

First, share a few openwrt URLs:

http://www.openwrt.org.cn/bbs/forum.php?mod=viewthread&tid=4217
Http://www.open-mesh.org/projects/batman-adv/wiki/Wiki
http://blog.csdn.net/teddy99999/article/details/17537545
http://blog.csdn.net/cupidove/article/details/45093385
https://openwrt.org/

See for yourself OpenWrt source method
Https://dev.openwrt.org/wiki/GetSource

There is also the official version will be upgraded, specifically, please see
Https://dev.openwrt.org/browser/branches

OpenWrt Introduction

The router is the equivalent of a small computer, some of the more well-configured (memory, CPU performance) can be manually brushed into the Linux system (DD-WRT and OpenWrt are two widely spread Linux system), and in this system running Ruijie dialer.

OpenWrt is a highly modular, highly automated embedded Linux system with strong network components and extensibility, often used in industrial control devices, telephones, small robots, smart homes, routers, and VoIP devices. It also provides more than 100 compiled software, and the number is increasing, while the OpenWrt SDK simplifies the process of developing software.

Unlike many other distributions for routers, OpenWrt is a zero-based, fully-functional, easy-to-modify router operating system. In fact, this means that developers can use the features they want without adding to the rest, while the Linux kernel that support these features are much newer than most distributions.

OpenWrt supports a variety of processor architectures, both for ARM,X86,POWERPC and MIPS. It includes up to 3,000 packages, ranging from toolchain (toolchain), to Kernels (Linux kernel), to software packages (packages), to the root filesystem (ROOTFS) system, This allows the user to quickly and easily customize an embedded system with specific functionality to produce firmware with a simple make command.

The development process of general embedded Linux, whether ARM, PowerPC or MIPS processor, must undergo the following development process:

1. Create a Linux cross-compilation environment;

2. Establishment of Bootloader;

3. Porting the Linux kernel;

4. Establish Rootfs (root file system);

5. Install the driver;

6. Install the software;

Being familiar with the basic development process of these droning-in Linux, it is no longer limited to MIPS processors and wireless routers, and can attempt to migrate embedded Linux on other processors, or systems that are not wireless routers, to customize the appropriate application software and to build a complete embedded product.

OpenWrt swipe in the router

Download the latest OpenWrt firmware on our website, link below: http://downloads.openwrt.org/snapshots/trunk/ar71xx/

After entering the link address, find the firmware corresponding to Tp-link wr703n, there will be the following four:

First, there are two different formats, namely JFFS2 and SQUASHFS. The difference between the two different formats of firmware is that, after installation, SQUASHFS will occupy a certain amount of space to hold some of the necessary files of the system, these files are only readable, the role of these files is to help restore the system, when the openwrt crashes, can be based on these files, Using the Firstboot script to rebuild the initial system, while JFFS2 does not store such a file, the advantage is that it saves space. In general, we use firmware in the SQUASHFS format to facilitate the restoration of the system to its initial state. Second, each format has two files, factory and Sysupgrade, the difference between the two files is that factory a number of verified things, for the original firmware on the basis of upgrading, if it is already openwrt, directly using the second file can be. Also, when upgrading on the basis of the original firmware, first use the factory file and then need to use the Sysupgrade file again, choosing not to keep the original configuration for the upgrade.

Of course, you can also customize your firmware by compiling it. Here's how.

The first part: Build the environment of compilation

1. Install Ubuntu (Linux environment required for compiling)

2, remember not to change the software source, while holding down CTRL + ALT + T, call up the terminal;

3. Enter the following commands one by one (to verify the installation success):

sudo apt-get install g++

sudo apt-get install Libncurses5-dev

sudo apt-get install Zlib1g-dev

sudo apt-get install Bison

sudo apt-get install Flex

sudo apt-get install unzip

sudo apt-get install autoconf

sudo apt-get install gawk

sudo apt-get install make

sudo apt-get install GetText

sudo apt-get install gcc

sudo apt-get install binutils

sudo apt-get install patch

sudo apt-get install bzip2

sudo apt-get install Libz-dev

sudo apt-get install AsciiDoc

sudo apt-get install subversion

sudo apt-get install Sphinxsearch

sudo apt-get install Libtool

sudo apt-get install Sphinx-common

The build environment is now complete.

Apt-get Install Libtool autoconf automake gcc-multilib Bison screens gcc g++ binutils patch bzip2 Flex make GetText unzip L Ibc6 git-core git build-essential libncurses5-dev zlib1g-dev gawk Quilt AsciiDoc Libz-dev

Part II: Download OpenWrt source code and compile

OpenWrt source of two types, one is the latest but not the most stable trunk development version, one is the most stable version of Backfire, the proposed download official source. Create a folder locally before downloading:

mkdir OpenWrt

sudo chmod 777 OpenWrt

CD OpenWrt

Select the version you want and then execute the download command, and the download end will show the version number:

Trunk version Download command:

SVN Co svn://svn.openwrt.org/openwrt/trunk/

Download command for version backfire:

SVN Co svn://svn.openwrt.org/openwrt/branches/backfire/

Add the Software expansion pack and modify Feeds.conf.default to feeds.conf:

CP Feeds.conf.default feeds.conf

To update the extension, install the extension:

./scripts/feeds update-a

./scripts/feeds Install-a

Note: If the source is not just downloaded, to keep the code up-to-date, you should periodically run the SVN Update command to update the source.

To test the compilation environment:

Make Defconfig

Here you can start compiling your own firmware. Enter the custom interface:

Make Menuconfig

If all goes well, a configuration menu appears, with the option to compile the firmware platform (chip type), model, and select the features and components to be added in the firmware, save and exit the menu when configured.

If you want to modify the source code, it should be done in this step, such as support for large-volume flash, such as changes, self-surfing on the internet to find out what to modify what the file, on the Ubuntu GUI in the search for files, double-click Open Text Editor to modify the save.

To start compiling:

Make

Or

Make v=99

Or

Make-j v=99

Make is a compile command, v=99 represents the output debug information, V must be capitalized, if you want the CPU to compile at full speed, add the-j parameter, the first compilation is best without-j parameters.

The compilation process remains networked (some source packages will be downloaded from the Internet), so the network may cause a compile interrupt, compile time and computer CPU and network environment has a lot of relationship, the first compilation time is longer, fast half an hour long is 2, 3 hours, after the time required for compiling short. After compiling, the bin folder (such as Trunk/bin/xxxx) will appear in the source file directory. If your hand route is the original firmware need to brush openwrt need to choose Xxx-factory.bin firmware, if the route has been brushed openwrt, choose Upgrade firmware Xxxx-sysupgrade.bin upgrade, upgrade the upgrade interface. Go to the folder to find the firmware you need to get out (via email, network disk, USB drive, etc.), start the brush machine.

After doing this, you can swipe the openwrt into the router.

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.