forked from coolsnowwolf/lede
-
Notifications
You must be signed in to change notification settings - Fork 0
/
info
240 lines (195 loc) · 13.1 KB
/
info
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
Welcome to Lean's git source of OpenWrt and packages
中文:如何编译自己需要的 OpenWrt 固件
注意:
1.不要用 root 用户 git 和编译!!!
2.国内用户编译前最好准备好梯子
3.默认登陆IP 192.168.2.187
4.WSL系统代理设置如下:
export http_proxy=http://127.0.0.1:1080
export https_proxy=http://127.0.0.1:1080
export ftp_proxy=http://127.0.0.1:1080
打开22端口的命令如下:(用于实现用notepad++远程连接提wsl)
sudo service ssh start
若要定制openwrt信息,请修改package/lean/zzz-default-setting文件中的openwrt_release值
编译命令如下:
1. 首先装好Linux系统,推荐 Debian 11 或 Ubuntu LTS
2. 安装编译依赖
sudo apt full-upgrade -y
sudo apt update -y
sudo apt install -y ack antlr3 asciidoc autoconf automake autopoint binutils bison build-essential \
bzip2 ccache cmake cpio curl device-tree-compiler fastjar flex gawk gettext gcc-multilib g++-multilib \
git gperf haveged help2man intltool libc6-dev-i386 libelf-dev libglib2.0-dev libgmp3-dev libltdl-dev \
libmpc-dev libmpfr-dev libncurses5-dev libncursesw5-dev libreadline-dev libssl-dev libtool lrzsz \
mkisofs msmtp nano ninja-build p7zip p7zip-full patch pkgconf python2.7 python3 python3-pyelftools \
libpython3-dev qemu-utils rsync scons squashfs-tools subversion swig texinfo uglifyjs upx-ucl unzip \
vim wget xmlto xxd zlib1g-dev python3-setuptools
3. git clone https://github.com/coolsnowwolf/lede 命令下载好源代码,然后 cd lede 进入目录
4. 加入kiddin9的openwrt-packages:
vi feeds.conf.default加入(按i进入可编辑状态,按esc退出编辑状态;:q退出编辑,:q!强制退出编辑,:w!强制写入)
src-git kiddin9 https://github.com/kiddin9/openwrt-packages.git
5. Lienol的passwall停更了,代码仓库也删除了需要加入passwall:
vi feeds.conf.default加入
src-git Kisoul https://github.com/Kisoul/Lienol-openwrt-packages-backup
6. 加入kenzok8的openwrt-packages:
vi feeds.conf.default加入
src-git kenzo https://github.com/kenzok8/openwrt-packages(稳定更新,需要同时挂载passwall依赖库)
src-git smpackage https://github.com/kenzok8/small-package(最新更新,如果出现Libiptext、Libiptext6等错信息、或Lean源码编译出错的情况,请尝试删除冲突的插件(运行./scripts/feeds update -a后操作)rm -rf feeds/smpackage/{base-files,dnsmasq,firewall*,fullconenat,libnftnl,nftables,ppp,opkg,ucl,upx,vsftpd-alt,miniupnpd-iptables,wireless-regdb})
src-git small https://github.com/kenzok8/small(passwall依赖库)
src-git xiaorouji https://github.com/xiaorouji/openwrt-passwall.git(passwall最新依赖库)
7. Lean大的SSR-Plus代码:
vi feeds.conf.default加入
src-git helloworld https://github.com/fw876/helloworld(ssrplus)
8. 同步插件代码并开始设置menu
./scripts/feeds clean
./scripts/feeds update -a
./scripts/feeds install -a
make menuconfig
9. 取消无线驱动
kernel modules -> Wireless Drivers -> 取消所有勾选
network -> WirelessAPD -> 取消hostapd相关的所有勾选(hostapd, hostapd-common(与wpad关联), hostapd-common-old, hostapd-mini)
10. 增加nfs-v3功能
network -> Filesystem -> nfs-kernel-server
11. 增加ipv6
Extra packages -> ipv6helper (选择后下面选项会自动勾选)
Network -> odhcp6c
Network -> odhcpd-ipv6only
LuCI -> Protocols -> luci-proto-ipv6
LuCI -> Protocols -> luci-proto-ppp
12. 增加kmod-nls-cp936支持简体中文
kernel modules -> Native Language Support -> kmod-nls-cp936
13. 增加ntfs-3g支持
Utilities -> Filesystem -> ntfs-3g [1.use external FUSE library, selects package libfuse; 2.install the ntfs-3g.probe utility(*)]
kernel modules -> Filesystems -> kmod-fuse
14. 为openclash增加kmod-inet-diag.ipk
kernel modules -> Network Support -> kmod-inet-diag
15. 修改内核示例 sed -i 's/KERNEL_PATCHVER:=5.15/KERNEL_PATCHVER:=5.19/g' ./target/linux/x86/Makefile 也可以直接修改./target/linux/x86/Makefile文件中的KERNEL_PATCHVER值。
最后选好你要的路由,输入 make -j1 V=s (-j1 后面是线程数。第一次编译推荐用单线程,国内请尽量全局科学上网)即可开始编译你要的固件了。
16. 第二次编译:
cd lede # 进入LEDE目录
git pull # 同步更新大雕源码
./scripts/feeds update -a && ./scripts/feeds install -a # 更新Feeds
rm -rf ./tmp && rm -rf .config # 清除编译配置和缓存
make menuconfig # 进入编译配置菜单
make -jn V=99 # 开始编译 n=线程数+1,例如4线程的I5填-j5
17. 其他:
(1)采用WSL编译过程中出现“'files/windowsapps/canonicalgrouplimited.ubuntu18.04onwindows_2020.1804.7.0_x64__79rhkp1fndgsc' is included in the path environment variable, which is insecure in combination with the -execdir action of find. please remove that entry from $path”,可以通过运行PATH=$(echo "$PATH" | sed -e 's/:\/mnt.*//g')临时解决(重启WSL失效);或参照https://github.com/microsoft/WSL/issues/1493将windows注册表中的\HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Lxss\{GUID}中的Flags值由7改为5,然后重启WSL。
(2)首次编译时,容易报错:bash: po2lmo: command not found 这应该是因为编译XXXXXXX需要把 luci-base 先编译出来,但是目前顺序可能是先编译了 hello world 导致出现问题,此时使用 make package/feeds/luci/luci-base/compile V=99 编译出 luci-base 后再编译就不会报错。 这个问题虽然出现的频率不高,但是也不低。
(3)kmod-shortcut-fe-cm可能与内核不兼容,需要去掉,取消:Luci-Application -> Include-shortcut-FE-ECM、Kernel modules -> Network Support -> kmod-shortcut-fe-cm;
18.关于Transmission3.00
由于Transmission-Web-Control1.6.1没有更新适配Transmission3.00,导致transmission管理页面打不开,解决办法:
(1)先在软件包中安装transmission-web3.0
(2)运行wget https://gitee.com/styf3501/transmission-web-control/raw/master/install-tr-control-gitee.sh
(3)运行bash install-tr-control-gitee.sh
(4)按1安装;
19.关于Transmission2.94打不开web页面
修改transmission文件找到最后几行代码:vi etc/init.d/transmission
#procd_add_jail transmission log (注释掉这行代码)
procd_add_jail transmission log"$config_file"
procd_add_jail_mount_rw "$download_dir"
procd_add_jail_mount "$web_home" (添加这行代码)
procd_close_instance
或
在源代码/home/kisoul/lede/package/lean/default-settings/files/zzz-default-settings文件中加入如下:
#修复Transmission-web-control
sed -i 's#procd_add_jail transmission log#procd_add_jail_mount "$web_home"#g' /etc/init.d/transmission
或
编译前将transmission中的makefile(可以在我的在线编译代码中找)进行替换
20.关于ddns
openwrt系统日志报ddns wget 8错误,请升级openssl-util到最新版;
21.关于user.info mwan3track[***]: Check (ping) failed for target "114.114.115.115" on interface wan (pppoe-wan*). Current score: 6
出现上面类似错误请在负载均衡中更换上面的ping IP地址(180.76.76.76、119.29.29.29、223.5.5.5)
22.端口转发命令行:
修改firewall:vi etc/config/firewall
config redirect
option target 'DNAT'
option src 'wan'
option dest 'lan'
option proto 'tcp udp'
option src_dport '1216'
option dest_ip '192.168.5.1'
option dest_port '80'
option name 'Internet'
或
在源代码/home/kisoul/lede/package/lean/default-settings/files/zzz-default-settings文件中加入如下:
#增加外网访问test路由的端口转发为“1217”
echo 'config redirect' >> /etc/config/firewall
echo " option target 'DNAT'" >> /etc/config/firewall
echo " option src 'wan'" >> /etc/config/firewall
echo " option dest 'lan'" >> /etc/config/firewall
echo " option proto 'tcp udp'" >> /etc/config/firewall
echo " option src_dport '1217'" >> /etc/config/firewall
echo " option dest_ip '192.168.5.1'" >> /etc/config/firewall
echo " option dest_port '80'" >> /etc/config/firewall
echo " option name 'Internet-test'" >> /etc/config/firewall
23.修改wan口为静态地址“192.168.2.200”&修改物理接口为“eth2”
修改network:vi etc/config/network
config interface 'wan'
option ifname 'eth2'
option proto 'static'
option ipaddr '192.168.2.200'
option netmask '255.255.255.0'
option gateway '192.168.2.1'
option dns '192.168.2.1'
或
在源代码/home/kisoul/lede/package/lean/default-settings/files/zzz-default-settings文件中加入如下:
#修改wan口为静态地址“192.168.2.200”&修改物理接口为“eth2”
sed -i '/wan/,$d' /etc/config/network
echo "config interface 'wan'" >> /etc/config/network
echo " option ifname 'eth2'" >> /etc/config/network
echo " option proto 'static'" >> /etc/config/network
echo " option ipaddr '192.168.2.200'" >> /etc/config/network
echo " option netmask '255.255.255.0'" >> /etc/config/network
echo " option gateway '192.168.2.1'" >> /etc/config/network
echo " option dns '192.168.2.1'" >> /etc/config/network
23.修改Openwrt内网地址"192.168.5.1"
修改network代码,vi /etc/config/network
config interface 'lan'
option type 'bridge'
option ifname 'eth0'
option proto 'static'
option ipaddr '192.168.5.1'(修改这行代码)
option netmask '255.255.255.0'
option ip6assign '60'
或
在源代码/home/kisoul/lede/package/lean/default-settings/files/zzz-default-settings文件中加入如下:
#修改Openwrt内网地址为“192.168.5.1”
sed -i 's/192.168.1.1/192.168.5.1/g' /etc/config/network
24.关于EXSI下openwrt系统日志大量出现“blk_update_request i/o error”样式的错误,是由于虚拟机启用了SCSI硬盘控制器的导致的
解决方案:删除这类控制器,用IDE硬盘控制器。
25.出现alist编译失败的情况,运行命令安装libfuse-dev
sudo apt-get update && sudo apt-get install -y libfuse-dev
如果还是有问题可以替换lede里面的golang组件:将src-git golang https://github.com/kenzok8/golang feeds/packages/lang/golang.git添加到feeds.conf.default中的第一行;
26.遇到transmission或qbittorrent无法运行的情况请回滚到a2a0e5b进行编译:
git checkout a2a0e5b (在./scripts/feeds update -a前运行)
27.增加联发科MT7921、联发科MT7922、高通QCNFA765无线网卡:
firmware -> th11k-firmware-wcn6855(高通QCNFA765)
firmware -> mt7921bt-firmware(联发科MT7921)
firmware -> mt7922bt-firmware(联发科MT792)
Kernel modules -> Wireless Drivers -> kmod-ath11k-pci(高通QCNFA765)
Kernel modules -> Wireless Drivers -> kmod-mt7921-firmware、kmod-mt7921e、kmod-mt7921s、kmod-mt7921u(联发科MT7921)
Kernel modules -> Wireless Drivers -> kmod-mt7921-firmware(联发科MT7921)
Network -> WirelessAPD -> hostapd-common、 wpad-openssl
本套代码保证肯定可以编译成功。里面包括了 R9 所有源代码,包括 IPK 的。
你可以自由使用,但源码编译二次发布请注明我的 GitHub 仓库链接。谢谢合作!
特别提示:
1.源代码中绝不含任何后门和可以监控或者劫持你的 HTTPS 的闭源软件,SSL 安全是互联网最后的壁垒。安全干净才是固件应该做到的;
2.如有技术问题需要讨论,欢迎加入 QQ 讨论群:OP共享技术交流群 ,号码 297253733 ,加群链接: 点击链接加入群聊【OP共享技术交流群】:https://jq.qq.com/?_wv=1027&k=5yCRuXL
3.想学习OpenWrt开发,但是摸不着门道?自学没毅力?基础太差?怕太难学不会?跟着佐大学OpenWrt开发入门培训班助你能学有所成
报名地址:http://forgotfun.org/2018/04/openwrt-training-2018.html
Please use "make menuconfig" to choose your preferred
configuration for the toolchain and firmware.
You need to have installed gcc, binutils, bzip2, flex, python, perl, make,
find, grep, diff, unzip, gawk, getopt, subversion, libz-dev and libc headers.
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/.
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.
Note: Addition Lean's private package source code in ./package/lean directory. Use it under GPL v3.
GPLv3 is compatible with more licenses than GPLv2: it allows you to make combinations with code that has specific kinds of additional requirements that are not in GPLv3 itself. Section 7 has more information about this, including the list of additional requirements that are permitted.