diy.sh 4.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. #!/bin/bash
  2. #=================================================
  3. echo "src-git custom https://github.com/kiddin9/openwrt-packages.git" >>feeds.conf.default
  4. ./scripts/feeds update -a
  5. cd feeds/custom && git pull; cd -
  6. ./scripts/feeds install -a -p custom
  7. ./scripts/feeds install -a
  8. sed -i 's/Os/O2/g' include/target.mk
  9. rm -Rf tools/upx && svn export https://github.com/coolsnowwolf/lede/trunk/tools/upx tools/upx
  10. rm -Rf tools/ucl && svn export https://github.com/coolsnowwolf/lede/trunk/tools/ucl tools/ucl
  11. sed -i 's?zstd$?zstd ucl upx\n$(curdir)/upx/compile := $(curdir)/ucl/compile?g' tools/Makefile
  12. svn co https://github.com/immortalwrt/immortalwrt/branches/master/target/linux/generic/hack-5.4 target/linux/generic/hack-5.4
  13. rm -rf target/linux/generic/hack-5.4/220-gc_sections.patch
  14. #svn co https://github.com/immortalwrt/immortalwrt/branches/master/target/linux/generic/hack-5.10 target/linux/generic/hack-5.10
  15. svn export --force https://github.com/immortalwrt/immortalwrt/branches/openwrt-21.02/package/network/services/ppp package/network/services/ppp
  16. svn export --force https://github.com/openwrt/openwrt/trunk/package/libs/libnfnetlink package/libs/libnfnetlink
  17. svn export --force https://github.com/immortalwrt/immortalwrt/branches/master/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 '$a /etc/sysupgrade.conf' package/base-files/files/lib/upgrade/keep.d/base-files-essential
  20. sed -i '$a /etc/acme' package/base-files/files/lib/upgrade/keep.d/base-files-essential
  21. sed -i '$a /etc/bench.log' package/base-files/files/lib/upgrade/keep.d/base-files-essential
  22. sed -i '/\/etc\/profile/d' package/base-files/files/lib/upgrade/keep.d/base-files-essential
  23. sed -i '/^\/etc\/profile/d' package/base-files/Makefile
  24. # find target/linux/x86 -name "config*" -exec bash -c 'cat kernel.conf >> "{}"' \;
  25. 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 \
  26. CONFIG_CRYPTO_CHACHA20POLY1305=y\nCONFIG_BINFMT_MISC=y' `find target/linux -path "target/linux/*/config-*"`
  27. sed -i 's/max_requests 3/max_requests 20/g' package/network/services/uhttpd/files/uhttpd.config
  28. #rm -rf ./feeds/packages/lang/{golang,node}
  29. #svn export https://github.com/immortalwrt/packages/trunk/lang/golang feeds/packages/lang/golang
  30. #svn export https://github.com/immortalwrt/packages/trunk/lang/node feeds/packages/lang/node
  31. wget -P package/network/config/firewall/patches/ https://github.com/coolsnowwolf/lede/raw/master/package/network/config/firewall/patches/fullconenat.patch
  32. sed -i 's/+python\( \|$\)/+python3/g' package/*/*/*/Makefile
  33. sed -i 's?../../lang?$(TOPDIR)/feeds/packages/lang?g' package/feeds/custom/*/Makefile
  34. sed -i 's/PKG_BUILD_DIR:=/PKG_BUILD_DIR?=/g' feeds/luci/luci.mk
  35. sed -i 's?admin/status/channel_analysis??' package/feeds/luci/luci-mod-status/root/usr/share/luci/menu.d/luci-mod-status.json
  36. sed -i "s/askfirst/respawn/g" `find package target -name inittab`
  37. for ipk in $(find package/feeds/custom/* -maxdepth 0); do
  38. if [[ ! -d "$ipk/patches" && ! "$(grep "codeload.github.com" $ipk/Makefile)" ]]; then
  39. sed -i "s/PKG_SOURCE_VERSION:=[0-9a-z]\{15,\}/PKG_SOURCE_VERSION:=HEAD/g" `find $ipk/ -maxdepth 1 ! -path *tcping* -name "Makefile"`
  40. fi
  41. done
  42. sed -i 's/$(VERSION) &&/$(VERSION) ;/g' include/download.mk
  43. date=`date +%m.%d.%Y`
  44. sed -i "s/DISTRIB_DESCRIPTION.*/DISTRIB_DESCRIPTION=\"%D %C by Kiddin'\"/g" package/base-files/files/etc/openwrt_release
  45. sed -i "s/CONFIG_VERSION_CODE=.*/CONFIG_VERSION_CODE=\"$date\"/g" devices/common/.config
  46. sed -i '$a cgi-timeout = 300' package/feeds/packages/uwsgi/files-luci-support/luci-webui.ini
  47. if [ -f sdk.tar.xz ]; then
  48. sed -i 's,$(STAGING_DIR_HOST)/bin/upx,upx,' package/feeds/custom/*/Makefile
  49. mkdir sdk
  50. tar -xJf sdk.tar.xz -C sdk
  51. cp -rf sdk/*/staging_dir/* ./staging_dir/
  52. rm -rf sdk.tar.xz sdk
  53. sed -i '/\(tools\|toolchain\)\/Makefile/d' Makefile
  54. if [ -f /usr/bin/python ]; then
  55. ln -sf /usr/bin/python staging_dir/host/bin/python
  56. else
  57. ln -sf /usr/bin/python3 staging_dir/host/bin/python
  58. fi
  59. ln -sf /usr/bin/python3 staging_dir/host/bin/python3
  60. fi