天天看点

第一次 openwrt源码下载编译

openwrt 学习记录

第一次 openwrt源码下载编译

MT7620开发板

安装虚拟机VMware

安装Ubnutu

先进入root账户

[email protected]:~$ su
           

输入密码

1、搭建编译环境 参考:https://blog.csdn.net/fyh2003/article/details/44564219

打开安装好的ubnutu界面

调出终端输入

sudo apt-get install g++
sudo apt-get install libncurses5-dev
sudo apt-get install zlib1g-dev
sudo apt-get install bison
sudo apt-get install flex
sudo apt-get install unzip
sudo apt-get install autoconf
sudo apt-get install gawk
sudo apt-get install make
sudo apt-get install gettext
sudo apt-get install gcc
sudo apt-get install binutils
sudo apt-get install patch
sudo apt-get install bzip2
sudo apt-get install libz-dev
sudo apt-get install asciidoc
sudo apt-get install subversion
sudo apt-get install sphinxsearch
sudo apt-get install libtool
sudo apt-get install sphinx-common
sudo apt-get install libssl-dev
           

环境搭建完成

2、openwrt源码下载(参考:https://blog.csdn.net/mojie_babyno1/article/details/81135039

新建目录

git 目录用来存放openwrt

mkdir git
   cd git
           

新建openwrt目录

mkdir openwrt
           

下载源代码

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

下载源码的路径和以前的不一样了,我找好多都不能下载

添加软件扩展包

(1)、将feeds.conf.default 复制到feeds.conf

cd  chaos_calmer
cp feeds.conf.default feeds.conf
           

(2)、更新扩展包

./scripts/feeds update -a 
           

(3)、 安装扩展包

./scripts/feeds install -a 
           

3、编译openwrt源代码

测试编译环境

make defconfig 
           

进入配置界面

make menuconfig
           

当执行完上面的命令会出现下图所示的界面,我们可以通过方向键来选择配置选项,通过空格键来选择配置状态

这里选用的是MT7620A

1)CUP选型

target system (Ralink RT288x/RT3xxx)

CPU子型号

subtarget(MT7620 based boards)

保存退出简单的配型就完成了

第一次 openwrt源码下载编译

编译

make V=99
           

第一次编译时间较长,

注意V一定要大写

编译成功后进入如下目录

r[email protected]:/home/topeet/git/openwrt/chaos_calmer/bin/ramips# ls
           

找到

openwrt-ramips-mt7620-mt7620a-squashfs-sysupgrade.bin

这个文件就是我们 mt7620a 的固件了

继续阅读