openwrt笔记2-搭建编译

openwrt笔记2

编译openwrt系统

从openwrt官网下载源码

建议下载稳定版的

安装一个linux的虚拟机

我用的unbutu16.04系统

安装环境

  • 更新组件包:sudo apt-get update
  • 安装环境需要的各种包:

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

*新建一个目录,源码放到里面:
mkdir openwrt

sudo chmod 777 openwrt

添加软件扩展包,更新扩展,安装扩展

cp feeds.conf.default feeds.conf

./scripts/feeds update -a

./scripts/feeds install -a

测试下编译环境

使用命令:make defconfig

如果系统有提示: Please install the openssl library

那么就要先安装openssl了:

方法一

sudo apt-get install openssl

sudo apt-get install libssl-dev

方法二

到openssl官网下载压缩包
http://www.openssl.org/source/
我这里下载的是openssl-1.0.1q.tar.gz
我用的是root用户登录,所以以下命令都省去了sudo,如果不是用root用户登录,请自行加上

1) tar zxvf openssl-1.0.1q
2)./config shared(安装的默认路径是/usr/local/ssl,如果你想更改目录,请加上–prefix=/yourpath)
3)make
4)make test
5)make install

创建符号链接(这部可做可不做,看你的需求)
ln -s /usr/local/ssl/bin/openssl /usr/bin/openssl
ln -s /usr/local/ssl/include/openssl /usr/include/openssl

刷新动态库配置
vim /etc/ld.so.conf
在文件末尾加入
/usr/local/ssl/lib

测试(如果你没有创建符号链接,下面的命令要带上具体的路径)
openssl version -a

安装好了,再测试,
make defconfig

系统提示:configuration written to .config(配置写入config)

make menuconfig,配置各种参数

make V=99编译

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值