修复github无法访问的问题

This commit is contained in:
haotian 2026-02-26 22:10:35 +08:00
parent 261e46fdc2
commit 4a9cec8818

View File

@ -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