From 4a9cec8818f05f34d8bacd378fe12cd2b9afa911 Mon Sep 17 00:00:00 2001 From: haotian <2421912570@qq.com> Date: Thu, 26 Feb 2026 22:10:35 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dgithub=E6=97=A0=E6=B3=95?= =?UTF-8?q?=E8=AE=BF=E9=97=AE=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/install_deps.sh | 50 ++++++++++++++++++++++++++++++++++------- 1 file changed, 42 insertions(+), 8 deletions(-) diff --git a/scripts/install_deps.sh b/scripts/install_deps.sh index 23d3a8b..d33229f 100755 --- a/scripts/install_deps.sh +++ b/scripts/install_deps.sh @@ -77,7 +77,8 @@ install_basic_tools() { htop \ vim \ net-tools \ - v4l-utils + v4l-utils \ + unzip echo -e "${GREEN}✓${NC} 基础工具安装完成" } @@ -90,9 +91,19 @@ install_mpp() { cd "$TEMP_DIR" - # 克隆MPP + # 克隆MPP(带重试和镜像) if [ ! -d "mpp" ]; then - git clone https://github.com/rockchip-linux/mpp.git + echo " 尝试从 GitHub 克隆 MPP..." + git clone https://github.com/rockchip-linux/mpp.git 2>/dev/null || \ + git clone https://ghproxy.com/https://github.com/rockchip-linux/mpp.git 2>/dev/null || \ + git clone https://mirror.ghproxy.com/https://github.com/rockchip-linux/mpp.git 2>/dev/null || { + echo -e "${YELLOW}Git 克隆失败,尝试下载 ZIP...${NC}" + wget -O mpp.zip https://ghproxy.com/https://github.com/rockchip-linux/mpp/archive/refs/heads/develop.zip 2>/dev/null || \ + wget -O mpp.zip https://mirror.ghproxy.com/https://github.com/rockchip-linux/mpp/archive/refs/heads/develop.zip 2>/dev/null || \ + wget -O mpp.zip https://github.com/rockchip-linux/mpp/archive/refs/heads/develop.zip + unzip -q mpp.zip + mv mpp-develop mpp + } fi cd mpp @@ -125,9 +136,19 @@ install_rga() { cd "$TEMP_DIR" - # 克隆RGA + # 克隆RGA(带重试和镜像) if [ ! -d "rkrga" ]; then - git clone https://github.com/rockchip-linux/rkrga.git + echo " 尝试从 GitHub 克隆 RGA..." + git clone https://github.com/rockchip-linux/rkrga.git 2>/dev/null || \ + git clone https://ghproxy.com/https://github.com/rockchip-linux/rkrga.git 2>/dev/null || \ + git clone https://mirror.ghproxy.com/https://github.com/rockchip-linux/rkrga.git 2>/dev/null || { + echo -e "${YELLOW}Git 克隆失败,尝试下载 ZIP...${NC}" + wget -O rkrga.zip https://ghproxy.com/https://github.com/rockchip-linux/rkrga/archive/refs/heads/main.zip 2>/dev/null || \ + wget -O rkrga.zip https://mirror.ghproxy.com/https://github.com/rockchip-linux/rkrga/archive/refs/heads/main.zip 2>/dev/null || \ + wget -O rkrga.zip https://github.com/rockchip-linux/rkrga/archive/refs/heads/main.zip + unzip -q rkrga.zip + mv rkrga-main rkrga + } fi cd rkrga @@ -167,9 +188,13 @@ install_rknn() { RKNN_DEB="rknpu2_${RKNN_VERSION}_arm64.deb" if [ ! -f "$RKNN_DEB" ]; then + echo " 尝试下载 RKNN Runtime..." + wget "https://ghproxy.com/https://github.com/rockchip-linux/rknpu2/releases/download/v${RKNN_VERSION}/${RKNN_DEB}" \ + -O "$RKNN_DEB" 2>/dev/null || \ wget "https://github.com/rockchip-linux/rknpu2/releases/download/v${RKNN_VERSION}/${RKNN_DEB}" \ -O "$RKNN_DEB" 2>/dev/null || { echo -e "${YELLOW}警告: 无法下载RKNN包,请手动安装${NC}" + echo " 手动下载地址: https://github.com/rockchip-linux/rknpu2/releases" return 0 } fi @@ -209,9 +234,18 @@ install_ffmpeg_rk() { echo " 使用项目自带的 ffmpeg-rockchip" cd "$PROJECT_DIR/ffmpeg-rockchip" else - # 克隆ffmpeg-rockchip - echo " 下载 ffmpeg-rockchip..." - git clone https://github.com/nyanmisaka/ffmpeg-rockchip.git + # 克隆ffmpeg-rockchip(带重试和镜像) + echo " 尝试下载 ffmpeg-rockchip..." + git clone https://github.com/nyanmisaka/ffmpeg-rockchip.git 2>/dev/null || \ + git clone https://ghproxy.com/https://github.com/nyanmisaka/ffmpeg-rockchip.git 2>/dev/null || \ + git clone https://mirror.ghproxy.com/https://github.com/nyanmisaka/ffmpeg-rockchip.git 2>/dev/null || { + echo -e "${YELLOW}Git 克隆失败,尝试下载 ZIP...${NC}" + wget -O ffmpeg-rockchip.zip https://ghproxy.com/https://github.com/nyanmisaka/ffmpeg-rockchip/archive/refs/heads/master.zip 2>/dev/null || \ + wget -O ffmpeg-rockchip.zip https://mirror.ghproxy.com/https://github.com/nyanmisaka/ffmpeg-rockchip/archive/refs/heads/master.zip 2>/dev/null || \ + wget -O ffmpeg-rockchip.zip https://github.com/nyanmisaka/ffmpeg-rockchip/archive/refs/heads/master.zip + unzip -q ffmpeg-rockchip.zip + mv ffmpeg-rockchip-master ffmpeg-rockchip + } cd ffmpeg-rockchip fi