diy.sh 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  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 kiddin9 https://github.com/kiddin9/openwrt-packages.git;master' feeds.conf.default
  7. }
  8. ./scripts/feeds update -a
  9. ./scripts/feeds install -a -p kiddin9
  10. ./scripts/feeds install -a
  11. cd feeds/kiddin9; 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/kiddin9/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 "s/^.*vermagic$/\techo '1' > \$(LINUX_DIR)\/.vermagic/" include/kernel-defaults.mk
  48. sed -i \
  49. -e "s/+\(luci\|luci-ssl\|uhttpd\)\( \|$\)/\2/" \
  50. -e "s/+nginx\( \|$\)/+nginx-ssl\1/" \
  51. -e 's/+python\( \|$\)/+python3/' \
  52. -e 's?../../lang?$(TOPDIR)/feeds/packages/lang?' \
  53. package/feeds/kiddin9/*/Makefile
  54. (
  55. if [ -f sdk.tar.xz ]; then
  56. sed -i 's,$(STAGING_DIR_HOST)/bin/upx,upx,' package/feeds/kiddin9/*/Makefile
  57. mkdir sdk
  58. tar -xJf sdk.tar.xz -C sdk
  59. cp -rf sdk/*/staging_dir/* ./staging_dir/
  60. rm -rf sdk.tar.xz sdk
  61. sed -i '/\(tools\|toolchain\)\/Makefile/d' Makefile
  62. if [ -f /usr/bin/python ]; then
  63. ln -sf /usr/bin/python staging_dir/host/bin/python
  64. else
  65. ln -sf /usr/bin/python3 staging_dir/host/bin/python
  66. fi
  67. ln -sf /usr/bin/python3 staging_dir/host/bin/python3
  68. fi
  69. ) &