diy.sh 3.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. #!/bin/bash
  2. #=================================================
  3. shopt -s extglob
  4. sed -i '/ refresh_config();/d' scripts/feeds
  5. [ ! -f feeds.conf ] && {
  6. sed -i '$a src-git custom https://github.com/kiddin9/openwrt-packages.git;master' feeds.conf.default
  7. }
  8. ./scripts/feeds update -a
  9. ./scripts/feeds install -a -p custom
  10. ./scripts/feeds install -a
  11. cd feeds/custom; git pull; cd -
  12. (
  13. svn export --force https://github.com/immortalwrt/immortalwrt/branches/openwrt-21.02/package/network/services/ppp package/network/services/ppp
  14. svn export --force https://github.com/immortalwrt/immortalwrt/branches/openwrt-21.02/package/network/services/dnsmasq package/network/services/dnsmasq
  15. svn export --force https://github.com/coolsnowwolf/lede/trunk/tools/upx tools/upx
  16. svn export --force https://github.com/coolsnowwolf/lede/trunk/tools/ucl tools/ucl
  17. svn co https://github.com/immortalwrt/immortalwrt/branches/openwrt-21.02/target/linux/generic/hack-5.4 target/linux/generic/hack-5.4
  18. curl -sfL https://git.io/J0klM --create-dirs -o package/network/config/firewall/patches/fullconenat.patch
  19. curl -sfL https://raw.githubusercontent.com/coolsnowwolf/lede/master/target/linux/generic/hack-5.4/601-netfilter-export-udp_get_timeouts-function.patch -o target/linux/generic/hack-5.4/601-netfilter-export-udp_get_timeouts-function.patch
  20. ) &
  21. sed -i 's?zstd$?zstd ucl upx\n$(curdir)/upx/compile := $(curdir)/ucl/compile?g' tools/Makefile
  22. sed -i 's/\/cgi-bin\/\(luci\|cgi-\)/\/\1/g' `find package/feeds/custom/luci-*/ -name "*.lua" -or -name "*.htm*" -or -name "*.js"` &
  23. sed -i 's/Os/O2/g' include/target.mk
  24. sed -i 's/$(TARGET_DIR)) install/$(TARGET_DIR)) install --force-overwrite/' package/Makefile
  25. sed -i "/mediaurlbase/d" package/feeds/*/luci-theme*/root/etc/uci-defaults/*
  26. sed -i '/root:/c\root:$1$tTPCBw1t$ldzfp37h5lSpO9VXk4uUE\/:18336:0:99999:7:::' package/base-files/files/etc/shadow
  27. sed -i -e '$a /etc/sysupgrade.conf' \
  28. -e '$a /etc/bench.log' \
  29. -e '/\/etc\/profile/d' \
  30. -e '/\/etc\/shinit/d' \
  31. package/base-files/files/lib/upgrade/keep.d/base-files-essential
  32. sed -i -e '/^\/etc\/profile/d' \
  33. -e '/^\/etc\/shinit/d' \
  34. package/base-files/Makefile
  35. # find target/linux/x86 -name "config*" -exec bash -c 'cat kernel.conf >> "{}"' \;
  36. sed -i '$a CONFIG_ACPI=y\nCONFIG_X86_ACPI_CPUFREQ=y\nCONFIG_NR_CPUS=128\nCONFIG_FAT_DEFAULT_IOCHARSET="utf8"\nCONFIG_CRYPTO_CHACHA20_NEON=y\n \
  37. CONFIG_CRYPTO_CHACHA20POLY1305=y\nCONFIG_BINFMT_MISC=y' `find target/linux -path "target/linux/*/config-*"`
  38. sed -i 's/max_requests 3/max_requests 20/g' package/network/services/uhttpd/files/uhttpd.config
  39. #rm -rf ./feeds/packages/lang/{golang,node}
  40. sed -i 's?admin/status/channel_analysis??' package/feeds/luci/luci-mod-status/root/usr/share/luci/menu.d/luci-mod-status.json
  41. sed -i "s/askfirst/respawn/g" `find package target -name inittab`
  42. date=`date +%m.%d.%Y`
  43. sed -i "/DISTRIB_DESCRIPTION/c\DISTRIB_DESCRIPTION=\"%D %C by Kiddin'\"" package/base-files/files/etc/openwrt_release
  44. sed -i "/CONFIG_VERSION_CODE=/c\CONFIG_VERSION_CODE=\"$date\"" devices/common/.config
  45. sed -i '$a cgi-timeout = 300' package/feeds/packages/uwsgi/files-luci-support/luci-webui.ini
  46. sed -i '/limit-as/c\limit-as = 5000' package/feeds/packages/uwsgi/files-luci-support/luci-webui.ini
  47. sed -i \
  48. -e "s/+\(luci\|luci-ssl\|uhttpd\)\( \|$\)/\2/" \
  49. -e "s/+nginx\( \|$\)/+nginx-ssl\1/" \
  50. -e 's/+python\( \|$\)/+python3/' \
  51. -e 's?../../lang?$(TOPDIR)/feeds/packages/lang?' \
  52. package/feeds/custom/*/Makefile
  53. (
  54. if [ -f sdk.tar.xz ]; then
  55. sed -i 's,$(STAGING_DIR_HOST)/bin/upx,upx,' package/feeds/custom/*/Makefile
  56. mkdir sdk
  57. tar -xJf sdk.tar.xz -C sdk
  58. cp -rf sdk/*/staging_dir/* ./staging_dir/
  59. rm -rf sdk.tar.xz sdk
  60. sed -i '/\(tools\|toolchain\)\/Makefile/d' Makefile
  61. if [ -f /usr/bin/python ]; then
  62. ln -sf /usr/bin/python staging_dir/host/bin/python
  63. else
  64. ln -sf /usr/bin/python3 staging_dir/host/bin/python
  65. fi
  66. ln -sf /usr/bin/python3 staging_dir/host/bin/python3
  67. fi
  68. ) &