diff --git a/.github/diy/sync.sh b/.github/diy/sync.sh new file mode 100644 index 0000000..f9d21ad --- /dev/null +++ b/.github/diy/sync.sh @@ -0,0 +1,31 @@ +#!/bin/bash + +# Git 稀疏克隆 OpenWrt rockchip 内容到【当前目录】 +git_sparse_clone() { + branch="$1" + repourl="$2" + sparse_path="$3" + + git clone \ + --depth=1 \ + -b "$branch" \ + --single-branch \ + --filter=blob:none \ + --sparse \ + "$repourl" + + repodir="$(basename "$repourl" .git)" + cd "$repodir" || exit 1 + + git sparse-checkout set "$sparse_path" + + # 把 rockchip 目录里的内容直接移到外面的当前目录 + mv "$sparse_path"/* ../ + mv "$sparse_path"/.[!.]* ../ 2>/dev/null || true + mv "$sparse_path"/..?* ../ 2>/dev/null || true + + cd .. + rm -rf "$repodir" +} + +git_sparse_clone openwrt-25.12 https://github.com/openwrt/openwrt.git package/boot/uboot-rockchip \ No newline at end of file