diy.sh 4.2 KB

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