概述
环境 Vmware 16 + Ubuntu16(64位)
OpenWrt官网:https://openwrt.org/zh/downloads
安装Vmware Tool(主机与虚拟机传输拷贝文件)
点击 重新安装 Vmware Tool
将文件拷贝到桌面
解压文件 tar -xvf VMwareTools-10.3.23-16594550.tar.gz
进入文件夹cd vmware-tools-distrib/ 安装Vmware Tool (sudo ./vmware-install.pl) 安装过程需要回车
下载 openwrt 编译相关的库
一般 openwrt 18.06 一般采用 ubuntu16 编译 (相关资料比较多)
一般 openwrt 12.09 一般采用Ubuntu14 编译
sudo apt-get update
Ubuntu16 版本缺少依赖库
sudo apt-get install gcc g++ binutils patch bzip2 flex bison make autoconf gettext texinfo unzip sharutils libncurses5-dev ncurses-term zlib1g-dev gawk asciidoc libz-dev git-core uuid-dev libacl1-dev liblzo2-dev pkg-config libc6-dev curl libxml-parser-perl ocaml-nox
Ubuntu18 版本缺少依赖库 (未验证)
sudo apt-get install subversion build-essential libncurses5-dev zlib1g-dev gawk git ccache gettext libssl-dev xsltproc zip
下载源码
git clone https://github.com/openwrt/openwrt.git
切换分支
git checkout openwrt-18.06
下载完之后执行更新源(Feeds)指令,更新软件包依赖关系:
./scripts/feeds update -a
更新失败
错误
fatal: unable to access 'https://git.openwrt.org/openwrt/openwrt.git/': server certificate verification failed. CAfile: /etc/ssl/certs/ca-certificates.crt CRLfile: none
解决办法:(关闭ssl验证)
git config --global http.sslVerify "false"
正常更新
执行下载编译固件需要的软件包:
./scripts/feeds install -a
选择编译目标(默认全目标编译)
make menuconfig
编译
make V=s -j8