diy.sh 4.2 KB

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