OpenWrt 是一个高度模块化、高度主动化的嵌入式的 Linux 刊行版,它的的保证理供给了一个完全可写的文件系统,从应用法式供给商供给的选择和设置装备摆设,并许可您自界说的设备,以顺应任何应用法式,所以具有很强的心猿意马制能力,这也让发烧友们更具有挑战激情。
同时OpenWRT拥有壮大的收集组件和扩展性,经常被用于德律风、小型机械人、智能家居、以及路由器设备中。
因为OpenWRT没有刊行小米路由mini版固件,所以只能脱手进行编译一个。

东西/原料
- ubuntu16.0
- OpenWrt
方式/步调
- 1
在编译之前我们先要搭建情况,ubuntu下OpenWrt编译情况需要安装良多组件:
sudo apt-get install gcc g++ binutils patch bzip2 flex bison make autocnf gettext texinfo unzip sharutils subversion libncurses5-dev ncurses-term zlib1g-dev subversion git-cor gaw asciido libz-dev
若是你怕有些没安装当作功, 也可以一个个安装:
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 subversion (需安装)
sudo apt-get install libncurses5-dev (需安装)
sudo apt-get install ncurses-term (已安装)
sudo apt-get install zlib1g-dev (已安装)
sudo apt-get install subversion (已安装)
sudo apt-get install git-core(需安装)
sudo apt-get install gawk(已安装)
sudo apt-get install asciidoc(需安装)
sudo apt-get install libz-dev
当然安装之前最好先更新下组件包:
sudo apt-get update
这里小编选择逐个安装
- 2
颠末小编逐个安装,发现年夜部门在ubuntu16.04系统中就已经安装好了,只需再安装以下几条目:
sudo apt-get install flex
sudo apt-get install bison
sudo apt-get install autoconf
sudo apt-get install texinfo
sudo apt-get install subversion
sudo apt-get install libncurses5-dev
sudo apt-get install git-core
sudo apt-get install asciidoc(文件比力年夜,耐烦期待)
- 3
新建一个openwrt目次,利用号令:
mkdir openwrt
sudo chmod 777 openwrt
接下来的所有号令都在/openwrt目次下运行(编译系统的绝对路径中不克不及含有空格)。
- 4
下载OpenWrt源码:
经由过程git来下载OpenWrt bleeding edge
从官方源下载:git clone git://git.openwrt.org/openwrt.git
git clone git://git.openwrt.org/15.05/openwrt.git,下载时候比力漫长,请耐烦期待。
- 5
添加软件扩展包:
cd openwrt/进入/home/kevinfan/openwrt/openwrt目次,可以找到feeds.conf.default文件,将feeds.conf.default点窜为feeds.conf,利用以下号令:
cp feeds.conf.default feeds.conf
获得feeds.conf文件
- 6
更新扩展,安装扩展:
./scripts/feeds update -a
./scripts/feeds install -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?
- 7
测试下编译情况,利用号令:
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库
- 8
进openssl官网:http://www.openssl.org
下载页面:http://www.openssl.org/source/
选择最新版本下载,用WinSCP上传至Ubuntu系统中,这里小编放在Downloads:openssl-1.1.0-pre5.tar.gz
- 9
解压:tar –zxvf openssl-1.1.0-pre5.tar.gz,解压目次为:openssl-1.1.0-pre5
然后进入到openssl-1.1.0-pre5,进行设置装备摆设、编译、安装。
设置装备摆设 ./configure或./config
编译 make安装make install
若是提醒无权限,可以加上sudo在执行,接着只要比及编译安装完当作即可。
- 10
从头测试下编译情况,利用号令:
make defconfig
系统提醒:configuration written to .config(设置装备摆设写入config)。
- 11
接着我们输入号令:
make menuconfig
若是一切正常,会呈现一个设置装备摆设菜单,可以选摘要编译的固件平台、型号,还能选择固件中要添加的功能和组件,至此编译情况就搭建好了。
注重事项
- 利用非root用户来完当作工作
来源:百闻(微信/QQ号:9397569),转载请保留出处和链接!
本文链接:https://www.ibaiwen.com/web/283152.html
猜你喜欢
-
监管人员是做什么的(What Regulatory Officer Do)?
-
什么是低度肿瘤(Low-Grade Neoplasm)?
-
面板生成器是做什么的(What Panel Builder Do)?
-
什么是浆液性乳头状腺癌(Serous Papillary Adenocarcinoma)?
-
什么是呼叫中心工作(Call Center Job)?
-
什么是种子疣(What Seed Warts)?
-
念珠菌病有哪些不同的治疗方法(Different Types of Candidiasis Treatment)?
-
事务协调器是做什么的(What Transaction Coordinator Do)?
-
什么是定量免疫球蛋白(Quantitative Immunoglobulin)?
-
我如何成为人才获取专家(Become a Talent Acquisition Specialist)?
- 热门文章
-
WB蒙特利尔(WB Montreal)——欧美十大最差视频游戏开发商
迅猛龙(Velociraptor)——欧美史前十大死亡动物
什么是果酱猫(What Marmalade Cats)?
神奇蜘蛛侠2(The Amazing Spider-Man 2)——欧美最佳蜘蛛侠电影
faceu激萌怎么把瘦脸开到最大
希瑟(Heather)——欧美十大最佳柯南灰歌
奥兹奥斯本(Ozzy Osbourne)——欧美十大高估歌手
二人梭哈
什么是小脑前下动脉(Anterior Inferior Cerebellar Artery)?
我应该知道康涅狄格州的什么(What Should I Know About Connecticut)?
- 热评文章
- 最新评论
-
- 最近访客
-
- 站点信息
-
- 文章总数:261580
- 页面总数:9
- 分类总数:1
- 标签总数:0
- 评论总数:0
- 浏览总数:74382