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 \