1.准备相应的环境,我使用的环境是VMware16+ubuntu20.04,如图1所示安装编译所需的依赖包;
sudo apt-get install build-essential asciidoc binutils bzip2 gawk gettext git libncurses5-dev libz-dev patch python3 python2.7 unzip zlib1g-dev lib32gcc1 libc6-dev-i386 subversion flex uglifyjs git-core gcc-multilib p7zip p7zip-full msmtp libssl-dev texinfo libglib2.0-dev xmlto qemu-utils upx libelf-dev autoconf automake libtool autopoint device-tree-compiler g++-multilib antlr3 gperf wget curl swig rsync
图1
2.如图2所示,在~目录下创建project文件夹,在project文件夹下下载相应的代码;
mkdir project,cd project
git clone https://github.com/openwrt/openwrt
图2
3.如图3所示,进入openwrt目录下,执行./scripts/feeds update -a命令下载feeds.conf/feeds.conf.default中的所有最新包;
图3
4.如图4所示,执行./scripts/feeds install -a命令将所有获得的包的符号链接安装到fees包中;
图4
5.如图5所示,执行make menuconfig打开配置界面;
图5
6.如图5所示,配置完之后右键移动到Save使用回车保存,如图6和图7所示,接下来选择Ok回车即可;
图6
图7
7.如图8所示提前使用make download下载编译所需的依赖包,或者直接make也可以;
图8
8.如图9所示使用make编译即可,如图10编译完成。如果要查看详细编译信息,使用make V=99编译;
图9
图10
9.如图11所示,在/bin/targets/ramips/mt76x8目录下有固件生成,使用openwrt-ramips-mt76x8-widora_neo-32m-squashfs-sysupgrade.bin拿去刷机即可!刷机教程看我第一篇文章。
图11
参考链接:GitHub - openwrt/openwrt: This repository is a mirror of https://git.openwrt.org/openwrt/openwrt.git It is for reference only and is not active for check-ins. We will continue to accept Pull Requests here. They will be merged via staging trees then into openwrt.git.