-
Notifications
You must be signed in to change notification settings - Fork 1
/
sync.sh
executable file
·80 lines (63 loc) · 1.88 KB
/
sync.sh
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
#!/usr/bin/env bash
SCRIPT_PATH="$(cd "$(dirname "$(readlink -f "$0")")";pwd -P)"
MIRROR_ROOT="${SCRIPT_PATH}/../.."
export REPO_TRACE=0
# Default to repo sync -j64
SYNC_JOBS=64
while [ "${#}" -gt 0 ]; do
case "${1}" in
-j | --jobs )
SYNC_JOBS="${2}";
;;
esac
shift
done
# Sync the scripts and required manifests
pushd ${MIRROR_ROOT}/scripts
repo sync -j"${SYNC_JOBS}" -vv --fail-fast
scripts/kernel-metadata-regen-lineage.sh
scripts/kernel-metadata-regen-calyx.sh
popd
# Sync linux and linux-stable kernels
pushd ${MIRROR_ROOT}/kernel/linux
repo sync -vv --fail-fast torvalds/linux
repo sync -vv --fail-fast stable/linux
popd
# Sync google kernels
pushd ${MIRROR_ROOT}/kernel/aosp
repo sync -vv --fail-fast kernel/common
repo sync -j"${SYNC_JOBS}" -vv --fail-fast
popd
# Sync qcom kernels
pushd ${MIRROR_ROOT}/kernel/caf
# TODO: fix this once repo supports refs removal in git config
#repo sync -j"${SYNC_JOBS}" -vv --fail-fast
ls -d kernel/*.git | parallel -j"${SYNC_JOBS}" git -C {} fetch clo
popd
# Sync AOSP mirror
pushd ${MIRROR_ROOT}/aosp
repo sync -j"${SYNC_JOBS}" -vv --fail-fast
popd
# Sync LineageOS mirror and set up alternates to AOSP and kernel mirrors
pushd ${MIRROR_ROOT}/scripts
scripts/aosp-mirror-to-lineage.sh
scripts/kernel-mirror-to-lineage.sh
popd
pushd ${MIRROR_ROOT}/lineage
repo sync -j"${SYNC_JOBS}" -vv --fail-fast --no-clone-bundle
popd
# Sync CalyxOS mirror and set up alternates to AOSP and kernel mirrors
pushd ${MIRROR_ROOT}/scripts
scripts/aosp-mirror-to-calyx.sh
scripts/kernel-mirror-to-calyx.sh
popd
pushd ${MIRROR_ROOT}/calyx
repo sync -j"${SYNC_JOBS}" -vv --fail-fast --no-clone-bundle
popd
# Sync proprietary files mirrors
pushd ${MIRROR_ROOT}/muppets
repo sync -j"${SYNC_JOBS}" -vv --fail-fast --no-clone-bundle
popd
pushd ${MIRROR_ROOT}/the-muppets
repo sync -j"${SYNC_JOBS}" -vv --fail-fast --no-clone-bundle
popd