From 3ffeb904bb5b0fc0262bd4feb69844f0870d94fe Mon Sep 17 00:00:00 2001 From: Olia Lisa Date: Sat, 27 Jun 2026 13:23:29 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=A6=82=E6=9E=9C=E6=89=BE=E4=B8=8D?= =?UTF-8?q?=E5=88=B0files=E6=96=87=E4=BB=B6=E5=A4=B9,=20=E8=B7=B3=E8=BF=87?= =?UTF-8?q?=E5=A4=8D=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- r2s.sh | 8 +++++++- x86-64.sh | 7 ++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/r2s.sh b/r2s.sh index 136ef37..df5c270 100644 --- a/r2s.sh +++ b/r2s.sh @@ -129,7 +129,13 @@ build(){ cd "$BUILDER_DIR" mkdir -p "$FILES_DIR" - cp "${SCRIPT_DIR}"/files/* "$BUILDER_DIR/files/" -rf + # 复制 files 目录下的自定义文件到 Image Builder 的 files 目录 + if [ -d "${SCRIPT_DIR}/files" ]; then + echo -e "${YELLOW}[提示] 复制自定义 files/ 目录到 Image Builder${NC}" + cp ${SCRIPT_DIR}/files/* $BUILDER_DIR/files/ -rf + else + echo -e "${YELLOW}[提示] 未找到自定义 files/ 目录,跳过复制${NC}" + fi # 禁用 x86 Image Builder 中常见的额外镜像格式;rockchip 目标不存在时会自动跳过 sed -i \ diff --git a/x86-64.sh b/x86-64.sh index 9c393a1..b1c4e72 100644 --- a/x86-64.sh +++ b/x86-64.sh @@ -136,7 +136,12 @@ build(){ cd "$BUILDER_DIR" # 复制 files 目录下的自定义文件到 Image Builder 的 files 目录 - cp ${SCRIPT_DIR}/files/* $BUILDER_DIR/files/ -rf + if [ -d "${SCRIPT_DIR}/files" ]; then + echo -e "${YELLOW}[提示] 复制自定义 files/ 目录到 Image Builder${NC}" + cp ${SCRIPT_DIR}/files/* $BUILDER_DIR/files/ -rf + else + echo -e "${YELLOW}[提示] 未找到自定义 files/ 目录,跳过复制${NC}" + fi # 修改.config文件, 不构建以下格式固件 sed -i \