OpenWrt Club OpenWrt Club
  • 首页
  • OpenWrt系统
  • OpenWrt插件
  • OpenWrt固件
  • 友人帐
  • OpneWrt 论坛
首页 › OpenWrt系统 › 树莓派移植Lean插件到OpenWrt官方源码里
  • 4
  • 0
  • 1

树莓派移植Lean插件到OpenWrt官方源码里

萝卜
6 年前

准备工作

虽然Lean大神的固件很稳定很好用,但是之前对ARM64平台支持的不是很好,比如我的树莓派3b+就没有WiFi,但是有很想用Lean的一些插件,比如ssr+甚是好用,所以折腾一下如何吧Lean大神的一些插件移植到OpenWrt官方的源码中,这里仅做一个记录,在移植过程中还是遇到了很多问题。

搭建环境

开始之前需要搭建一个编译环境,大佬们都说了建议使用Ubuntu 14.04,其实在其他系统也可以完成,你甚至可以用Centos 7来编译,只要编译的依赖能解决就没有问题。

终端下执行:

apt -y install build-essential asciidoc binutils bzip2 gawk gettext git libncurses5-dev patch unzip zlib1g-dev lib32gcc1 libc6-dev-i386 subversion flex node-uglify gcc-multilib p7zip p7zip-full msmtp libssl-dev texinfo libglib2.0-dev xmlto qemu-utils upx-ucl libelf-dev autoconf automake libtool autopoint

克隆OpenWrt和Lean的源码到本地

git clone https://github.com/openwrt/openwrt.git
git clone https://github.com/coolsnowwolf/lede.git

移植插件

上面准备好后把Lean的插件目录拷贝到OpenWrt的官方package 目录下:

cp -r ~/lede/package/lean ~/openwrt/package/lean
cp -r ~/lede/package/libs/librpc ~/openwrt/package/libs

在高版本的Ubuntu系统中会提示找不到kcptun-client ,如果你用不到直接删掉。修改可能报错的文件

vim ~/lede/package/lean/luci-app-ssr-plus/Makefile

删除掉一下行

#在Ubuntu 14.04不用修改
+PACKAGE_$(PKG_NAME)_INCLUDE_Kcptun:kcptun-client \

应用fullconenat

cp -r ~/lede/package/network/config/firewall/Makefile ~/openwrt/package/network/config/firewall/
cp -r ~/lede/package/network/config/firewall/patches ~/openwrt/package/network/config/firewall/

或者直接拷贝patches文件到对应目录后修改openwrt的firewall Makefile,在DEPENDS最后添加+iptables-mod-fullconenat
最后变成

DEPENDS:=+libubox +libubus +libuci +libip4tc +IPV6:libip6tc +libxtables +kmod-ipt-core +kmod-ipt-conntrack +IPV6:kmod-nf-conntrack6 +kmod-ipt-nat +iptables-mod-fullconenat

更新插件包

./scripts/feeds update -a && ./scripts/feeds install -a

如果在Ubuntu 14.04.6中可能会有以下错误:

Build dependency: Please install Python >= 3.5
Build dependency: Please install Python >= 3.5

系统默认安装了Python3.4 所以达不到要求,解决办法就是安装Python3.5以上的版本

sudo apt install -y python3.5 python3.5-dev libncurses5-dev
sudo mv /usr/bin/python3 /usr/bin/python3-old
sudo ln -s /usr/bin/python3.5 /usr/bin/python3

如果以后想切换回原先的版本可以这么做:

sudo rm /usr/bin/python3
sudo mv /usr/bin/python3-old /usr/bin/python3

修改连接数

package/kernel/linux/files/sysctl-nf-conntrack.conf
net.netfilter.nf_conntrack_max=65535

按需配置

以上修改后选择你要编译的平台后保存

make defconfig
make menuconfig

预下载编译依赖,最好每次修改后都进行一次预下载,编译过程很多的时间都浪费在了依赖下载,重要的是一些下载网站是被强的,所以每次做之前必须全局代理,或者到eSir的谷歌网盘下载dl文件放到主目录即可。

make download V=s

开始编译

make V=s -j1

LEDE OpenWrt 固件编译
4
0
如何编译一个属于自己的OpenWrt固件
上一篇
树莓派Lean大雕OpenWrt固件之编译篇
下一篇

评论 (1)

再想想
  • cattypapa

    大佬你好,不知道你最近是否有空。我现在尝试编译官方openwrtv19.07.7的源码+lean的插件,但是遇到了一个编译错误。一直无法解决,不知道大佬有空能不能帮我一下,感激。下面是编译遇到的错误代码:
    go: finding github.com/lucas-clemente/quic-go v0.20.1
    go: finding golang.org/x/sys v0.0.0-20210415045647-66c3f260301c
    go: finding golang.org/x/crypto v0.0.0-20210415154028-4f45737414dc
    go: finding github.com/cheekybits/genny v1.0.0
    build github.com/shadowsocks/v2ray-plugin: cannot load io/fs: malformed module path “io/fs”: missing dot in first path element

    Building targets
    build .: cannot find module for path .

    Cleaning module download cache (golang/go#27455)

    make[3]: *** [Makefile:74: /home/catty/openwrt/build_dir/target-aarch64_generic_musl/v2ray-plugin-4.38.3/.built] Error 1
    make[3]: Leaving directory ‘/home/catty/openwrt/package/helloworld/v2ray-plugin’
    time: package/helloworld/v2ray-plugin/compile#1.19#0.80#15.59
    make[2]: *** [package/Makefile:113: package/helloworld/v2ray-plugin/compile] Error 2

    4 年前

聚合文章

解决OpenWrt 挂载Overlay 分区重启失效
OpenWrt 使用 Luci-app-frpc 配合Docker 内网穿透
OpenWrt 利用Docker 搭建Cloud Torrent 下载BT/PT种子
Ubuntu 18.04 编译OpenWRT遇到libwebsockets 重复问题

猜你喜欢

树莓派Lean大雕OpenWrt固件之食用 Docker 篇

树莓派Lean大雕OpenWrt固件之食用 Docker 篇

6 年前
12,370 54 10
OpenWrt 源码编译修改默认IP地址和网关DNS地址

OpenWrt 源码编译修改默认IP地址和网关DNS地址

6 年前
11,345 3 9
解决OpenWrt 挂载Overlay 分区重启失效

解决OpenWrt 挂载Overlay 分区重启失效

2 年前
1,055 0 0
OpenWrt 利用docker-compose 搭建网站环境

OpenWrt 利用docker-compose 搭建网站环境

6 年前
6,244 2 3
1 4
Copyright © 2019-2025 OpenWrt Club. Designed by nicetheme.
  • 首页
  • OpenWrt系统
  • OpenWrt插件
  • OpenWrt固件
  • 友人帐
  • OpneWrt 论坛

萝卜

茕茕孑立,孑孓而行。
14
文章
36
评论
107
喜欢