搜档网
当前位置:搜档网 › openwrt 的编译

openwrt 的编译

openwrt 的编译
openwrt 的编译

编译前的准备

编译步骤:

1、UBUNTU系统安装:在实体机或虚拟机中安装UBUNTU 15.01。

为了方便大家开发测试,特在此介绍一些V M W A R E中的设置技巧。

A、环境基础设置时,使用64位处理器。

B、内存1G以上,硬盘空间30G以上。

C、学会使用快照的功能。

D、网络设置成NAT模式(用于共享主机,IP地址)

2、安装编译中需要的软件:

更新Ubuntu系统软件:

sudo apt-get update

A、相关软件(建议到SecureCRT中操作)

sudo apt-get install gcc

sudo apt-get installg++

sudo apt-get install binutils

sudo apt-get install patch

sudo apt-get installbzip2

sudo apt-get install flex

sudo apt-get install bison

sudo apt-get installmake

sudo apt-get installautoconf

sudo apt-get installgettext

sudo apt-get installtexinfo

sudo apt-get install unrar

sudo apt-get installzip

sudo apt-get installunzip

sudo apt-get install p7zip

sudo apt-get installp7zip-rar

sudo apt-get install p7zip-full

sudo apt-get install sharutils

sudo apt-get install subversion

sudo apt-get install libncurses5-dev

sudo apt-get install ncurses-term

sudo apt-get install zlib1g-dev

sudo apt-get install gawk

sudo apt-get install libssl-dev

sudo apt-get install git-core

B、下载OpenWRT源码包

svnco svn://https://www.sodocs.net/doc/865126974.html,/openwrt/trunk (开发版本,不稳定)

svn co svn://https://www.sodocs.net/doc/865126974.html,/openwrt/branches/backfire (稳定版本)

进入源码文件夹

cd openwrt /trunk

更新扩展软件包:

./scripts/feeds update -a

安装扩展软件包:

测试

[openwrt@localhost trunk]$ make defconfig

[openwrt@localhost trunk]$ make prereq

进入配置界面(用于选择芯片型号、需要集成的组件等):

make menuconfig

开始编译:(注意,下面的V是大写)

make V=99

选择LuCI配置(web网页管理程序):

LuCI ---> 1. Collections ---> luci 启LuCI

LuCI ---> 2. Modules ---> Translations --->Chinese (zh-cn)支持中文

LuCI ---> 3. Applications ---> luci-app-commands网页Shell

LuCI ---> 3. Applications ---> luci-app-firewall 防火墙LuCI ---> 3. Applications ---> luci-app-ntpc 时间同步服务器LuCI ---> 3. Applications ---> luci-app-qos 上网管理LuCI ---> 3. Applications ---> luci-app-samba网络共享LuCI ---> 3. Applications ---> luci-app-ddns 动态域名LuCI ---> 4. Themes ---> luci-theme-bootstrap 默认主题

修改Luci界面默认中文

进入/openwrt/trunk/feeds/luci/modules/luci-base/root/etc/config/luci,编辑luci文件

Luci原文为:

config core main

optionlang auto

option mediaurlbase /luci-static/https://www.sodocs.net/doc/865126974.html,

option resourcebase /luci-static/resources

config extern flash_keep

option uci “/etc/config/”

option dropbear “/etc/dropbear/”

option openvpn “/etc/openvpn/”

option passwd “/etc/passwd”

option opkg “/etc/opkg.conf”

option firewall “/etc/https://www.sodocs.net/doc/865126974.html,er”

option uploads “/lib/uci/upload/”

config internal languages

config internal sauth

option sessionpath “/tmp/luci-sessions”

option sessiontime 3600

config internal ccache

option enable 1

config internal themes

修改为以下内容:

config core main

option lang zh_cn

option mediaurlbase /luci-static/https://www.sodocs.net/doc/865126974.html,

option resourcebase /luci-static/resources

config extern flash_keep

option uci “/etc/config/”

option dropbear “/etc/dropbear/”

option openvpn “/etc/openvpn/”

option passwd “/etc/passwd”

option opkg “/etc/opkg.conf”

option firewall “/etc/https://www.sodocs.net/doc/865126974.html,er”

option uploads “/lib/uci/upload/”

config internal languages

option zh_cn‘chinese’

option en ‘English’

config internal sauth

option sessionpath “/tmp/luci-sessions”

option sessiontime 3600

config internal ccache

option enable 1

config internal themes

清理工作

建议现在清理编译产生的文件,以免下次编译时造成冲突,(文件如果存在的话,将不会被替换),执行

make clean

注意:在执行clean命令,确保已经将编译好的image进行了备份。清理工作会清楚bin目录。

[openwrt@localhost trunk]$ make clean

除了清除生成的目录,还想清除交叉编译工具(以及工具链目录)

[openwrt@localhost trunk]$ make dirclean

清除所有相关的东西,包括下载的软件包,配置文件,feed内容等:(不建议使用)

[openwrt@localhost trunk]$ make distclean

对于更新feeds后出现的错误:

ERROR:please fix package/feeds/packages/mc/Makefile 等类似的问题,需要执行这条语句进行系统的清理

更详细的信息建议您参考

相关主题