-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathfix.sh
executable file
·127 lines (108 loc) · 4.87 KB
/
fix.sh
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
#########################################################################
# File Name: fix.sh
# Author: Carbon (ecrasy@gmail.com)
# Description: feel free to use
# Created Time: 2022-07-30 04:57:44 UTC
# Modified Time: 2025-01-27 02:29:03 UTC
#########################################################################
#!/bin/bash
# fix error from https://github.com/openwrt/luci/issues/5373
# luci-app-statistics: misconfiguration shipped pointing to non-existent directory
str="^[^#]*option Include '/etc/collectd/conf.d'"
cmd="s@$str@#&@"
sed -ri "$cmd" feeds/luci/applications/luci-app-statistics/root/etc/config/luci_statistics
echo "Fix luci-app-statistics ref wrong path error"
# fix stupid coremark benchmark error
touch package/base-files/files/etc/bench.log
chmod 0666 package/base-files/files/etc/bench.log
echo "Touch coremark log file to fix uhttpd error!!!"
# fix python3.9.12 sys version parse error
# python3_path="feeds/packages/lang/python/python3"
# cp $GITHUB_WORKSPACE/data/patches/lib-platform-sys-version.patch ${python3_path}/patches/
# echo "Fix python host compile install error!!!"
# Try dnsmasq v2.90 pkg version 3
dnsmasq_path="package/network/services/dnsmasq"
dnsmasq_ver=$(grep -m1 'PKG_UPSTREAM_VERSION:=2.90' ${dnsmasq_path}/Makefile)
dnsmasq_pkg=$(grep -m1 'PKG_RELEASE:=3' ${dnsmasq_path}/Makefile)
if [ -z "${dnsmasq_ver}" ]; then
rm -rf $dnsmasq_path
cp $GITHUB_WORKSPACE/data/etc/ipcalc.sh package/base-files/files/bin/ipcalc.sh
cp -r $GITHUB_WORKSPACE/data/dnsmasq ${dnsmasq_path}
echo "Try dnsmasq v2.90 with pkg 2"
else
# upgrade dnsmasq to pkg version 3
if [ -z "${dnsmasq_pkg}" ]; then
# rm -rf $dnsmasq_path
# cp $GITHUB_WORKSPACE/data/etc/ipcalc.sh package/base-files/files/bin/ipcalc.sh
# cp -r $GITHUB_WORKSPACE/data/dnsmasq ${dnsmasq_path}
echo "dnsmasq v2.90 is not ready for pkg 3"
fi
fi
# Try golang v1.23.4
golang_path="feeds/packages/lang/golang"
golang_ver=$(grep -m1 'GO_VERSION_MAJOR_MINOR:=1.23' ${golang_path}/golang/Makefile)
golang_pkg=$(grep -m1 'GO_VERSION_PATCH:=4' ${golang_path}/golang/Makefile)
if [ -z "${golang_ver}" ]; then
rm -rf $golang_path
cp -r $GITHUB_WORKSPACE/data/golang ${golang_path}
echo "Try golang v1.23.4"
else
# upgrade golang to pkg version 4
if [ -z "${golang_pkg}" ]; then
rm -rf $golang_path
cp -r $GITHUB_WORKSPACE/data/golang ${golang_path}
echo "upgrade golang to v1.23.4"
fi
fi
# Try v2ray-core v5.26.0 with golang v1.23
v2ray_path="feeds/packages/net/v2ray-core"
v2ray_ver=$(grep -m1 'PKG_VERSION:=5.26.0' ${v2ray_path}/Makefile)
if [ -z "${v2ray_ver}" ]; then
rm -rf $v2ray_path
cp -r $GITHUB_WORKSPACE/data/v2ray-core ${v2ray_path}
echo "Try v2ray-core v5.26.0"
fi
# make minidlna depends on libffmpeg-full not libffmpeg
# little bro ffmpeg mini custom be gone
sed -i "s/libffmpeg /libffmpeg-full /g" feeds/packages/multimedia/minidlna/Makefile
echo "Set minidlna depends on libffmpeg-full not libffmpeg"
# make cshark depends on libustream-openssl not libustream-mbedtls
# i fucking hate stupid mbedtls so much, be gone
sed -i "s/libustream-mbedtls/libustream-openssl/g" feeds/packages/net/cshark/Makefile
echo "Set cshark depends on libustream-openssl not libustream-mbedtls"
# remove ipv6-helper depends on odhcpd*
sed -i "s/+odhcpd-ipv6only//g" feeds/CustomPkgs/net/ipv6-helper/Makefile
echo "Remove ipv6-helper depends on odhcpd*"
# remove hnetd depends on odhcpd*
sed -i "s/+odhcpd//g" feeds/routing/hnetd/Makefile
echo "Remove hnetd depends on odhcpd*"
# make shairplay depends on mdnsd not libavahi-compat-libdnssd
shairplay_path=feeds/packages/sound/shairplay/Makefile
if [ -f ${shairplay_path} ]; then
sed -i "s/+libavahi-compat-libdnssd/+mdnsd/g" ${shairplay_path}
echo "Set shairplay depends on mdnsd not libavahi-compat-libdnssd"
fi
# set v2raya depends on v2ray-core
sed -i "s/xray-core/v2ray-core/g" feeds/packages/net/v2raya/Makefile
echo "set v2raya depends on v2ray-core"
# upgrade libtorrent-rasterbar to version 2.0.9
RAS_PATH="feeds/packages/libs/libtorrent-rasterbar"
RAS_VER=$(grep -m1 'PKG_VERSION:=2.0.8' ${RAS_PATH}/Makefile)
if [ -n "${RAS_VER}" ]; then
rm -rf ${RAS_PATH}
cp -r $GITHUB_WORKSPACE/data/app/libtorrent-rasterbar feeds/packages/libs/
echo "Try libtorrent-rasterbar v2.0.9 for qBittorrent"
fi
RRDTOOL_PATH="feeds/packages/utils/rrdtool1"
RRDTOOL_URL=$(grep -m1 'PKG_SOURCE_URL:= \\' ${RRDTOOL_PATH}/Makefile)
if [ -n "${RRDTOOL_URL}" ]; then
cp $GITHUB_WORKSPACE/data/patches/rrdtool1-Makefile ${RRDTOOL_PATH}/Makefile
echo "Fix rrdtool1 package url mirrors error"
fi
GD_PATH="feeds/packages/utils/gptfdisk"
GD_VER=$(grep -m1 'PKG_VERSION:=1.0.9' ${GD_PATH}/Makefile)
if [ -n "${GD_VER}" ]; then
sed -i '0,/^TARGET_CXXFLAGS.*/s/^TARGET_CXXFLAGS.*/TARGET_CFLAGS += -D_LARGEFILE64_SOURCE\n&/' ${GD_PATH}/Makefile
echo "Fix gptfdisk compile error"
fi
echo -e "Fixing Jobs Completed!!!\n"