openwrt开发环境搭建

openwrt开发环境搭建

文章目录

  • openwrt开发环境搭建
    • 环境简介
    • 源码获取
    • 安装步骤
      • 安装需要依赖包
      • 安装包管理
    • 配置系统
    • 编译系统

环境简介

  • Ubuntu16.04LTS(虚拟机)

  • VPN

  • hyper-V

    本人使用的是虚拟机环境,使用的虚拟机是hyper-V是win10企业版自带的虚拟机,如何使用这里不做说明,为了提交虚拟机的运行速度可以提高虚拟机处理器数量这样在编译时候可以使用 make -j 来加快编译速度了。VPN是因为在make使用需要下载很多包,没有的可以到我提供链接下载第三方包。

建议不要使用Ubuntu18版本,因为编译问题会更多

源码获取

1、官网GIT获取

Chaos Calmer版本或者openwrt版本,根据自己实际情况获取,本人使用是Chaos Calmer版本。

git clone https://github.com/openwrt/chaos_calmer.git

安装步骤

安装需要依赖包

sudo apt-get install gcc g++ binutils patch bzip2 flex bison make autoconf gettext texinfo unzip sharutils subversion libncurses5-dev ncurses-term zlib1g-dev subversion git-core gawk asciidoc libz-dev zlib1g-dev libssl-dev openssl

安装包管理

openwrt 的附加软件包管理器的扩展包索引目录.有点绕,简单来说就是下载管理软件包
的.默认的 feeds 下载有 packages、 management、 luci、 routing、 telephony。如要下载其他的
软件包,需打开源码根目录下面的 feeds.conf.default 文件,去掉相应软件包前面的#号,然
后更新源:

./scripts/feeds update -a

安装下载好的包:

./scripts/feeds install -a

配置系统

配置:

make menuconfig

通过上面指令,配置自己所需要的板子和功能,然后编译。

编译系统

编译:

make V=s

不要使用多核编译,因为这样有错误信息不能准确提示出来

可能会遇到的问题
1、Build dependency: Please install Git (git-core) >= 1.6.5
解决方法:链接

2、gdate.c:2497:7: error: format not a string literal, format string not checked [-Werror=format-nonliteral]
解决方法:链接

3、error: RPC failed; curl 56 GnuTLS recv error (-9): A TLS packet with unexpected length was received
解决方法:链接
4、
Installing package ‘freifunk-common’ from luci
Installing package ‘freifunk-firewall’ from luci
Installing package ‘freifunk-gwcheck’ from luci
Installing package ‘freifunk-mapupdate’ from luci
Installing package ‘luci’ from luci
Installing package ‘luci-base’ from luci
Installing package ‘luci-lib-nixio’ from luci
解决方法:链接
openwrt开发环境搭建_第1张图片

你可能感兴趣的:(Linux学习)