Ubuntu20.04编译lede 最新Openwrt版本(含ssr-plus++)

本教材使git仓库地址:https://github.com/coolsnowwolf/lede

注意:

  1. 要用 root 用户 git 和编译!!!
  2. 国内用户编译前最好准备好梯子
  3. 默认登陆IP 192.168.1.1, 密码 password

教程:

1.首先装好 Ubuntu,推荐 Ubuntu 20.04 LTS

2.安装编译环境:命令行输入 sudo apt-get update ,然后输入 

sudo apt-get -y install build-essential asciidoc binutils bzip2 gawk gettext \
git libncurses5-dev libz-dev patch python3.5 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 ccache mercurial

3.使用 git clone https://github.com/coolsnowwolf/lede 命令下载好源代码,然后 cd lede 进入目录

4.下载源码后进入源码目录用Vi编辑器打开feeds.conf.default文件,去掉如下代码中的#号后保存:

#src-git helloworld https://github.com/fw876/helloworld

5.配置编译选项

./scripts/feeds update -a
./scripts/feeds install -a
make menuconfig

设置自己的路由器:

如果是zbt wr8305rt则:
Target System选择 "MediaTek Ralink MIPS"
Subtarget选择"MT7621"
Target Profile选择"ZBT WR8305RT"

根据自己的需求选择对应的功能,参考配置地址:

https://blog.csdn.net/weiniliuchao/article/details/49277023

6.make -j1 download v=s 下载dl库(国内请尽量全局科学上网)

7.输入 make -j1 V=s (-j 后面的数字1是线程数。第一次编译推荐用单线程)即可开始编译你要的固件了。

如果编译出错:#error GNU libiconv not in use but included iconv.h is from libiconv

解决办法:

$ cd build_dir/host/pkg-config-*/glib
$ ./configure --enable-iconv=no --with-libiconv=gnu

你可能感兴趣的:(Openwrt,Linux服务器)