Files
target_linux_rockchip-6.x/.github/diy/sync.sh
2026-01-17 09:55:15 +08:00

32 lines
840 B
Bash

#!/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 target/linux/rockchip
curl -s https://raw.githubusercontent.com/immortalwrt/immortalwrt/refs/heads/openwrt-25.12/target/linux/rockchip/modules.mk > ./modules.mk