2021-08-19 02:56:50 +08:00
config_file_turboacc = ` find package/ -follow -type f -path '*/luci-app-turboacc/root/etc/config/turboacc' `
sed -i "s/option hw_flow '1'/option hw_flow '0'/" $config_file_turboacc
sed -i "s/option sfe_flow '1'/option sfe_flow '0'/" $config_file_turboacc
sed -i "s/option sfe_bridge '1'/option sfe_bridge '0'/" $config_file_turboacc
sed -i "/dep.*INCLUDE_.*=n/d" ` find package/ -follow -type f -path '*/luci-app-turboacc/Makefile' `
2021-03-17 13:32:31 +08:00
2021-09-14 08:47:06 +08:00
sed -i "s/option limit_enable '1'/option limit_enable '0'/" ` find package/ -follow -type f -path '*/nft-qos/files/nft-qos.config' `
2022-03-23 02:50:36 +08:00
sed -i "s/option enabled '1'/option enabled '0'/" ` find package/ -follow -type f -path '*/vsftpd-alt/files/vsftpd.uci' `
2021-08-19 02:56:50 +08:00
sed -i "/\/etc\/coremark\.sh/d" ` find package/ -follow -type f -path '*/coremark/coremark' `
2021-03-17 14:17:35 +08:00
sed -i 's/192.168.1.1/192.168.2.1/' package/base-files/files/bin/config_generate
2021-04-13 17:14:54 +08:00
sed -i 's/=1/=0/g' package/kernel/linux/files/sysctl-br-netfilter.conf
2021-03-17 14:17:35 +08:00
2021-08-19 02:56:50 +08:00
sed -i '/DEPENDS+/ s/$/ +wsdd2/' ` find package/ -follow -type f -path '*/ksmbd-tools/Makefile' `
sed -i 's/ +ntfs-3g/ +ntfs3-mount/' ` find package/ -follow -type f -path '*/automount/Makefile' `
sed -i '/skip\=/ a skip=`mount | grep -q /dev/$device; echo $?`' ` find package/ -follow -type f -path */automount/files/15-automount`
2021-03-27 02:31:49 +08:00
2022-05-23 09:31:57 +08:00
sed -i 's/START=95/START=99/' ` find package/ -follow -type f -path */ddns-scripts/files/ddns.init`
2022-09-26 06:51:38 +08:00
#sed -i 's/PKG_SOURCE_VERSION:=.*/PKG_SOURCE_VERSION:=master/' package/kernel/rtl8821cu/Makefile
#sed -i 's/PKG_MIRROR_HASH:=.*/PKG_MIRROR_HASH:=skip/' package/kernel/rtl8821cu/Makefile
2022-05-21 10:12:01 +08:00
2021-09-08 23:23:00 +08:00
mkdir -p ` find package/ -follow -type d -path '*/pdnsd-alt' ` /patches
mv $GITHUB_WORKSPACE /patches/99-disallow-aaaa.patch ` find package/ -follow -type d -path '*/pdnsd-alt' ` /patches
2021-09-08 19:38:56 +08:00
2021-10-18 21:16:14 +08:00
2022-06-11 15:26:06 +08:00
line_number_INCLUDE_Xray = $[ ` grep -m1 -n 'Include Xray' package/custom/openwrt-passwall/luci-app-passwall/Makefile| cut -d: -f1` -1]
sed -i $line_number_INCLUDE_Xray 'd' package/custom/openwrt-passwall/luci-app-passwall/Makefile
sed -i $line_number_INCLUDE_Xray 'd' package/custom/openwrt-passwall/luci-app-passwall/Makefile
sed -i $line_number_INCLUDE_Xray 'd' package/custom/openwrt-passwall/luci-app-passwall/Makefile
line_number_INCLUDE_V2ray = $[ ` grep -m1 -n 'Include V2ray' package/custom/openwrt-passwall/luci-app-passwall/Makefile| cut -d: -f1` -1]
2022-06-09 06:40:08 +08:00
sed -i $line_number_INCLUDE_V2ray 'd' package/custom/openwrt-passwall/luci-app-passwall/Makefile
sed -i $line_number_INCLUDE_V2ray 'd' package/custom/openwrt-passwall/luci-app-passwall/Makefile
sed -i $line_number_INCLUDE_V2ray 'd' package/custom/openwrt-passwall/luci-app-passwall/Makefile
2022-04-27 05:32:00 +08:00
2022-06-11 15:26:06 +08:00
2022-06-27 04:31:41 +08:00
if [ [ $BRANCH = = 'master' ] ] ; then
2021-09-08 19:38:56 +08:00
2021-09-14 00:55:23 +08:00
# fix po path for snapshot
2022-03-23 02:50:36 +08:00
#find package/ -follow -type d -path '*/po/zh-cn' | xargs dirname | xargs -n1 -i sh -c "rm -f {}/zh_Hans; ln -sf zh-cn {}/zh_Hans"
2021-09-14 00:55:23 +08:00
2021-09-08 19:38:56 +08:00
# remove non-exist package from x86 profile
2022-03-23 02:50:36 +08:00
sed -i 's/kmod-i40evf//;s/kmod-iavf//' target/linux/x86/Makefile
# kernel:fix bios boot partition is under 1 MiB
# https://github.com/WYC-2020/lede/commit/fe628c4680115b27f1b39ccb27d73ff0dfeecdc2
sed -i 's/256/1024/' target/linux/x86/image/Makefile
2021-08-28 07:52:15 +08:00
2021-09-08 19:38:56 +08:00
# enable r2s oled plugin by default
2021-08-28 07:52:15 +08:00
sed -i "s/enable '0'/enable '1'/" ` find package/ -follow -type f -path '*/luci-app-oled/root/etc/config/oled' `
2021-09-08 19:38:56 +08:00
# swap the network adapter driver to r8168 to gain better performance for r4s
2022-03-23 02:50:36 +08:00
#sed -i 's/r8169/r8168/' target/linux/rockchip/image/armv8.mk
2021-09-08 19:38:56 +08:00
2022-06-28 05:57:29 +08:00
case $DEVICE in
2022-06-29 06:07:29 +08:00
r2s| r2c| r1p| r1p-lts)
# change the voltage value for over-clock stablization
config_file_cpufreq = ` find package/ -follow -type f -path '*/luci-app-cpufreq/root/etc/config/cpufreq' `
truncate -s-1 $config_file_cpufreq
echo -e "\toption governor0 'schedutil'" >> $config_file_cpufreq
echo -e "\toption minfreq0 '816000'" >> $config_file_cpufreq
echo -e "\toption maxfreq0 '1512000'\n" >> $config_file_cpufreq
# add pwm fan control service
wget https://github.com/friendlyarm/friendlywrt/commit/cebdc1f94dcd6363da3a5d7e1e69fd741b8b718e.patch
git apply cebdc1f94dcd6363da3a5d7e1e69fd741b8b718e.patch
rm cebdc1f94dcd6363da3a5d7e1e69fd741b8b718e.patch
sed -i 's/pwmchip1/pwmchip0/' target/linux/rockchip/armv8/base-files/usr/bin/fa-fancontrol.sh target/linux/rockchip/armv8/base-files/usr/bin/fa-fancontrol-direct.sh
; ;
2022-06-28 05:57:29 +08:00
esac
2021-11-05 21:19:07 +08:00
2021-03-27 22:19:33 +08:00
fi
2021-03-28 06:28:23 +08:00
2021-09-17 15:19:55 +08:00
# inject the firmware version
strDate = ` TZ = UTC-8 date +%Y-%m-%d`
status_pages = ` find package/ -follow -type f \( -path '*/autocore/files/arm/index.htm' -o -path '*/autocore/files/x86/index.htm' -o -path '*/autocore/files/arm/rpcd_10_system.js' -o -path '*/autocore/files/x86/rpcd_10_system.js' \) `
for status_page in $status_pages ; do
case $status_page in
*htm)
line_number_FV = ` grep -n 'Firmware Version' $status_page | cut -d: -f 1`
sed -i '/ver\./d' $status_page
sed -i $line_number_FV ' a <a href="https://github.com/klever1988/nanopi-openwrt" target="_blank">klever1988/nanopi-openwrt</a> ' $strDate $status_page
; ;
*js)
2021-10-03 22:00:12 +08:00
line_number_FV = ` grep -m1 -n 'var fields' $status_page | cut -d: -f1`
2021-09-17 15:19:55 +08:00
sed -i $line_number_FV ' i var pfv = document.createElement(' \' 'placeholder' \' ');pfv.innerHTML = ' \' '<a href="https://github.com/klever1988/nanopi-openwrt" target="_blank">klever1988/nanopi-openwrt</a> ' $strDate "';" $status_page
line_number_FV = ` grep -n 'Firmware Version' $status_page | cut -d : -f 1`
sed -i '/Firmware Version/d' $status_page
sed -i $line_number_FV ' a _(' \' 'Firmware Version' \' '), pfv,' $status_page
; ;
esac
done
2022-03-23 02:50:36 +08:00
# set default theme to argon
sed -i '/uci commit luci/i\uci set luci.main.mediaurlbase="/luci-static/argon"' ` find package -type f -path '*/default-settings/files/*-default-settings' `
2021-08-30 09:37:30 +08:00
2022-04-19 22:49:06 +08:00
# add r1s support to Lean's repo
2022-04-24 22:25:30 +08:00
if [ [ $DEVICE = = 'r1s' ] ] ; then
2022-09-28 03:41:24 +08:00
cd ~ && rm -rf immortalwrt/ && git clone -b openwrt-21.02 https://github.com/immortalwrt/immortalwrt && cd immortalwrt
2022-04-24 22:25:30 +08:00
git log --grep r1s -i | grep '^commit ' | head -n -2 | cut -d' ' -f2 | tac | xargs git show | sed '0,/UENV/s//ATF/' > r1s.diff
2022-04-30 01:02:04 +08:00
git show 124116564e8a6081e79cb2e87b0d87b2af99c583 632c4c91e7640a354dc421fa324fd705b734252d 7fb1b00f5f6214bf7a29d3781d260a7e7c8547c9 >> r1s.diff
2022-04-24 22:25:30 +08:00
cd ~/lede && chmod +x target/linux/sunxi/base-files/etc/board.d/* && git apply ~/immortalwrt/r1s.diff
2022-04-30 01:02:04 +08:00
merge_package https://github.com/immortalwrt/immortalwrt/branches/openwrt-18.06-k5.4/package/emortal/autocore
2022-06-08 03:59:44 +08:00
fi
2022-06-29 06:07:29 +08:00
case $DEVICE in
r2s| r2c| r1p| r1p-lts)
sed -i 's/5.10/5.4/g' target/linux/rockchip/Makefile
line_number_CONFIG_CRYPTO_LIB_BLAKE2S = $[ ` grep -n 'CONFIG_CRYPTO_LIB_BLAKE2S' package/kernel/linux/modules/crypto.mk | cut -d: -f 1` +1]
sed -i $line_number_CONFIG_CRYPTO_LIB_BLAKE2S ' s/HIDDEN:=1/DEPENDS:=@(LINUX_5_4||LINUX_5_10)/' package/kernel/linux/modules/crypto.mk
sed -i 's/libblake2s.ko@lt5.9/libblake2s.ko/;s/libblake2s-generic.ko@lt5.9/libblake2s-generic.ko/' package/kernel/linux/modules/crypto.mk
; ;
esac
2022-05-05 06:49:40 +08:00
# ...
2022-09-29 06:16:42 +08:00
sed -i 's/kmod-usb-net-rtl8152/kmod-usb-net-rtl8152-vendor/' target/linux/rockchip/image/armv8.mk target/linux/sunxi/image/cortexa53.mk target/linux/sunxi/image/cortexa7.mk
2022-09-29 22:33:08 +08:00
sed -i 's/5de8c8e29aaa3fb9cc6b47bb27299f271354ebb72514e3accadc7d38b5bbaa72/9625784cf2e4fd9842f1d407681ce4878b5b0dcddbcd31c6135114a30c71e6a8/' package/feeds/packages/jq/Makefile