AOSP源碼編譯Ubuntu

Aosp官方教程
Ubuntu18.0.4下載ubuntu-18.04.5-desktop-amd64.iso

創(chuàng)建Ubuntu虛擬機

自定義高級=>安裝程序光盤映像文件(iso)=>輸入虛擬機名稱核畴、賬號密碼=>各種虛擬機配置=>創(chuàng)建新虛擬磁盤=>將虛擬磁盤拆分成多個文件=>耐心等待

為Ubuntu開啟ssh服務
//查看是否安裝ssh服務,若出現(xiàn)connect to host localhost port 22: Connection refused則表示未開啟ssh服務
ssh localhost ssh
//開啟ssh服務
sudo apt-get install openssh-server
//啟動ssh服務
sudo /etc/init.d/ssh start
設置ubuntu為靜態(tài)ip

ifconfig查看網(wǎng)卡名稱


網(wǎng)卡名稱

1.sudo nano /etc/network/interfaces 修改內(nèi)容為:

# interfaces(5) file used by ifup(8) and ifdown(8)
auto lo
iface lo inet loopback
auto ens33
iface ens33 inet static
address 192.168.1.23
netmask 255.255.255.0
gateway 192.168.1.99

2.sudo nano /etc/resolv.conf 修改內(nèi)容為nameserver 8.8.8.8
3.service networking restart 重啟網(wǎng)卡,如果報錯直接重啟電腦,然后再按照第2部操作即可。

安裝中文輸入法
sudo apt-get install fcitx-bin
sudo apt-get install fcitx-table

打開ubuntu的settings=>Region&Language=>Manage Installed Languages=>RemindMeLater


image.png

先點擊Install/Remove Language兄淫,把Chineses(simplified) 選進去后,點apply,再點Apply system-wide后重啟系統(tǒng)


image.png

運行apt get報錯如下:

E: Could not get lock /var/lib/dpkg/lock-frontend - open (11: Resource temporarily unavailable)
E: Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), is another process using it?

可以這樣解決:

sudo rm /var/lib/dpkg/lock-frontend
sudo rm /var/lib/dpkg/lock
sudo rm /var/cache/apt/archives/lock
aosp8.1.0+ubuntu18.0.4 源碼編譯

安裝依賴:

sudo apt-get install git-core gnupg flex bison build-essential zip curl zlib1g-dev gcc-multilib g++-multilib libc6-dev-i386 lib32ncurses5-dev x11proto-core-dev libx11-dev lib32z1-dev libgl1-mesa-dev libxml2-utils xsltproc unzip fontconfig

修改為中科大源

//進入到/etc/apt:備份sources.list
ruin@ubuntu:/etc/apt$ sudo cp sources.list sources.list.bak
nano sources.list添加sources.list的源
deb https://mirrors.ustc.edu.cn/ubuntu/ bionic main restricted universe multiverse
deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse

更新源

sudo apt-get update

安裝python

//確保python2和python3都安裝
apt-get install python
apt-get install python3

安裝 Repo

sudo nano /etc/profile
export PATH=~/bin:$PATH
curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
chmod a+x ~/bin/repo

同步中科大源aosp版本號
中科大aosp開源鏡像

// cd到自己創(chuàng)建的目錄
cd /home/ruin/Desktop/AOSP8.1.0
repo init -u git://mirrors.ustc.edu.cn/aosp/platform/manifest -b android-8.1.0_r1 

如果遇到下面錯誤,則需要編輯bash.rc,然后退出終端再打開終端

fatal: Cannot get https://gerrit.googlesource.com/git-repo/clone.bundle
fatal: error [Errno 110] Connection timed out
fatal: cloning the git-repo repository failed, will remove '.repo/repo' 

ruin@ubuntu:~$ sudo nano .bashrc
//把下面命令復制到.bashrc文件中并重啟終端
export REPO_URL='https://mirrors.tuna.tsinghua.edu.cn/git/git-repo'

重新運行repo,并設置郵箱

git config --global user.email "Ruin@example.com"
git config --global user.name "Ruin"
PATH=~/bin:$PATH
repo init -u git://mirrors.ustc.edu.cn/aosp/platform/manifest -b android-8.1.0_r1

下載源碼

ruin@ubuntu:~/Desktop/AOSP8.1.0$repo sync -j4
最后編輯于
?著作權歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
  • 序言:七十年代末逃延,一起剝皮案震驚了整個濱河市,隨后出現(xiàn)的幾起案子轧拄,更是在濱河造成了極大的恐慌揽祥,老刑警劉巖,帶你破解...
    沈念sama閱讀 216,544評論 6 501
  • 序言:濱河連續(xù)發(fā)生了三起死亡事件檩电,死亡現(xiàn)場離奇詭異拄丰,居然都是意外死亡,警方通過查閱死者的電腦和手機俐末,發(fā)現(xiàn)死者居然都...
    沈念sama閱讀 92,430評論 3 392
  • 文/潘曉璐 我一進店門料按,熙熙樓的掌柜王于貴愁眉苦臉地迎上來,“玉大人卓箫,你說我怎么就攤上這事载矿。” “怎么了烹卒?”我有些...
    開封第一講書人閱讀 162,764評論 0 353
  • 文/不壞的土叔 我叫張陵闷盔,是天一觀的道長。 經(jīng)常有香客問我旅急,道長蜂科,這世上最難降的妖魔是什么员帮? 我笑而不...
    開封第一講書人閱讀 58,193評論 1 292
  • 正文 為了忘掉前任钩乍,我火速辦了婚禮卤档,結(jié)果婚禮上逃贝,老公的妹妹穿的比我還像新娘。我一直安慰自己盟迟,他們只是感情好秋泳,可當我...
    茶點故事閱讀 67,216評論 6 388
  • 文/花漫 我一把揭開白布。 她就那樣靜靜地躺著攒菠,像睡著了一般迫皱。 火紅的嫁衣襯著肌膚如雪。 梳的紋絲不亂的頭發(fā)上辖众,一...
    開封第一講書人閱讀 51,182評論 1 299
  • 那天卓起,我揣著相機與錄音,去河邊找鬼凹炸。 笑死戏阅,一個胖子當著我的面吹牛,可吹牛的內(nèi)容都是我干的啤它。 我是一名探鬼主播奕筐,決...
    沈念sama閱讀 40,063評論 3 418
  • 文/蒼蘭香墨 我猛地睜開眼,長吁一口氣:“原來是場噩夢啊……” “哼变骡!你這毒婦竟也來了离赫?” 一聲冷哼從身側(cè)響起,我...
    開封第一講書人閱讀 38,917評論 0 274
  • 序言:老撾萬榮一對情侶失蹤塌碌,失蹤者是張志新(化名)和其女友劉穎渊胸,沒想到半個月后,有當?shù)厝嗽跇淞掷锇l(fā)現(xiàn)了一具尸體台妆,經(jīng)...
    沈念sama閱讀 45,329評論 1 310
  • 正文 獨居荒郊野嶺守林人離奇死亡翎猛,尸身上長有42處帶血的膿包…… 初始之章·張勛 以下內(nèi)容為張勛視角 年9月15日...
    茶點故事閱讀 37,543評論 2 332
  • 正文 我和宋清朗相戀三年,在試婚紗的時候發(fā)現(xiàn)自己被綠了接剩。 大學時的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片切厘。...
    茶點故事閱讀 39,722評論 1 348
  • 序言:一個原本活蹦亂跳的男人離奇死亡,死狀恐怖懊缺,靈堂內(nèi)的尸體忽然破棺而出疫稿,到底是詐尸還是另有隱情,我是刑警寧澤桐汤,帶...
    沈念sama閱讀 35,425評論 5 343
  • 正文 年R本政府宣布而克,位于F島的核電站靶壮,受9級特大地震影響怔毛,放射性物質(zhì)發(fā)生泄漏。R本人自食惡果不足惜腾降,卻給世界環(huán)境...
    茶點故事閱讀 41,019評論 3 326
  • 文/蒙蒙 一拣度、第九天 我趴在偏房一處隱蔽的房頂上張望。 院中可真熱鬧,春花似錦抗果、人聲如沸筋帖。這莊子的主人今日做“春日...
    開封第一講書人閱讀 31,671評論 0 22
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽日麸。三九已至,卻和暖如春逮光,著一層夾襖步出監(jiān)牢的瞬間代箭,已是汗流浹背。 一陣腳步聲響...
    開封第一講書人閱讀 32,825評論 1 269
  • 我被黑心中介騙來泰國打工涕刚, 沒想到剛下飛機就差點兒被人妖公主榨干…… 1. 我叫王不留嗡综,地道東北人。 一個月前我還...
    沈念sama閱讀 47,729評論 2 368
  • 正文 我出身青樓杜漠,卻偏偏與公主長得像极景,于是被迫代替她去往敵國和親。 傳聞我的和親對象是個殘疾皇子驾茴,可洞房花燭夜當晚...
    茶點故事閱讀 44,614評論 2 353

推薦閱讀更多精彩內(nèi)容