-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathquickstart.sh
More file actions
executable file
·43 lines (31 loc) · 987 Bytes
/
quickstart.sh
File metadata and controls
executable file
·43 lines (31 loc) · 987 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/bin/sh
# set -x
# subrepo_fetch_loop(repo, extra update option)
subrepo_fetch_loop() {
depth=10
step=100
until git submodule update --init ${2} --depth $depth --progress ${1}
do
depth=$(($depth + $step))
echo "[v] Set depth to $depth ..."
done
}
# fetch_repo(parent directory, repo list, extra update option)
fetch_repo() {
echo "[*] Update repositories under ${1}"
cd ${1}
for repo in ${2}
do
commit=$(git submodule status | grep -oe "\([0-9a-z]*\) $repo" | grep -oe "^\([0-9a-z]*\)")
echo "[-] $repo -> $commit"
subrepo_fetch_loop $repo "${3}"
done
cd $root
}
root="$(dirname "$(readlink -f "$0")")"
NJOB=4
root_repo_list=${ROOT_LIST:-"buildroot riscv-gnu-toolchain riscv-pk linux riscv-isa-sim"}
toolchain_repo_list=${TOOLCHAIN_LIST:-"riscv-binutils riscv-gcc riscv-glibc riscv-newlib riscv-gdb"}
fetch_repo "$root/repo" "$root_repo_list" "--jobs $NJOB"
fetch_repo "$root/repo/riscv-gnu-toolchain" "$toolchain_repo_list" "--recursive --jobs $NJOB"
echo "[*] done"