Ubuntu 22.04はaosp 13ソースコードをコンパイルします

1.

sudo apt installcurlを実行する

test@test-Lenovo:~$mkdir~/bin

test@test-Lenovo:~$ PATH=~/bin:$PATH

test@test-Lenovo:~$curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo

test@test-Lenovo:~$ chmod a+x ~/bin/repo

test@test-Lenovo:~$ mkdir aosp

test@test-Lenovo:~$ cd aosp/

test@test-Lenovo:~/aosp$ repo init -u https://mirrors.tuna.tsinghua.edu.cn/git/AOSP/platform/manifest

/usr/bin/env: 'python': そのようなファイルまたはディレクトリはありません

5.python3 がインストールされているので、リンクする必要があります:

test@test-Lenovo:~$ cd /usr/bin/

test@test-Lenovo:/usr/bin$ ls -l | grep Python

lrwxrwxrwx 1 root root 23 7月 22 03:07 pdb3.8 -> ../lib/python3.8/pdb.py

lrwxrwxrwx 1 ルート root 31 7月 22 03:07 py3versions -> ../share/python3/py3versions.py

lrwxrwxrwx 1 ルート ルート 9 7月 22 03:07 python3 -> python3.8

-rwxr-xr-x 1 ルート ルート 5490352 6月 2 18:49 python3.8

-rwxr-xr-x 1 ルート root 384 3月 28 2020 python3-futurize

-rwxr-xr-x 1 ルート root 388 3月 28 2020 python3-pasteurize

test@test-Lenovo:/usr/bin$ sudo ln -s python3 python

test@test-Lenovo:/usr/bin$ ls -l | grep Python

lrwxrwxrwx 1 root root 23 7月 22 03:07 pdb3.8 -> ../lib/python3.8/pdb.py

lrwxrwxrwx 1 ルート root 31 7月 22 03:07 py3versions -> ../share/python3/py3versions.py

lrwxrwxrwx 1 ルート root 7 11月 15 22:53 python -> python3

lrwxrwxrwx 1 ルート ルート 9 7月 22 03:07 python3 -> python3.8

-rwxr-xr-x 1 ルート ルート 5490352 6月 2 18:49 python3.8

-rwxr-xr-x 1 ルート root 384 3月 28 2020 python3-futurize

-rwxr-xr-x 1 ルート root 388 3月 28 2020 python3-pasteurize

test@test-Lenovo:~/aosp$ repo init -u https://mirrors.tuna.tsinghua.edu.cn/git/AOSP/platform/manifest

リポジトリ: エラー: 「git」は使用できません

リポジトリ: エラー: [Errno 2] そのようなファイルまたはディレクトリはありません: 'git'

git がインストールされており、パスにあることを確認してください。

test@test-Lenovo:~/aosp$ sudo apt-get install git

test@test-Lenovo:~/aosp$ repo init -u https://mirrors.tuna.tsinghua.edu.cn/git/AOSP/platform/manifest

https://gerrit.googlesource.com/git-repo からリポジトリ ソースをダウンロードする

リポジトリの実行プロセス中に、公式 git ソース (errit.googlesource.com) にアクセスして自身を更新しようとします。tuna のミラー ソースを使用して更新したい場合は、次の内容を ~/ にコピーできます。 bashrc

import REPO_URL='https://mirrors.tuna.tsinghua.edu.cn/git/git-repo'

test@test-Lenovo:~/aosp$ vi ~/.bashrc

test@test-Lenovo:~/aosp$ sudo apt-get install vim

test@test-Lenovo:~/aosp$ ソース ~/.bashrc

test@test-Lenovo:~/aosp$ repo init -u https://mirrors.tuna.tsinghua.edu.cn/git/AOSP/platform/manifest

https://mirrors.tuna.tsinghua.edu.cn/git/git-repo からリポジトリ ソースをダウンロード

致命的: /home/test/aosp/.repo/repo ディレクトリを作成できません: ファイルが存在します

致命的: git-repo リポジトリのクローン作成に失敗しました。「.repo/repo」が削除されます

test@test-Lenovo:~/aosp$ rm .repo/ -rf

test@test-Lenovo:~/aosp$ repo init -u https://mirrors.tuna.tsinghua.edu.cn/git/AOSP/platform/manifest

https://mirrors.tuna.tsinghua.edu.cn/git/git-repo からリポジトリ ソースをダウンロード

致命的: 'https://mirrors.tuna.tsinghua.edu.cn/git/git-repo/' にアクセスできません: サーバー証明書の検証に失敗しました。CA ファイル: なし CRL ファイル: なし

test@test-Lenovo:~/aosp$ git config --global http.sslverify false

test@test-Lenovo:~/aosp$ git config --global user.email "[email protected]"

test@test-Lenovo:~/aosp$ git config --global user.name "test"

test@test-Lenovo:~/aosp$ repo init -u https://mirrors.tuna.tsinghua.edu.cn/git/AOSP/platform/manifest

リポジトリは /home/test/aosp で初期化されました

test@test-Lenovo:~/aosp$ リポジトリ同期

9.Java JDKをインストールします。

sudo apt-get install openjdk-8-jdk を実行します。

10.すべてのライブラリをインストールします。

sudo apt-get install libx11-dev:i386 libreadline6-dev:i386 libgl1-mesa-dev

sudo apt-get install -y git flex bison gperf build-essential libncurses5-dev:i386

sudo apt-get install tofrodos python-markdown libxml2-utils xsltproc zlib1g-dev:i386

sudo apt-get install dpkg-dev libsdl1.2-dev

sudo apt-get install git-core gnupg flex bison gperf build-essential

sudo apt-get install zipcurl zlib1g-dev gcc-multilib

sudo apt-get install libc6-dev-i386

sudo apt-get install lib32ncurses5-dev x11proto-core-dev libx11-dev

sudo apt-get install libgl1-mesa-dev libxml2-utils xsltproc unzip m4

sudo apt-get install lib32z-dev ccache

sudo apt-get install libssl-dev libncurses5

自分で要約: ブランチ切り替え =========================================== === =======================

ブランチを特定のソースコードバージョンに切り替える

/aosp/.repo/manifests$ に移動します

コマンド git Branch -a | grep "android-13" を使用します。

13 支店すべてをリストすることができます

リモート/オリジン/android-13.0.0_r1

リモート/オリジン/android-13.0.0_r10

リモート/オリジン/android-13.0.0_r11

リモート/オリジン/android-13.0.0_r12

リモート/オリジン/android-13.0.0_r13

...

2. ブランチを切り替える

リポジトリ init -u https://mirrors.tuna.tsinghua.edu.cn/git/AOSP/platform/manifest -b android-13.0.0_r6

ソースコードをコンパイルする

ビルド/envsetup.sh

ランチ sdk_phone_x86_64 #これは必須

作る

エミュレータ

ソース コードをダウンロードするその他の方法============================================ ==== ==============

12.その他の機能でソースをダウンロードします。

wget -c https://mirrors.tuna.tsinghua.edu.cn/aosp-monthly/aosp-latest.tar # 初期化パッケージをダウンロードする

tar xf aosp-latest.tar # 解凍

cd AOSP # AOSP プロジェクト ディレクトリを解凍します。

# 隠された .repo ディレクトリが 1 つしかないため、現時点では ls では何も表示されません。

repo sync # 通常に同期することで完全なディレクトリを取得できます。

# または repo sync -l チェックアウト コードのみ

リポジトリの同期で次のエラーが発生する可能性があります。

エラー: エントリ「command.py」が最新ではありません。結合できません。

致命的:xxxxxxxx''v2.17.3.0

cd .repo/repo

git プル

おすすめ

転載: blog.csdn.net/professionIT/article/details/132859843