diff --git a/scripts/patches.sh b/scripts/patches.sh index d0ebcd9..9f61506 100644 --- a/scripts/patches.sh +++ b/scripts/patches.sh @@ -33,51 +33,6 @@ sed -i $line_number_INCLUDE_V2ray'd' package/custom/openwrt-passwall/luci-app-pa 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 - -if [[ $BRANCH == 'master' ]]; then - - # fix po path for snapshot - #find package/ -follow -type d -path '*/po/zh-cn' | xargs dirname | xargs -ri sh -c "rm -f {}/zh_Hans; ln -sf zh-cn {}/zh_Hans" - - # remove non-exist package from x86 profile - 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 - - # enable r2s oled plugin by default - sed -i "s/enable '0'/enable '1'/" `find package/ -follow -type f -path '*/luci-app-oled/root/etc/config/oled'` - - # swap the network adapter driver to r8168 to gain better performance for r4s - #sed -i 's/r8169/r8168/' target/linux/rockchip/image/armv8.mk - - # 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 - - # ... - 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 - - case $DEVICE in - 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 - - 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 - -fi - # 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' \)` @@ -101,8 +56,42 @@ done # 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'` -## ugly fix of the read-only issue -sed -i '3 i sed -i "/^exit.*/i\\/bin\\/mount -o remount,rw /" /etc/rc.local' `find package -type f -path '*/default-settings/files/*-default-settings'` +# fix po path for snapshot +#find package/ -follow -type d -path '*/po/zh-cn' | xargs dirname | xargs -ri sh -c "rm -f {}/zh_Hans; ln -sf zh-cn {}/zh_Hans" + +# remove non-exist package from x86 profile +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 + +# enable r2s oled plugin by default +sed -i "s/enable '0'/enable '1'/" `find package/ -follow -type f -path '*/luci-app-oled/root/etc/config/oled'` + +# swap the network adapter driver to r8168 to gain better performance for r4s +#sed -i 's/r8169/r8168/' target/linux/rockchip/image/armv8.mk + +# 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 + +case $DEVICE in + 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 + + 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 # add r1s support to Lean's repo if [[ $DEVICE == 'r1s' ]]; then @@ -124,4 +113,10 @@ if [[ $DEVICE == 'r1s-h3' ]]; then sed -i 's/kmod-leds-gpio//' target/linux/sunxi/image/cortexa7.mk fi +# ... +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 + +## ugly fix of the read-only issue +sed -i '3 i sed -i "/^exit.*/i\\/bin\\/mount -o remount,rw /" /etc/rc.local' `find package -type f -path '*/default-settings/files/*-default-settings'` + sed -i 's/\+1017\,12/+1017\,13/;/ifdef CONFIG_MBO/i+NEED_GAS=y' package/network/services/hostapd/patches/200-multicall.patch \ No newline at end of file