fuchsia 国内源码镜像
https://fuchsia.fsf.org.cn/
准备工作
下载 cipd jiri 工具(此版本非官方镜像)
mkdir fuchsia && cd fuchsia
curl --location --create-dirs --output .jiri_root/bin/cipd https://fuchsia.fsf.org.cn/bootstrap/cipd-linux-amd64
curl --location --create-dirs --output .jiri_root/bin/jiri https://fuchsia.fsf.org.cn/bootstrap/jiri-linux-amd64
chmod +x .jiri_root/bin/jiri .jiri_root/bin/jiri
export PATH=${PATH}:${PWD}/.jiri_root/bin
下载代码
从零使用镜像
方案一
mkdir -p build && echo "internal_access = false" >build/cipd.gni
jiri init -keep-git-hooks=true
jiri import -name=integration flower https://fuchsia.fsf.org.cn/git/fuchsia-integration
jiri update -v
echo "have_firmware = false" >zircon/prebuilt/config.gni
方案二
manifest 文件自行从 https://fuchsia.fsf.org.cn/manifest/ 选择,一个月以内的文件确保有效。
mkdir -p build && echo "internal_access = false" >build/cipd.gni
jiri init -keep-git-hooks=true
curl --location --output .jiri_manifest https://fuchsia.fsf.org.cn/manifest/fuchsia-20060102.xml
jiri update -v
echo "have_firmware = false" >zircon/prebuilt/config.gni
切换国内镜像
先删除相关文件
rm -rf integration jiri .jiri_manifest .jiri_root
下载 cipd jiri 工具并使用国内镜像,参见上面的教程。
恢复官方仓库
rm -rf integration jiri .jiri_manifest .jiri_root
curl -s https://fuchsia.googlesource.com/jiri/+/master/scripts/bootstrap_jiri?format=TEXT | base64 --decode | bash -s ${PWD}
jiri init -keep-git-hooks=true
jiri import -name=integration flower https://fuchsia.googlesource.com/integration
jiri update -v
========= End