- 不要用 root 用户 git 和编译!!!
- 国内用户编译前最好准备好梯子
- 默认登陆IP 192.168.1.1, 密码 password
-
首先装好 Ubuntu 64bit,推荐 Ubuntu 18 LTS x64
-
命令行输入
sudo apt-get update
,然后输入sudo apt-get -y install build-essential asciidoc binutils bzip2 gawk gettext git libncurses5-dev libz-dev patch python3.5 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
-
使用
git clone https://github.com/coolsnowwolf/lede
命令下载好源代码,然后cd lede
进入目录 -
./scripts/feeds update -a ./scripts/feeds install -a make menuconfig
-
make -j8 download V=s
下载dl库(国内请尽量全局科学上网) -
输入
make -j1 V=s
(-j1 后面是线程数。第一次编译推荐用单线程)即可开始编译你要的固件了。
本套代码保证肯定可以编译成功。里面包括了 R20 所有源代码,包括 IPK 的。
二次编译:
cd lede
git pull
./scripts/feeds update -a && ./scripts/feeds install -a
make defconfig
make -j8 download
make -j$(($(nproc) + 1)) V=s
如果需要重新配置:
rm -rf ./tmp && rm -rf .config
make menuconfig
make -j$(($(nproc) + 1)) V=s
编译完成后输出路径:/lede/bin/targets
编译完成,可以在 lede/bin/targets/ramips/mt7621 下找到编译生成的文件,我们需要的是 openwrt-ramips-mt7621-k2p-initramfs-kernel.bin 和 openwrt-ramips-mt7621-k2p-squashfs-sysupgrade.bin 这两个文件。首先在 breed 下刷入 kernel 镜像,闪存布局选择 “斐讯 0xA0000”,然后重启登录 LuCI 之后再通过系统 - 备份 / 升级,不保留配置刷入 sysupgrade 镜像,等待重启,笔者当时刷写的时候选的公版也没翻车(大雾示范)。(其实如果只有一个镜像的话直接 breed 刷 sysupgrade 镜像就可以了)
Update 2019/8/13: 关于固件刷写,Opboot 和 breed 有所不同,参考恩山的这篇帖子,breed 直接刷 squashfs-sysupgrade, opboot 先刷 initramfs-kernel,开机后再从系统里刷 squashfs-sysupgrade。
1.源代码中绝不含任何后门和可以监控或者劫持你的 HTTPS 的闭源软件,SSL 安全是互联网最后的壁垒。安全干净才是固件应该做到的;
2.如有技术问题需要讨论,欢迎加入 QQ 讨论群:OP共享技术交流群 ,号码 297253733 ,加群链接: 点击链接加入群聊【OP共享技术交流群】:点击加入
如需安装https则 进入LUCI-collection,选择luci-ssl-openssl(按Y,后面一样) 如需定制ddns,默认情况下 OpenWrt 中并没有 Cloudflare DDNS 功能,需要在编译时选择相应的组件,其位置在 Network→IP Addresses and Names
-
DO NOT USE ROOT USER TO CONFIGURE!!!
-
Login IP is 192.168.1.1 and login password is "password".
First, you need a computer with a linux system. It's better to use Ubuntu 18 LTS 64-bit.
Next you need gcc, binutils, bzip2, flex, python3.5+, perl, make, find, grep, diff, unzip, gawk, getopt, subversion, libz-dev and libc headers installed.
To install these program, please login root users and type
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
in terminal
Third, logout of root users. And type this git clone https://github.com/coolsnowwolf/lede
in terminal to clone this source.
After these please type cd lede
to cd into the source.
Please Run ./scripts/feeds update -a
to get all the latest package definitions
defined in feeds.conf
/ feeds.conf.default
respectively
and ./scripts/feeds install -a
to install symlinks of all of them into
package/feeds/
.
Please use make menuconfig
to choose your preferred
configuration for the toolchain and firmware.
Use make menuconfig
to configure your image.
Simply running make
will build your firmware.
It will download all sources, build the cross-compile toolchain,
the kernel and all choosen applications.
To build your own firmware you need to have access to a Linux, BSD or MacOSX system (case-sensitive filesystem required). Cygwin will not be supported because of the lack of case sensitiveness in the file system.