想使用openwrt官方稳定版,又想用lean’s lede固件里的插件???
先建一个目录,下载源码,进去
mkdir wrt32xopenwrt_stab_lean_plugin cd wrt32xopenwrt_stab_lean_plugin git clone https://github.com/openwrt/openwrt.git git clone https://github.com/coolsnowwolf/lede.git
进openwrt目录,选择稳定版
cd openwrt git tag
显示
reboot v17.01.0 v17.01.0-rc1 v17.01.0-rc2 v17.01.1 v17.01.2 v17.01.3 v17.01.4 v17.01.5 v17.01.6 v17.01.7 v18.06.0 v18.06.0-rc1 v18.06.0-rc2 v18.06.1 v18.06.2 v18.06.3 v18.06.4 v18.06.5 v18.06.6 v19.07.0 v19.07.0-rc1 v19.07.0-rc2
git branch
显示
* master
使用 19.07.0 稳定版
git checkout v19.07.0
显示
Note: checking out 'v19.07.0'. You are in 'detached HEAD' state. You can look around, make experimental changes and commit them, and you can discard any commits you make in this state without impacting any branches by performing another checkout. If you want to create a new branch to retain commits you create, you may do so (now or later) by using -b with the checkout command again. Example: git checkout -b <new-branch-name> HEAD is now at aca39acedf OpenWrt v19.07.0: adjust config defaults
退到上级目录,拷贝lede/package/lean文件夹到openwrt/package 里面
cd .. cp -R lede/package/lean openwrt/package/
使用lean lede里的旧版luci (新版luci配合lean插件可能会出错)
mv openwrt/feeds.conf.default openwrt/feeds.conf.default.openwrt_old cp lede/feeds.conf.default openwrt/feeds.conf.default
xxr plus 插件
src-git helloworld https://github.com/fw876/helloworld
添加到openwrt的feeds里
自定义默认安装的包
编辑openwrt/include/target.mk
DEFAULT_PACKAGES:=base-files libc libgcc busybox dropbear mtd uci opkg netifd fstools uclient-fetch logd urandom-seed urngd 换成 DEFAULT_PACKAGES:=base-files libc libgcc busybox dropbear mtd uci opkg netifd fstools uclient-fetch logd default-settings luci luci-app-upnp luci-app-autoreboot luci-app-ssr-plus luci-app-vlmcsd luci-app-ramfree luci-app-flowoffload --------- DEFAULT_PACKAGES.router:=dnsmasq iptables ip6tables ppp ppp-mod-pppoe firewall odhcpd-ipv6only odhcp6c kmod-ipt-offload 换成 DEFAULT_PACKAGES.router:=dnsmasq-full iptables ppp ppp-mod-pppoe firewall kmod-ipt-offload
应用fullconenat
拷贝lede/package/network/config/firewall/里的Makefile文件及patches文件夹到openwrt下面的同目录里,覆盖openwrt官方的
cp lede/package/network/config/firewall/Makefile openwrt/package/network/config/firewall/Makefile cp -R lede/package/network/config/firewall/patches openwrt/package/network/config/firewall/
修改 活动连接数
编辑 openwrt/package/kernel/linux/files/sysctl-nf-conntrack.conf
net.netfilter.nf_conntrack_max=16384 改成 net.netfilter.nf_conntrack_max=65535
修改路由ip地址/主机名 改成自己的
openwrt/package/base-files/files/bin/config_generate
lan) ipad=${ipaddr:-"192.168.1.1"} ;; set system.@system[-1].hostname='OpenWrt'
进 openwrt 更新,配置镜像相关,参考上篇 https://ihaoge.com/archives/1035.html
# openwrt 19.07.2 之后貌似少了libpcre(少了可能导致编译ss失败),要把lede源码里的pcre拷贝到openwrt libs下,编译选择界面才能显示。 cp -R lede/package/libs/pcre openwrt/package/libs/ cd openwrt ./scripts/feeds update -a && ./scripts/feeds install -a make menuconfig #要选中Libraries-- <*> libpcre..... --- [*] Enable JIT compiler support (NEW) cd ..
以下是配置好系统之后要做的:
————2020.09.26新增一些补充—-
upx 错误
bash: *******/openwrt/staging_dir/host/bin/upx: No such file or directory
把 /usr/bin/upx 复制到 ******/openwrt/staging_dir/host/bin/upx
解决:
cp /usr/bin/upx openwrt/staging_dir/host/bin/upx
————
zst解包错误: 由于zst新版本采用新的压缩包格式,openwrt里的解包源码还没有修正
解决:
rm -rf openwrt/include/unpack.mk && wget https://raw.githubusercontent.com/coolsnowwolf/lede/master/include/unpack.mk -O openwrt/include/unpack.mk
————
python版本错误: 默认指向python2.7 会导致出错
Traceback (most recent call last): File "****/openwrt/staging_dir/hostpkg/lib/meson/meson.py", line 26, in <module> from mesonbuild import mesonmain File "****/openwrt/staging_dir/hostpkg/lib/meson/mesonbuild/mesonmain.py", line 23, in <module> from . import mesonlib File "****/openwrt/staging_dir/hostpkg/lib/meson/mesonbuild/mesonlib.py", line 67 def git(cmd: T.List[str], workingdir: str, **kwargs: T.Any) -> subprocess.CompletedProcess: ^ SyntaxError: invalid syntax
解决:
sudo apt install python3 && sudo apt install python3-pip python-pip sudo pip3 install pathlib && sudo pip install pathlib rm -rf openwrt/staging_dir/host/bin/python && ln -s /usr/bin/python3.6 openwrt/staging_dir/host/bin/python
————
编译
cd openwrt make -j1 V=s
补充:刷完之后路由界面 固件版本 OpenWrt R9xxxxx什么的,登录ssh看一下,正常应该能看到是稳定版 OpenWrt 19.07.0, r10860-a3ffeb413b
修改 /etc/openwrt_release 里面 DISTRIB_DESCRIPTION= 为稳定版本号就行,事实上已经是稳定版了…