Repo下載使用記錄

#1.  安裝Git

# ubuntu系統直接使用sudo apt-get install git-core就能完成安裝。
# 安裝完成之後可以順便配置一下個人信息:  
  git config --global user.email "[email protected]"
  git config --global user.name "Your Name"

 

#2.  設置環境變量和repo安裝目錄

# 將下載repo的路徑加入環境變量
mkdir ~/bin
vim ~/.bashrc
+export PATH=~/bin:$PATH
source ~/.bashrc

 

#3.  repo工具的安裝

###網上已知可以下載repo的網址
#1. curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
#2. 可以從清華aosp鏡像網站git clone下一個整個倉庫。然後把倉庫裏面的repo文件複製到 ~/bin目錄下面。
    git clone https://aosp.tuna.tsinghua.edu.cn/tools/repo 
    

 

#4.  建立工作目錄  &&  初始化倉庫

建立工作目錄:
mkdir sourcecode && cd sourcecode

初始化倉庫:
repo init -u https://source.codeaurora.org/quic/la/platform/manifest.git \
-b release -m LA.UM.6.6.r1-02700-89xx.0.xml \
--repo-url=https://aosp.tuna.tsinghua.edu.cn/tools/repo 

 

 #5.  repo sync同步下載

repo sync -cdj 4 --no-tags  #一般是這樣用的。

 

#6.  加快repo下載速度 - 建立本地mirror 

### 初始化本地mirror  
mkdir /home/mirror && cd /home/mirror    //注意首次初始化mirror需在一個空目錄下

repo init -u https://aosp.tuna.tsinghua.edu.cn/platform/manifest \
-b android-4.0.1_r1 \
--repo-url=https://aosp.tuna.tsinghua.edu.cn/tools/repo \
--mirror

這樣就初始化好本地鏡像了。然後執行repo sync命令。網絡不好的情況請多執行 repo sync 幾次。
repo sync -cdj 4 --no-tags



### 下載sourcecode時使用本地mirror 
cd  {DIR}/sourcecode

repo init -u https://aosp.tuna.tsinghua.edu.cn/platform/manifest \
-b android-4.0.1_r1 \
--repo-url=https://aosp.tuna.tsinghua.edu.cn/tools/repo \
--reference  /home/mirror

repo sync -cdj 4 --no-tags

 

#7.  總結 

初次使用repo下載sdk,各種注意點尚未完善,以待日後補全。 

 

#8.  參考博客 

感謝: \ (≥▽≤) /

[1]  Android下的配置管理之道之repo的使用  -  馬哥私房菜

[2]  repo下載QSDK代碼全記錄 - openwrt技術開發網 

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章