From 2951b0db1594e285533ce5426b62660c2a598ffa Mon Sep 17 00:00:00 2001 From: zhao Date: Fri, 17 Jan 2025 00:01:09 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20IPQ807x.sh?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zhao --- IPQ807x.sh | 259 +++++++++++++---------------------------------------- 1 file changed, 60 insertions(+), 199 deletions(-) diff --git a/IPQ807x.sh b/IPQ807x.sh index ea7235e..dfb0775 100644 --- a/IPQ807x.sh +++ b/IPQ807x.sh @@ -37,229 +37,106 @@ echo -e "${GREEN}更新并安装 feeds...${NC}" ./scripts/feeds update -a ./scripts/feeds install -a -# 修改默认IP -echo -e "${YELLOW}修改默认IP${NC}" -sed -i 's/192.168.1.1/10.0.0.1/g' package/base-files/files/bin/config_generate +# 设置默认密码 +echo -e "${BLUE}设置默认密码...${NC}" +sed -i 's/root::0:0:99999:7:::/root:$1$V4UetPzk$CYXluq4wUazHjmCDBCqXF.:0:0:99999:7:::/g' /etc/shadow +sed -i 's/root:::0:99999:7:::/root:$1$V4UetPzk$CYXluq4wUazHjmCDBCqXF.:0:0:99999:7:::/g' /etc/shadow # profile -echo -e "${YELLOW}profile${NC}" sed -i 's#\\u@\\h:\\w\\\$#\\[\\e[32;1m\\][\\u@\\h\\[\\e[0m\\] \\[\\033[01;34m\\]\\W\\[\\033[00m\\]\\[\\e[32;1m\\]]\\[\\e[0m\\]\\\$#g' package/base-files/files/etc/profile sed -ri 's/(export PATH=")[^"]*/\1%PATH%:\/opt\/bin:\/opt\/sbin:\/opt\/usr\/bin:\/opt\/usr\/sbin/' package/base-files/files/etc/profile sed -i '/PS1/a\export TERM=xterm-color' package/base-files/files/etc/profile # TTYD -echo -e "${YELLOW}TTYD${NC}" sed -i 's/services/system/g' feeds/luci/applications/luci-app-ttyd/root/usr/share/luci/menu.d/luci-app-ttyd.json sed -i '3 a\\t\t"order": 50,' feeds/luci/applications/luci-app-ttyd/root/usr/share/luci/menu.d/luci-app-ttyd.json sed -i 's/procd_set_param stdout 1/procd_set_param stdout 0/g' feeds/packages/utils/ttyd/files/ttyd.init sed -i 's/procd_set_param stderr 1/procd_set_param stderr 0/g' feeds/packages/utils/ttyd/files/ttyd.init # bash -echo -e "${YELLOW}Bash${NC}" sed -i 's#ash#bash#g' package/base-files/files/etc/passwd sed -i '\#export ENV=/etc/shinit#a export HISTCONTROL=ignoredups' package/base-files/files/etc/profile mkdir -p files/root curl -so files/root/.bash_profile https://git.kejizero.online/zhao/files/raw/branch/main/root/.bash_profile curl -so files/root/.bashrc https://git.kejizero.online/zhao/files/raw/branch/main/root/.bashrc -# Nginx -echo -e "${YELLOW}Nginx${NC}" -sed -i "s/large_client_header_buffers 2 1k/large_client_header_buffers 4 32k/g" feeds/packages/net/nginx-util/files/uci.conf.template -sed -i "s/client_max_body_size 128M/client_max_body_size 2048M/g" feeds/packages/net/nginx-util/files/uci.conf.template -sed -i '/client_max_body_size/a\\tclient_body_buffer_size 8192M;' feeds/packages/net/nginx-util/files/uci.conf.template -sed -i '/client_max_body_size/a\\tserver_names_hash_bucket_size 128;' feeds/packages/net/nginx-util/files/uci.conf.template -sed -i '/ubus_parallel_req/a\ ubus_script_timeout 600;' feeds/packages/net/nginx/files-luci-support/60_nginx-luci-support -sed -ri "/luci-webui.socket/i\ \t\tuwsgi_send_timeout 600\;\n\t\tuwsgi_connect_timeout 600\;\n\t\tuwsgi_read_timeout 600\;" feeds/packages/net/nginx/files-luci-support/luci.locations -sed -ri "/luci-cgi_io.socket/i\ \t\tuwsgi_send_timeout 600\;\n\t\tuwsgi_connect_timeout 600\;\n\t\tuwsgi_read_timeout 600\;" feeds/packages/net/nginx/files-luci-support/luci.locations +#补充汉化 +echo -e "${BLUE}补充汉化${NC}" +echo -e "\nmsgid \"Control\"" >> feeds/luci/modules/luci-base/po/zh_Hans/base.po +echo -e "msgstr \"控制\"" >> feeds/luci/modules/luci-base/po/zh_Hans/base.po -# uwsgi -echo -e "${YELLOW}uwsgi${NC}" -sed -i 's,procd_set_param stderr 1,procd_set_param stderr 0,g' feeds/packages/net/uwsgi/files/uwsgi.init -sed -i 's,buffer-size = 10000,buffer-size = 131072,g' feeds/packages/net/uwsgi/files-luci-support/luci-webui.ini -sed -i 's,logger = luci,#logger = luci,g' feeds/packages/net/uwsgi/files-luci-support/luci-webui.ini -sed -i '$a cgi-timeout = 600' feeds/packages/net/uwsgi/files-luci-support/luci-*.ini -sed -i 's/threads = 1/threads = 2/g' feeds/packages/net/uwsgi/files-luci-support/luci-webui.ini -sed -i 's/processes = 3/processes = 4/g' feeds/packages/net/uwsgi/files-luci-support/luci-webui.ini -sed -i 's/cheaper = 1/cheaper = 2/g' feeds/packages/net/uwsgi/files-luci-support/luci-webui.ini +echo -e "\nmsgid \"NAS\"" >> feeds/luci/modules/luci-base/po/zh_Hans/base.po +echo -e "msgstr \"网络存储\"" >> feeds/luci/modules/luci-base/po/zh_Hans/base.po -# rpcd -echo -e "${YELLOW}rpcd${NC}" -sed -i 's/option timeout 30/option timeout 60/g' package/system/rpcd/files/rpcd.config -sed -i 's#20) \* 1000#60) \* 1000#g' feeds/luci/modules/luci-base/htdocs/luci-static/resources/rpc.js +echo -e "\nmsgid \"VPN\"" >> feeds/luci/modules/luci-base/po/zh_Hans/base.po +echo -e "msgstr \"魔法网络\"" >> feeds/luci/modules/luci-base/po/zh_Hans/base.po -# mwan3 -echo -e "${YELLOW}负载均衡${NC}" -sed -i 's/MultiWAN 管理器/负载均衡/g' feeds/luci/applications/luci-app-mwan3/po/zh_Hans/mwan3.po +echo -e "\nmsgid \"Temperature\"" >> feeds/luci/modules/luci-base/po/zh_Hans/base.po +echo -e "msgstr \"温度\"" >> feeds/luci/modules/luci-base/po/zh_Hans/base.po + + +##配置ip等 +echo -e "${BLUE}#配置ip等${NC}" +sed -i 's|^TARGET_|# TARGET_|g; s|# TARGET_DEVICES += phicomm-k3|TARGET_DEVICES += phicomm-k3| ; s|# TARGET_DEVICES += phicomm_k3|TARGET_DEVICES += phicomm_k3|' target/linux/bcm53xx/image/Makefile +sed -i 's/192.168.1.1/10.0.0.1/g' package/base-files/files/bin/config_generate +sed -i 's/192.168.1.1/10.0.0.1/g' package/base-files/luci2/bin/config_generate + +##取消bootstrap为默认主题 +rm -rf ./feeds/luci/themes/luci-theme-argon +rm -rf ./feeds/luci/themes/luci-theme-design +rm -rf ./feeds/luci/themes/luci-theme-argon-mod + +rm -rf ./package/feeds/luci/luci-theme-argon +rm -rf ./package/feeds/luci/luci-theme-design +rm -rf ./package/feeds/luci/luci-theme-argon-mod + +sed -i '/set luci.main.mediaurlbase=\/luci-static\/bootstrap/d' feeds/luci/themes/luci-theme-bootstrap/root/etc/uci-defaults/30_luci-theme-bootstrap +sed -i 's/luci-theme-bootstrap/luci-theme-kucat/g' feeds/luci/collections/luci/Makefile +sed -i 's/luci-theme-bootstrap/luci-theme-kucat/g' feeds/luci/collections/luci-nginx/Makefile ##加入作者信息 -echo -e "${YELLOW}加入作者信息${NC}" -sed -i "s/DISTRIB_DESCRIPTION='*.*'/DISTRIB_DESCRIPTION='ZeroWrt-$(date +%Y%m%d)'/g" package/base-files/files/etc/openwrt_release -sed -i "s/DISTRIB_REVISION='*.*'/DISTRIB_REVISION=' By OPPEN321'/g" package/base-files/files/etc/openwrt_release +sed -i "s/DISTRIB_DESCRIPTION='*.*'/DISTRIB_DESCRIPTION='ZeroWrt-$(date +%Y%m%d)'/g" package/lean/default-settings/files/zzz-default-settings +sed -i "s/DISTRIB_REVISION='*.*'/DISTRIB_REVISION=' By OPPEN321'/g" package/lean/default-settings/files/zzz-default-settings -# 更换为 ImmortalWrt Uboot 以及 Target -echo -e "${YELLOW}更换为 ImmortalWrt Uboot 以及 Target${NC}" -git clone -b openwrt-24.10 --single-branch --filter=blob:none https://github.com/immortalwrt/immortalwrt immortalwrt -rm -rf ./target/linux/rockchip -cp -rf immortalwrt/target/linux/rockchip target/linux/rockchip -curl -L -o target/linux/rockchip/patches-6.6/014-rockchip-add-pwm-fan-controller-for-nanopi-r2s-r4s.patch https://raw.githubusercontent.com/oppen321/ZeroWrt/refs/heads/master/PATCH/kernel/rockchip/014-rockchip-add-pwm-fan-controller-for-nanopi-r2s-r4s.patch -curl -L -o target/linux/rockchip/patches-6.6/702-general-rk3328-dtsi-trb-ent-quirk.patch https://raw.githubusercontent.com/oppen321/ZeroWrt/refs/heads/master/PATCH/kernel/rockchip/702-general-rk3328-dtsi-trb-ent-quirk.patch -curl -L -o target/linux/rockchip/patches-6.6/703-rk3399-enable-dwc3-xhci-usb-trb-quirk.patch https://raw.githubusercontent.com/oppen321/ZeroWrt/refs/heads/master/PATCH/kernel/rockchip/703-rk3399-enable-dwc3-xhci-usb-trb-quirk.patch -curl -L -o target/linux/rockchip/patches-6.6/991-arm64-dts-rockchip-add-more-cpu-operating-points-for.patch https://github.com/immortalwrt/immortalwrt/raw/refs/heads/openwrt-23.05/target/linux/rockchip/patches-5.15/991-arm64-dts-rockchip-add-more-cpu-operating-points-for.patch -rm -rf package/boot/{rkbin,uboot-rockchip,arm-trusted-firmware-rockchip} -cp -rf immortalwrt/package/boot/uboot-rockchip package/boot/uboot-rockchip -cp -rf immortalwrt/package/boot/arm-trusted-firmware-rockchip package/boot/arm-trusted-firmware-rockchip -sed -i '/REQUIRE_IMAGE_METADATA/d' target/linux/rockchip/armv8/base-files/lib/upgrade/platform.sh -rm -rf immortalwrt -# Patch arm64 型号名称 -echo -e "${YELLOW}arm64 型号名称${NC}" -curl -L -o target/linux/generic/hack-6.6/312-arm64-cpuinfo-Add-model-name-in-proc-cpuinfo-for-64bit-ta.patch https://raw.githubusercontent.com/oppen321/ZeroWrt/refs/heads/master/PATCH/kernel/arm/312-arm64-cpuinfo-Add-model-name-in-proc-cpuinfo-for-64bit-ta.patch +sed -i "2iuci set istore.istore.channel='zero_oppen321'" package/lean/default-settings/files/zzz-default-settings +sed -i "3iuci commit istore" package/lean/default-settings/files/zzz-default-settings -# 移除要替换的包 -echo -e "${YELLOW}移除要替换的包${NC}" -rm -rf feeds/packages/net/{xray-core,v2ray-core,v2ray-geodata,sing-box,adguardhome,socat} -rm -rf feeds/packages/net/alist feeds/luci/applications/luci-app-alist -rm -rf feeds/packages/utils/v2dat -rm -rf feeds/packages/lang/golang -# Git稀疏克隆,只克隆指定目录到本地 -function git_sparse_clone() { - branch="$1" repourl="$2" && shift 2 - git clone --depth=1 -b $branch --single-branch --filter=blob:none --sparse $repourl - repodir=$(echo $repourl | awk -F '/' '{print $(NF)}') - cd $repodir && git sparse-checkout set $@ - mv -f $@ ../package - cd .. && rm -rf $repodir -} +##更改主机名 +sed -i "s/hostname='.*'/hostname='ZeroWrt'/g" package/base-files/files/bin/config_generate +sed -i "s/hostname='.*'/hostname='ZeroWrt'/g" package/base-files/luci2/bin/config_generate -# golong1.23依赖 -echo -e "${YELLOW}golong1.23依赖${NC}" -#git clone --depth=1 https://github.com/sbwml/packages_lang_golang -b 22.x feeds/packages/lang/golang -git clone https://git.kejizero.online/zhao/packages_lang_golang -b 23.x feeds/packages/lang/golang +##WiFi +sed -i "s/LEDE/ZeroWrt/g" package/kernel/mac80211/files/lib/wifi/mac80211.sh -# SSRP & Passwall -echo -e "${YELLOW}SSRP & Passwall${NC}" -git clone https://git.kejizero.online/zhao/openwrt_helloworld.git package/helloworld -b v5 +### fix speed +sed -i "s/speed = <2500>;/speed = <1000>;/g" target/linux/mediatek/dts/mt7622-*.dts +sed -i "s/speed = <2500>;/speed = <1000>;/g" target/linux/mediatek/dts/mt7623a-*.dts +sed -i "s/speed = <2500>;/speed = <1000>;/g" target/linux/mediatek/dts/mt7981b-*.dts +sed -i "s/speed = <2500>;/speed = <1000>;/g" target/linux/mediatek/dts/mt7986a-*.dts +sed -i "s/speed = <2500>;/speed = <1000>;/g" target/linux/mediatek/dts/mt7622-*.dtsi +sed -i "s/speed = <2500>;/speed = <1000>;/g" target/linux/mediatek/dts/mt7623a-*.dtsi -# Alist -echo -e "${YELLOW}Alist${NC}" -git clone https://git.kejizero.online/zhao/luci-app-alist package/alist -# Mosdns -echo -e "${YELLOW}Mosdns${NC}" -git clone https://git.kejizero.online/zhao/luci-app-mosdns.git -b v5 package/mosdns -git clone https://git.kejizero.online/zhao/v2ray-geodata.git package/v2ray-geodata +## +sed -i '/option Interface/d' package/network/services/dropbear/files/dropbear.config +## +rm -rf ./package/lean/k3screenctrl -# 锐捷认证 -echo -e "${YELLOW}锐捷认证${NC}" -git clone https://github.com/sbwml/luci-app-mentohust package/mentohust - -# Realtek 网卡 - R8168 & R8125 & R8126 & R8152 & R8101 -echo -e "${YELLOW}Realtek 网卡 - R8168 & R8125 & R8126 & R8152 & R8101${NC}" -rm -rf package/kernel/r8168 package/kernel/r8101 package/kernel/r8125 package/kernel/r8126 -git clone https://git.kejizero.online/zhao/package_kernel_r8168 package/kernel/r8168 -git clone https://git.kejizero.online/zhao/package_kernel_r8152 package/kernel/r8152 -git clone https://git.kejizero.online/zhao/package_kernel_r8101 package/kernel/r8101 -git clone https://git.kejizero.online/zhao/package_kernel_r8125 package/kernel/r8125 -git clone https://git.kejizero.online/zhao/package_kernel_r8126 package/kernel/r8126 - -# Adguardhome -echo -e "${YELLOW}Adguardhome${NC}" -git_sparse_clone master https://github.com/kenzok8/openwrt-packages adguardhome luci-app-adguardhome - -# iStore -echo -e "${YELLOW}iStore${NC}" -git_sparse_clone main https://github.com/linkease/istore-ui app-store-ui -git_sparse_clone main https://github.com/linkease/istore luci - -# Docker -echo -e "${YELLOW}Docker${NC}" -rm -rf feeds/luci/applications/luci-app-dockerman -git clone https://git.kejizero.online/zhao/luci-app-dockerman -b 24.10 feeds/luci/applications/luci-app-dockerman -rm -rf feeds/packages/utils/{docker,dockerd,containerd,runc} -git clone https://git.kejizero.online/zhao/packages_utils_docker feeds/packages/utils/docker -git clone https://git.kejizero.online/zhao/packages_utils_dockerd feeds/packages/utils/dockerd -git clone https://git.kejizero.online/zhao/packages_utils_containerd feeds/packages/utils/containerd -git clone https://git.kejizero.online/zhao/packages_utils_runc feeds/packages/utils/runc -sed -i '/sysctl.d/d' feeds/packages/utils/dockerd/Makefile -pushd feeds/packages - curl -s https://init.cooluc.com/openwrt/patch/docker/0001-dockerd-fix-bridge-network.patch | patch -p1 - curl -s https://init.cooluc.com/openwrt/patch/docker/0002-docker-add-buildkit-experimental-support.patch | patch -p1 - curl -s https://init.cooluc.com/openwrt/patch/docker/0003-dockerd-disable-ip6tables-for-bridge-network-by-defa.patch | patch -p1 -popd - -# UPnP -echo -e "${YELLOW}UPnP${NC}" -rm -rf feeds/{packages/net/miniupnpd,luci/applications/luci-app-upnp} -git clone https://git.kejizero.online/zhao/miniupnpd feeds/packages/net/miniupnpd -b v2.3.7 -git clone https://git.kejizero.online/zhao/luci-app-upnp feeds/luci/applications/luci-app-upnp -b master - -# Zero-package -echo -e "${YELLOW}Zero-package${NC}" -git clone --depth=1 https://github.com/oppen321/Zero-package package/Zero-package - -# 一键配置拨号 -echo -e "${YELLOW}一键配置拨号${NC}" -git clone --depth=1 https://github.com/sirpdboy/luci-app-netwizard package/luci-app-netwizard - -# 修改名称 -echo -e "${YELLOW}修改名称${NC}" -sed -i 's/OpenWrt/ZeroWrt/' package/base-files/files/bin/config_generate - -# Theme -echo -e "${YELLOW}Theme${NC}" -git clone https://github.com/sirpdboy/luci-theme-kucat package/luci-theme-kucat -b js - -# default-settings -echo -e "${YELLOW}default-settings${NC}" -git clone --depth=1 -b main https://github.com/oppen321/default-settings package/default-settings - -# Lucky -echo -e "${YELLOW}Lucky${NC}" -git clone https://github.com/gdy666/luci-app-lucky.git package/lucky - -# OpenAppFilter -echo -e "${YELLOW}OpenAppFilter${NC}" -git clone https://git.kejizero.online/zhao/OpenAppFilter --depth=1 package/OpenAppFilter - -# luci-app-partexp -echo -e "${YELLOW}luci-app-partexp${NC}" -git clone --depth=1 https://github.com/sirpdboy/luci-app-partexp package/luci-app-partexp +## rockchip +cp -af feeds/2305ipk/patch/rockchip/* target/linux/rockchip/armv8/base-files/ # 进阶设置 -echo -e "${YELLOW}进阶设置${NC}" git clone https://github.com/sirpdboy/luci-app-advancedplus package/luci-app-advancedplus -# luci-app-webdav -echo -e "${YELLOW}luci-app-webdav${NC}" -git clone https://git.kejizero.online/zhao/luci-app-webdav package/new/luci-app-webdav +# theme +git clone https://github.com/sirpdboy/luci-theme-kucat package/luci-theme-kucat -b js -# unzip -echo -e "${YELLOW}unzip${NC}" -rm -rf feeds/packages/utils/unzip -git clone https://github.com/sbwml/feeds_packages_utils_unzip feeds/packages/utils/unzip - -# frpc名称 -echo -e "${YELLOW}frpc名称${NC}" -sed -i 's,发送,Transmission,g' feeds/luci/applications/luci-app-transmission/po/zh_Hans/transmission.po -sed -i 's,frp 服务器,FRP 服务器,g' feeds/luci/applications/luci-app-frps/po/zh_Hans/frps.po -sed -i 's,frp 客户端,FRP 客户端,g' feeds/luci/applications/luci-app-frpc/po/zh_Hans/frpc.po - -# 必要的补丁 -echo -e "${YELLOW}必要的补丁${NC}" -pushd feeds/luci - curl -s https://raw.githubusercontent.com/oppen321/path/refs/heads/main/Firewall/0001-luci-mod-status-firewall-disable-legacy-firewall-rul.patch | patch -p1 -popd - -# NTP -echo -e "${YELLOW}NTP${NC}" -sed -i 's/0.openwrt.pool.ntp.org/ntp1.aliyun.com/g' package/base-files/files/bin/config_generate -sed -i 's/1.openwrt.pool.ntp.org/ntp2.aliyun.com/g' package/base-files/files/bin/config_generate -sed -i 's/2.openwrt.pool.ntp.org/time1.cloud.tencent.com/g' package/base-files/files/bin/config_generate -sed -i 's/3.openwrt.pool.ntp.org/time2.cloud.tencent.com/g' package/base-files/files/bin/config_generate +# 设置向导 +git clone --depth=1 https://github.com/sirpdboy/luci-app-netwizard package/luci-app-netwizard # ZeroWrt选项菜单 -echo -e "${YELLOW}ZeroWrt选项菜单${NC}" mkdir -p files/bin curl -L -o files/bin/ZeroWrt https://git.kejizero.online/zhao/files/raw/branch/main/bin/ZeroWrt chmod +x files/bin/ZeroWrt @@ -267,22 +144,6 @@ mkdir -p files/root curl -L -o files/root/version.txt https://git.kejizero.online/zhao/files/raw/branch/main/bin/version.txt chmod +x files/root/version.txt -# Adguardhome设置 -echo -e "${YELLOW}Adguardhome设置${NC}" -mkdir -p files/etc -curl -L -o files/etc/AdGuardHome-dnslist.yaml https://git.kejizero.online/zhao/files/raw/branch/main/etc/AdGuardHome-dnslist.yaml -chmod +x files/etc/AdGuardHome-dnslist.yaml -curl -L -o files/etc/AdGuardHome-mosdns.yaml https://git.kejizero.online/zhao/files/raw/branch/main/etc/AdGuardHome-mosdns.yaml -chmod +x files/etc/AdGuardHome-mosdns.yaml - -# Nginx -echo -e "${YELLOW}Nginx${NC}" -mkdir -p files/etc/config -curl -L -o files/etc/config/nginx https://git.kejizero.online/zhao/files/raw/branch/main/etc/nginx/nginx - -./scripts/feeds update -a -./scripts/feeds install -a - # 加载 .config echo -e "${YELLOW}加载 .config${NC}" echo -e "${YELLOW}加载自定义配置...${NC}"