diy.sh 3.8 KB

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