编译 openwrt 19.07 稳定版 + lean lede的插件

想使用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

cd openwrt
./scripts/feeds update -a && ./scripts/feeds install -a 
make menuconfig

编译

make -j1 V=s

补充:刷完之后路由界面 固件版本 OpenWrt R9xxxxx什么的,登录ssh看一下,正常应该能看到是稳定版 OpenWrt 19.07.0, r10860-a3ffeb413b
修改 /etc/openwrt_release 里面 DISTRIB_DESCRIPTION= 为稳定版本号就行,事实上已经是稳定版了…