diy.sh 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. #!/bin/bash
  2. #=================================================
  3. rm -Rf feeds/custom/diy
  4. mv -f feeds/packages/libs/libx264 feeds/custom/libx264
  5. mv -f feeds/packages/net/aria2 feeds/custom/aria2
  6. mv -f feeds/packages/net/openvpn feeds/custom/openvpn
  7. mv -f feeds/packages/admin/netdata feeds/custom/netdata
  8. mv -f feeds/packages/net/shadowsocks-libev feeds/custom/shadowsocks-libev
  9. rm -Rf feeds/packages/net/{smartdns,frp,mwan3,miniupnpd} feeds/luci/applications/{luci-app-dockerman,luci-app-smartdns,luci-app-frpc}
  10. svn co https://github.com/project-openwrt/packages/trunk/lang/python/Flask-RESTful feeds/packages/lang/python/Flask-RESTful
  11. ./scripts/feeds update luci packages custom
  12. ./scripts/feeds install -a
  13. sed -i 's/Os/O2/g' include/target.mk
  14. rm -Rf package/network/utils/iwinfo; svn co https://github.com/coolsnowwolf/lede/trunk/package/network/utils/iwinfo package/network/utils/iwinfo
  15. rm -Rf tools/upx && svn co https://github.com/coolsnowwolf/lede/trunk/tools/upx tools/upx
  16. rm -Rf tools/ucl && svn co https://github.com/coolsnowwolf/lede/trunk/tools/ucl tools/ucl
  17. sed -i 's?zstd$?zstd ucl upx\n$(curdir)/upx/compile := $(curdir)/ucl/compile?g' tools/Makefile
  18. echo -e "\q" | svn co https://github.com/coolsnowwolf/lede/trunk/target/linux/generic/hack-5.4 target/linux/generic/hack-5.4
  19. echo -e "\q" | svn co https://github.com/project-openwrt/openwrt/branches/master/package/network/utils/iptables/patches package/network/utils/iptables/patches
  20. sed -i "s/'class': 'table'/'class': 'table memory'/g" package/*/*/luci-mod-status/htdocs/luci-static/resources/view/status/include/20_memory.js
  21. sed -i '/depends on PACKAGE_php7-cli || PACKAGE_php7-cgi/d' package/*/*/php7/Makefile
  22. sed -i 's/DEPENDS:= strongswan/DEPENDS:=+strongswan/g' package/*/*/strongswan/Makefile
  23. sed -i '/exit 1/d' package/*/*/docker-ce/Makefile
  24. sed -i 's/+acme\( \|$\)/+acme +acme-dnsapi\1/g' package/*/*/luci-app-acme/Makefile
  25. sed -i '/_redirect2ssl/d' package/*/*/nginx/Makefile
  26. sed -i '/init_lan/d' package/*/*/nginx/files/nginx.init
  27. sed -i '$a /etc/sysupgrade.conf' package/base-files/files/lib/upgrade/keep.d/base-files-essential
  28. sed -i '$a /etc/amule' package/base-files/files/lib/upgrade/keep.d/base-files-essential
  29. sed -i '$a /etc/acme' package/base-files/files/lib/upgrade/keep.d/base-files-essential
  30. sed -i '$a /etc/bench.log' package/base-files/files/lib/upgrade/keep.d/base-files-essential
  31. sed -i '$a /etc/acme' package/base-files/files/lib/upgrade/keep.d/base-files-essential
  32. sed -i '/\/etc\/profile/d' package/base-files/files/lib/upgrade/keep.d/base-files-essential
  33. # find target/linux/x86 -name "config*" -exec bash -c 'cat kernel.conf >> "{}"' \;
  34. find target/linux -path "target/linux/*/config-*" | xargs -i sed -i '$a CONFIG_ACPI=y\nCONFIG_X86_ACPI_CPUFREQ=y\n \
  35. CONFIG_NR_CPUS=128\nCONFIG_FAT_DEFAULT_IOCHARSET="utf8"\nCONFIG_CRYPTO_CHACHA20_NEON=y\nCONFIG_CRYPTO_CHACHA20POLY1305=y' {}
  36. sed -i 's/service_start $PROG/service_start $PROG -R/g' package/*/*/php7/files/php7-fpm.init
  37. sed -i 's/max_requests 3/max_requests 20/g' package/network/services/uhttpd/files/uhttpd.config
  38. rm -rf ./feeds/packages/lang/golang
  39. svn co https://github.com/project-openwrt/packages/trunk/lang/golang feeds/packages/lang/golang
  40. mkdir package/network/config/firewall/patches
  41. wget -O package/network/config/firewall/patches/fullconenat.patch https://github.com/coolsnowwolf/lede/raw/master/package/network/config/firewall/patches/fullconenat.patch
  42. sed -i "s/+nginx\( \|$\)/+nginx-ssl\1/g" package/*/*/*/Makefile
  43. sed -i 's/+python\( \|$\)/+python3/g' package/*/*/*/Makefile
  44. sed -i 's?package.mk?package.mk\ninclude $(INCLUDE_DIR)/package_lang.mk?g' package/*/custom/*/Makefile
  45. sed -i 's/PKG_BUILD_DIR:=/PKG_BUILD_DIR?=/g' feeds/luci/luci.mk
  46. sed -i '/killall -HUP/d' feeds/luci/luci.mk
  47. find package target -name inittab | xargs -i sed -i "s/askfirst/respawn/g" {}
  48. find package/feeds/custom/*/ -maxdepth 1 -name "Makefile" ! -path "*rclone*" ! -path "*shadowsocksr-libev*" ! -path "*rtl8821cu*" \
  49. | xargs -i sed -i "s/PKG_SOURCE_VERSION:=[0-9a-z]\{15,\}/PKG_SOURCE_VERSION:=latest/g" {}
  50. sed -i 's/$(VERSION) &&/$(VERSION) ;/g' include/download.mk
  51. date=`date +%m.%d.%Y`
  52. sed -i "s/DISTRIB_DESCRIPTION.*/DISTRIB_DESCRIPTION='%D %V %C by GaryPang'/g" package/base-files/files/etc/openwrt_release
  53. sed -i "s/# REVISION:=x/REVISION:= $date/g" include/version.mk
  54. sed -i '$a cgi-timeout = 300' package/feeds/packages/uwsgi/files-luci-support/luci-webui.ini