diy.sh 5.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. #!/bin/bash
  2. #=================================================
  3. shopt -s extglob
  4. sed -i '$a src-git kiddin9 https://github.com/kiddin9/kwrt-packages.git;main' feeds.conf.default
  5. sed -i "/telephony/d" feeds.conf.default
  6. sed -i "s?targets/%S/packages?targets/%S/\$(LINUX_VERSION)?" include/feeds.mk
  7. sed -i '/ refresh_config();/d' scripts/feeds
  8. ./scripts/feeds update -a
  9. ./scripts/feeds install -a -p kiddin9 -f
  10. ./scripts/feeds install -a
  11. sed --follow-symlinks -i "s#%C\"#%C by Kiddin'\"#" package/base-files/files/etc/os-release
  12. sed -i -e '$a /etc/bench.log' \
  13. -e '/\/etc\/profile/d' \
  14. -e '/\/etc\/shinit/d' \
  15. package/base-files/files/lib/upgrade/keep.d/base-files-essential
  16. sed -i -e '/^\/etc\/profile/d' \
  17. -e '/^\/etc\/shinit/d' \
  18. package/base-files/Makefile
  19. sed -i "s/192.168.1/10.0.0/" package/base-files/files/bin/config_generate
  20. wget -N https://github.com/immortalwrt/immortalwrt/raw/refs/heads/openwrt-24.10/package/kernel/linux/modules/video.mk -P package/kernel/linux/modules/
  21. wget -N https://github.com/immortalwrt/immortalwrt/raw/refs/heads/openwrt-24.10/package/network/utils/nftables/patches/002-nftables-add-fullcone-expression-support.patch -P package/network/utils/nftables/patches/
  22. wget -N https://github.com/immortalwrt/immortalwrt/raw/refs/heads/openwrt-24.10/package/network/utils/nftables/patches/001-drop-useless-file.patch -P package/network/utils/nftables/patches/
  23. wget -N https://github.com/immortalwrt/immortalwrt/raw/refs/heads/openwrt-24.10/package/libs/libnftnl/patches/001-libnftnl-add-fullcone-expression-support.patch -P package/libs/libnftnl/patches/
  24. wget -N https://github.com/immortalwrt/immortalwrt/raw/refs/heads/openwrt-24.10/package/firmware/wireless-regdb/patches/600-custom-change-txpower-and-dfs.patch -P package/firmware/wireless-regdb/patches/
  25. wget -N https://github.com/immortalwrt/immortalwrt/raw/refs/heads/master/config/Config-kernel.in -P config/
  26. rm -rf package/libs/openssl package/network/services/ppp
  27. git_clone_path openwrt-24.10 https://github.com/immortalwrt/immortalwrt package/libs/openssl package/network/services/ppp
  28. echo "$(date +"%s")" >version.date
  29. sed -i '/$(curdir)\/compile:/c\$(curdir)/compile: package/opkg/host/compile' package/Makefile
  30. sed -i "s/DEFAULT_PACKAGES:=/DEFAULT_PACKAGES:=luci-app-advancedplus luci-app-firewall luci-app-package-manager luci-app-upnp luci-app-syscontrol luci-proto-wireguard \
  31. luci-app-wizard luci-base luci-compat luci-lib-ipkg luci-lib-fs luci-app-log-viewer \
  32. coremark wget-ssl curl autocore htop nano zram-swap kmod-lib-zstd kmod-tcp-bbr bash openssh-sftp-server block-mount resolveip ds-lite swconfig luci-app-fan luci-app-filemanager /" include/target.mk
  33. sed -i "s/procd-ujail//" include/target.mk
  34. sed -i "s/^.*vermagic$/\techo '1' > \$(LINUX_DIR)\/.vermagic/" include/kernel-defaults.mk
  35. status=$(curl -H "Authorization: token $REPO_TOKEN" -s "https://api.github.com/repos/kiddin9/kwrt-packages/actions/runs" | jq -r '.workflow_runs[0].status')
  36. echo "$status"
  37. while [[ "$status" == "in_progress" || "$status" == "queued" ]];do
  38. echo "wait 5s"
  39. sleep 5
  40. status=$(curl -H "Authorization: token $REPO_TOKEN" -s "https://api.github.com/repos/kiddin9/kwrt-packages/actions/runs" | jq -r '.workflow_runs[0].status')
  41. done
  42. mv -f feeds/kiddin9/r81* tmp/
  43. wget -N https://raw.githubusercontent.com/openwrt/packages/master/lang/golang/golang/Makefile -P feeds/packages/lang/golang/golang/
  44. #sed -i "/call Build\/check-size,\$\$(KERNEL_SIZE)/d" include/image.mk
  45. git_clone_path master https://github.com/coolsnowwolf/lede mv target/linux/generic/hack-6.6
  46. rm -rf package/system/fstools
  47. git_clone_path master https://github.com/coolsnowwolf/lede package/system/fstools
  48. rm -rf target/linux/generic/hack-6.6/767-net-phy-realtek-add-led*
  49. wget -N https://raw.githubusercontent.com/coolsnowwolf/lede/master/target/linux/generic/pending-6.6/613-netfilter_optional_tcp_window_check.patch -P target/linux/generic/pending-6.6/
  50. # find target/linux/x86 -name "config*" -exec bash -c 'cat kernel.conf >> "{}"' \;
  51. sed -i 's/max_requests 3/max_requests 20/g' package/network/services/uhttpd/files/uhttpd.config
  52. #rm -rf ./feeds/packages/lang/{golang,node}
  53. sed -i "s/tty\(0\|1\)::askfirst/tty\1::respawn/g" target/linux/*/base-files/etc/inittab
  54. date=`date +%m.%d.%Y`
  55. sed -i -e "/\(# \)\?REVISION:=/c\REVISION:=$date" -e '/VERSION_CODE:=/c\VERSION_CODE:=$(REVISION)' include/version.mk
  56. sed -i 's/option timeout 30/option timeout 60/g' package/system/rpcd/files/rpcd.config
  57. sed -i 's#20) \* 1000#60) \* 1000#g' feeds/luci/modules/luci-base/htdocs/luci-static/resources/rpc.js
  58. sed -i \
  59. -e "s/+\(luci\|luci-ssl\|uhttpd\)\( \|$\)/\2/" \
  60. -e "s/+nginx\( \|$\)/+nginx-ssl\1/" \
  61. -e 's/+python\( \|$\)/+python3/' \
  62. -e 's?../../lang?$(TOPDIR)/feeds/packages/lang?' \
  63. package/feeds/kiddin9/*/Makefile
  64. sed -i "s/OpenWrt/Kwrt/g" package/base-files/files/bin/config_generate package/base-files/image-config.in package/network/config/wifi-scripts/files/lib/wifi/mac80211.uc config/Config-images.in Config.in include/u-boot.mk include/version.mk || true
  65. sed -i -e "s/set \${s}.country='\${country || ''}'/set \${s}.country='\${country || \"CN\"}'/g" -e "s/set \${s}.disabled=.*/set \${s}.disabled='0'/" package/network/config/wifi-scripts/files/lib/wifi/mac80211.uc