openwrt路由器设置教程(OpenWRT开发环境搭建)

一、安装Ubuntu系统

这个就不讲了,自己百度,最好使用14.04, 16.04会有一些莫名其妙的错误。

二、搭建开发环境

1、安装git工具(现在一般是使用git去下载源码)

    sudo apt-get install git-core

2、安装依赖的库文件(一起装比较容易出现漏装,建议逐个装)
sudo apt-get install gcc g++ binutils patch bzip2 flex bison make autoconf gettext texinfo unzip sharutils ncurses-term zlib1g-dev libncurses5-dev gawk libssl-dev subversion
或者逐个安装:
sudo apt-get install gcc
sudo apt-get install g++
sudo apt-get install binutils
sudo apt-get install patch
sudo apt-get install bzip2
sudo apt-get install flex
sudo apt-get install bison
sudo apt-get install make
sudo apt-get install autoconf
sudo apt-get install gettext
sudo apt-get install texinfo
sudo apt-get install unzip
sudo apt-get install sharutils
sudo apt-get install ncurses-term
sudo apt-get install zlib1g-dev
sudo apt-get install libncurses5-dev
sudo apt-get install gawk
sudo apt-get install libssl-dev
sudo apt-get install subversion

3、下载OpenWRT源码
先创建OpenWRT目录来保存源码
mkdir OpenWRT
cd OpenWRT
git clone
https://github.com/openwrt-mirror/openwrt.git (下载源码)

4、更新源码上的软件
为了使 OpenWrt 支持更多的软件,需要更新和安装其它源上面的软件
cd openwrt
./scripts/feeds update -a
./scripts/feeds install -a

5、进行OpenWRT配置
make menuconfig
1). 选择 CPU 型号
Target System -> Ralink RT288x/RT3xxx
2). 选择 CPU 子型号
Subtarget -> RT3x5x/RT5350 based boards
3). 选择具体路由器型号
Target profile -> HAME-MPR-A2

保存退出

6、编译源码
make V=99

注意:编译过程要联网哦,如果编译出错大部分都是由于网络不好。所以重新编译就OK了

烧录文件在哪?
openwrt/bin/ramips/openwrt-ramips-rt305x-mpr-a2-squashfs-sysupgrade.bin