sudo apt-get update
现在安装编译用的软件,建议大家一个一个的安装....按Y继续安装即可
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 git
sudo apt-get install subversion
sudo apt-get install sphinxsearch
sudo apt-get install libtool
sudo apt-get install sphinx-common
官方WIKI用的是单一条命令,我分开了,因为这样更容易查看每一个组件的安装是否成功。
下载源码,分两种,一种是最新版但不是最稳定,也就是trunk版,一种是相对稳定版,backfire版。源码下载命令分别是:
先创建文件夹
mkdir openwrt
sudo chmod 777 openwrt
cd openwrt
下载Openwrt源代码
sudo git clonegit://git.openwrt.org/openwrt.git
或者
Trunk版下载命令:svn co svn://svn.openwrt.org.cn/openwrt/trunk/
Backfire下载命令:svn co svn://svn.openwrt.org.cn/openwrt/branches/backfire/
./scripts/feeds update -a
./scripts/feeds install -a
我用的是稳定版
cd openwrt/backfire
make defconfig
make menuconfig
进入定制界面
设置好后....
make V=99
第一次编译时间较长,请耐心等待完成
如果需要同时安装最新版,我安装稳定版中找不到我的机型。最好直接安装新版
cd
cd openwrt
svn co svn://svn.openwrt.org.cn/openwrt/trunk/
./scripts/feeds update -a
./scripts/feeds install -a
cd
cd openwrt/trunk
make defconfig
测试下编译环境,使用命令:
make defconfig
系统提示:
Build dependency: Please install the openssl library (with development headers)
/home/kevinfan/openwrt/openwrt/include/prereq.mk:12: recipe for target 'prereq' failed
Prerequisite check failed. Use FORCE=1 to override.
/home/kevinfan/openwrt/openwrt/include/toplevel.mk:151: recipe for target 'staging_dir/host/.prereq-build' failed
make: *** [staging_dir/host/.prereq-build] Error 1
请安装openssl库
cd
wget http://www.openssl.org/source/openssl-1.1.0-pre5.tar.gz
tar –zxvf openssl-1.1.0-pre5.tar.gz,解压目录为:openssl-1.1.0-pre5
sudo chmod 777 openssl-1.1.0-pre5
cd openssl-1.1.0-pre5
然后进入到openssl-1.1.0-pre5,进行配置、编译、安装。
配置 ./configure或./config
编译 make安装sudo make install
如果提示无权限,可以加上sudo在执行,接着只要等到编译安装完成即可。
重新测试下编译环境,使用命令:
make defconfig
系统提示:configuration written to .config(配置写入config)
使用方法:
cd
cd openwrt/trunk
make menuconfig
make menuconfig
Target System---AR71xx/AR7240/AR913x/AR934x CPU型号
Target Profile---TP-LINK 741
LuCI—>Collections—– <*> luci 添加Luci
LuCI—>Translations—- <*> luci-i18n-chinese 添加中文
EXT----YES
make V=99 开始编译
晕 报错了


0 评论