mirror of
https://github.com/coolsnowwolf/lede.git
synced 2025-04-16 14:23:38 +00:00
140 lines
4.8 KiB
Markdown
140 lines
4.8 KiB
Markdown
欢迎来到Lean的Openwrt源码仓库!
|
||
=
|
||
|
||
[English](./README_EN.md)
|
||
|
||
QCA IPQ6000 (GL.iNet GL-AX1800)系列固件仓库地址:
|
||
[https://github.com/coolsnowwolf/openwrt-gl-ax1800](https://github.com/coolsnowwolf/openwrt-gl-ax1800)
|
||
-
|
||
|
||
如何编译自己需要的 OpenWrt 固件
|
||
-
|
||
注意:
|
||
-
|
||
1. **不**要用 **root** 用户进行编译!!!
|
||
2. 国内用户编译前最好准备好梯子
|
||
3. 默认登陆IP 192.168.1.1 密码 password
|
||
|
||
|
||
编译命令如下:
|
||
-
|
||
1. 首先装好 Ubuntu 64bit,推荐 Ubuntu 20.04 LTS x64
|
||
|
||
2. 命令行输入 `sudo apt-get update` ,然后输入
|
||
`
|
||
sudo apt-get -y 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
|
||
`
|
||
|
||
3. 使用 `git clone https://github.com/coolsnowwolf/lede` 命令下载好源代码,然后 `cd lede` 进入目录
|
||
|
||
4. ```bash
|
||
./scripts/feeds update -a
|
||
./scripts/feeds install -a
|
||
make menuconfig
|
||
```
|
||
|
||
5. `make -j8 download V=s` 下载dl库(国内请尽量全局科学上网)
|
||
|
||
6. 输入 `make -j1 V=s` (-j1 后面是线程数。第一次编译推荐用单线程)即可开始编译你要的固件了。
|
||
|
||
本套代码保证肯定可以编译成功。里面包括了 R21 所有源代码,包括 IPK 的。
|
||
|
||
你可以自由使用,但源码编译二次发布请注明我的 GitHub 仓库链接。谢谢合作!
|
||
=
|
||
|
||
二次编译:
|
||
```bash
|
||
cd lede
|
||
git pull
|
||
./scripts/feeds update -a && ./scripts/feeds install -a
|
||
make defconfig
|
||
make -j8 download
|
||
make -j$(($(nproc) + 1)) V=s
|
||
```
|
||
|
||
如果需要重新配置:
|
||
```bash
|
||
rm -rf ./tmp && rm -rf .config
|
||
make menuconfig
|
||
make -j$(($(nproc) + 1)) V=s
|
||
```
|
||
|
||
编译完成后输出路径:bin/targets
|
||
|
||
如果你使用WSL或WSL2进行编译:
|
||
------
|
||
由于wsl的PATH路径中包含带有空格的Windows路径,有可能会导致编译失败,请在将make -j1 V=s或make -j$(($(nproc) + 1)) V=s改为
|
||
|
||
首次编译:
|
||
```bash
|
||
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin make -j1 V=s
|
||
```
|
||
二次编译:
|
||
```bash
|
||
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin make -j$(($(nproc) + 1)) V=s
|
||
```
|
||
------
|
||
macOS 原生系统进行编译:
|
||
------
|
||
1.在 AppStore 中安装 Xcode
|
||
|
||
2. 安装 Homebrew:
|
||
```bash
|
||
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
|
||
```
|
||
|
||
3. 使用 Homebrew 安装工具链、依赖与基础软件包:
|
||
```bash
|
||
brew unlink awk
|
||
brew install coreutils diffutils findutils gawk gnu-getopt gnu-tar grep wget quilt xz
|
||
brew install gcc@11
|
||
```
|
||
|
||
4.然后输入以下命令,添加到系统环境变量中:
|
||
```bash
|
||
echo 'export PATH="/usr/local/opt/coreutils/libexec/gnubin:$PATH"' >> ~/.bashrc
|
||
echo 'export PATH="/usr/local/opt/findutils/libexec/gnubin:$PATH"' >> ~/.bashrc
|
||
echo 'export PATH="/usr/local/opt/gnu-getopt/bin:$PATH"' >> ~/.bashrc
|
||
echo 'export PATH="/usr/local/opt/gnu-tar/libexec/gnubin:$PATH"' >> ~/.bashrc
|
||
echo 'export PATH="/usr/local/opt/grep/libexec/gnubin:$PATH"' >> ~/.bashrc
|
||
echo 'export PATH="/usr/local/opt/gnu-sed/libexec/gnubin:$PATH"' >> ~/.bashrc
|
||
echo 'export PATH="/usr/local/opt/make/libexec/gnubin:$PATH"' >> ~/.bashrc
|
||
```
|
||
|
||
4.重新加载一下 shell 启动文件
|
||
```bash
|
||
source ~/.bashrc
|
||
```
|
||
|
||
然后输入 bash 命令,进入bash shell,就可以和 Linux 一样正常编译了
|
||
|
||
------
|
||
|
||
特别提示:
|
||
------
|
||
1. 源代码中绝不含任何后门和可以监控或者劫持你的 HTTPS 的闭源软件, SSL 安全是互联网最后的壁垒。安全干净才是固件应该做到的;
|
||
|
||
2. 如有技术问题需要讨论,欢迎加入 QQ 讨论群: OP 共享技术交流群 ,号码 297253733 ,加群链接: 点击链接加入群聊【 OP 共享技术交流群】:[点击加入](https://jq.qq.com/?_wv=1027&k=5yCRuXL "OP共享技术交流群")
|
||
|
||
3. 想学习 OpenWrt 开发,但是摸不着门道?自学没毅力?基础太差?怕太难学不会?跟着佐大学 OpenWrt 开发入门培训班助你能学有所成
|
||
报名地址:[点击报名](http://forgotfun.org/2018/04/openwrt-training-2018.html "报名")
|
||
|
||
## 软路由介绍
|
||
友情推荐不恰饭:如果你在寻找一个低功耗小体积性能不错的 x86 / x64 路由器,我个人建议可以考虑
|
||
小马v1 的铝合金版本 ( N3710 4千兆):[页面介绍](https://item.taobao.com/item.htm?spm=a230r.1.14.20.144c763fRkK0VZ&id=561126544764 " 小马v1 的铝合金版本")
|
||
|
||

|
||

|
||
|
||
## 捐贈
|
||
|
||
如果你觉得此项目对你有帮助,可以捐助我们,以鼓励项目能持续发展,更加完善
|
||
|
||
### 支付宝
|
||
|
||

|
||
|
||
### 微信
|
||
|
||

|