ubuntu16.04编译OpenWrt环境搭建

 时间:2024-10-13 17:34:57

1、 在编译之前我们先要搭建环境,ubuntu下OpenWrt编译环娓搠础拔境需要安装很多组件:sudoapt-g髫潋啜缅etinstallgccg++binutilspatchbzip2flexbisonmakeautocnfgettexttexinfounzipsharutilssubversionlibncurses5-devncurses-termzlib1g-devsubversiongit-corgawasciidolibz-dev如果你怕有些没安装成功, 也可以一个个安装:sudoapt-getinstallgcc (已安装)sudoapt-getinstallg++(已安装)sudoapt-getinstallbinutils(已安装)sudoapt-getinstallpatch(已安装)sudoapt-getinstallbzip2(已安装)sudoapt-getinstallflex(需安装)sudoapt-getinstallbison(需安装)sudoapt-getinstallmake(已安装)sudoapt-getinstallautoconf(需安装)sudoapt-getinstallgettext(已安装)sudoapt-getinstalltexinfo(需安装)sudoapt-getinstallunzip(已安装)sudoapt-getinstallsharutils(已安装)sudoapt-getinstallsubversion(需安装)sudoapt-getinstalllibncurses5-dev(需安装)sudoapt-getinstallncurses-term(已安装)sudoapt-getinstallzlib1g-dev(已安装)sudoapt-getinstallsubversion(已安装)sudoapt-getinstallgit-core(需安装)sudoapt-getinstallgawk(已安装)sudoapt-getinstallasciidoc(需安装)sudoapt-getinstalllibz-dev当然安装之前最好先更新下组件包:sudoapt-getupdate这里小编选择逐个安装

2、 经过小编逐个安装,发现大部分在ubuntu16.04系统中就已经安装好了,只需再安装以下几款:sudoapt-getinstallflexsudoapt-getinstallbisonsudoapt-getinstallautoconfsudoapt-getinstalltexinfosudoapt-getinstallsubversionsudoapt-getinstalllibncurses5-devsudoapt-getinstallgit-coresudoapt-getinstallasciidoc(文件比较大,耐心等待)

3、 新建一个openwrt目录,使用命令:mkdiropenwrtsudochmod777openwrt 接下来的所有命令都在/openwrt目录下运行(编译系统的绝对路径中不能含有空格)。

ubuntu16.04编译OpenWrt环境搭建

4、 下载OpenWrt源码: 通过git来下载OpenWrtbleedingedge 从官方源下载:gitclonegit://git.openwrt.org/openwrt.git gitclonegit://git.openwrt.org/15.05/openwrt.git,下载时间比较漫长,请耐心等待。

ubuntu16.04编译OpenWrt环境搭建

5、 添加软件扩展包: cd openwrt/进入/home/kevinfan/openwrt/openwrt目录,可以找到feeds.conf.default文件,将feeds.conf.default修改为feeds.conf,使用以下命令: cpfeeds.conf.defaultfeeds.conf 得到feeds.conf文件

ubuntu16.04编译OpenWrt环境搭建

6、 更新扩展,安装扩展:./scripts/feedsupdate-a./scripts/feedsi荏鱿胫协nstall-a系统提示:WARNING: No feed for package 'librt' found, maybe it's already part of the standard packages?WARNING: No feed for package 'libpthread' found, maybe it's already part of the standard packages?WARNING: No feed for package 'lua' found, maybe it's already part of the standard packages?WARNING: No feed for package 'libc' found, maybe it's already part of the standard packages?WARNING: No feed for package 'libssp' found, maybe it's already part of the standard packages?

ubuntu16.04编译OpenWrt环境搭建

7、 测试下编译环境,使用命令: makedefconfig系统提示:Build dependency: Please install the openssl library (with development headers)/home/kevinfan/openwrt/openwrt/include/prereq.mk:12: recipe for target 'prereq' failedPrerequisite check failed. Use FORCE=1 to override./home/kevinfan/openwrt/openwrt/include/toplevel.mk:151: recipe for target 'staging_dir/host/.prereq-build' failedmake: *** [staging_dir/host/.prereq-build] Error 1请安装openssl库

ubuntu16.04编译OpenWrt环境搭建

8、 进openssl官网:http://www.openssl.org 下载页面:http://www.openssl.org/source/ 选择最新版本下载,用WinSCP上传至Ubuntu系统中,这里小编放在Downloads:openssl-1.1.0-pre5.tar.gz

ubuntu16.04编译OpenWrt环境搭建

9、解压:tar–zxvfopenssl-1.1.0-pre5.tar.gz,解压目录为:openssl-1.1.0-pre5然后进入到openssl-1.1.0-pre5,进行配置、编译、安装。配置 ./configure或./config编译 make安装makeinstall如果提示无权限,可以加上sudo在执行,接着只要等到编译安装完成即可。

ubuntu16.04编译OpenWrt环境搭建

10、 重新测试下编译环境,使用命令: makedefconfig 系统提示:configuration written to .config(配置写入config)。

ubuntu16.04编译OpenWrt环境搭建

11、 接着我们输入命令: makemenuconfig 如果一切正常,会出现一个配置菜单,可以选择要编译的固件平台、型号,还能选择固件中要添加的功能和组件,至此编译环境就搭建好了。

ubuntu16.04编译OpenWrt环境搭建
  • Redis服务自启动配置
  • hutool切分字符串并去除空白符
  • oracle如何删除用户
  • 易语言寻找字节集
  • 怎么查看redis版本
  • 热门搜索
    国学经典手抄报内容 国庆节英语手抄报内容 世界地球日手抄报图片 诚实守信手抄报图片 手抄报的图案 预防登革热手抄报 文明礼仪手抄报花边 三年级重阳节手抄报 关于节日的英语手抄报 有关弟子规的手抄报