diy.sh 4.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. #!/bin/bash
  2. #=================================================
  3. shopt -s extglob
  4. sed -i '$a src-git kiddin9 https://github.com/kiddin9/kwrt-packages.git;master' 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. rm -rf package/base-files
  12. mv -f feeds/kiddin9/base-files package/
  13. echo "$(date +"%s")" >version.date
  14. sed -i '/$(curdir)\/compile:/c\$(curdir)/compile: package/opkg/host/compile' package/Makefile
  15. sed -i "s/DEFAULT_PACKAGES:=/DEFAULT_PACKAGES:=luci-app-advancedplus luci-app-firewall luci-app-opkg luci-app-upnp \
  16. luci-app-wizard luci-base luci-compat luci-lib-ipkg luci-lib-fs \
  17. 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-fileassistant /" include/target.mk
  18. sed -i "s/procd-ujail//" include/target.mk
  19. sed -i "s/procd-seccomp//" include/target.mk
  20. sed -i "s/^.*vermagic$/\techo '1' > \$(LINUX_DIR)\/.vermagic/" include/kernel-defaults.mk
  21. status=$(curl -H "Authorization: token $REPO_TOKEN" -s "https://api.github.com/repos/kiddin9/kwrt-packages/actions/runs" | jq -r '.workflow_runs[0].status')
  22. echo "$status"
  23. while [[ "$status" == "in_progress" || "$status" == "queued" ]];do
  24. echo "wait 5s"
  25. sleep 5
  26. status=$(curl -H "Authorization: token $REPO_TOKEN" -s "https://api.github.com/repos/kiddin9/kwrt-packages/actions/runs" | jq -r '.workflow_runs[0].status')
  27. done
  28. rm -rf package/feeds/packages/v4l2loopback package/feeds/kiddin9/accel-ppp
  29. mv -f feeds/kiddin9/r81* tmp/
  30. wget -N https://raw.githubusercontent.com/openwrt/packages/master/lang/golang/golang/Makefile -P feeds/packages/lang/golang/golang/
  31. sed -i "s/192.168.1/10.0.0/" package/base-files/files/bin/config_generate
  32. #sed -i "/call Build\/check-size,\$\$(KERNEL_SIZE)/d" include/image.mk
  33. wget -N https://raw.githubusercontent.com/coolsnowwolf/lede/master/package/kernel/linux/modules/video.mk -P package/kernel/linux/modules/
  34. git_clone_path master https://github.com/coolsnowwolf/lede target/linux/generic/hack-5.15
  35. wget -N https://raw.githubusercontent.com/coolsnowwolf/lede/master/target/linux/generic/pending-5.15/613-netfilter_optional_tcp_window_check.patch -P target/linux/generic/pending-5.15/
  36. sed -i "s/CONFIG_WERROR=y/CONFIG_WERROR=n/" target/linux/generic/config-5.15
  37. sed -i "s/no-lto,$/no-lto no-mold,$/" include/package.mk
  38. [ -d package/kernel/mt76 ] && {
  39. wget -N https://raw.githubusercontent.com/immortalwrt/immortalwrt/master/package/kernel/mt76/patches/0001-mt76-allow-VHT-rate-on-2.4GHz.patch -P package/kernel/mt76/patches/
  40. }
  41. grep -q 'PKG_RELEASE:=9' package/libs/openssl/Makefile && {
  42. sh -c "curl -sfL https://github.com/openwrt/openwrt/commit/a48d0bdb77eb93f7fba6e055dace125c72755b6a.patch | patch -d './' -p1 --forward"
  43. }
  44. sed -i "/wireless.\${name}.disabled/d" package/kernel/mac80211/files/lib/wifi/mac80211.sh
  45. sed -i 's/Os/O2/g' include/target.mk
  46. sed -i "/mediaurlbase/d" package/feeds/*/luci-theme*/root/etc/uci-defaults/*
  47. sed -i 's/=bbr/=cubic/' package/kernel/linux/files/sysctl-tcp-bbr.conf
  48. # find target/linux/x86 -name "config*" -exec bash -c 'cat kernel.conf >> "{}"' \;
  49. sed -i 's/max_requests 3/max_requests 20/g' package/network/services/uhttpd/files/uhttpd.config
  50. #rm -rf ./feeds/packages/lang/{golang,node}
  51. sed -i "s/tty\(0\|1\)::askfirst/tty\1::respawn/g" target/linux/*/base-files/etc/inittab
  52. sed -i 's/$$(call concat_cmd,$$(KERNEL_INITRAMFS))/-$$(call concat_cmd,$$(KERNEL_INITRAMFS))/' include/image.mk
  53. date=`date +%m.%d.%Y`
  54. sed -i -e "/\(# \)\?REVISION:=/c\REVISION:=$date" -e '/VERSION_CODE:=/c\VERSION_CODE:=$(REVISION)' include/version.mk
  55. sed -i \
  56. -e "s/+\(luci\|luci-ssl\|uhttpd\)\( \|$\)/\2/" \
  57. -e "s/+nginx\( \|$\)/+nginx-ssl\1/" \
  58. -e 's/+python\( \|$\)/+python3/' \
  59. -e 's?../../lang?$(TOPDIR)/feeds/packages/lang?' \
  60. package/feeds/kiddin9/*/Makefile
  61. sed -i "s/OpenWrt/Kwrt/g" package/base-files/files/bin/config_generate package/base-files/image-config.in config/Config-images.in Config.in include/u-boot.mk include/version.mk package/network/config/wifi-scripts/files/lib/wifi/mac80211.sh package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh || true