AOSPをミラーしてみた

12.2K Views

October 23, 11

スライド概要

AOSPをミラーしてみた
横浜Androidプラットフォーム部 2011.10.23

profile-image

とりあえず登録。 数年後、Slideshareからデータ移行。 ただし、一部ファイルは移行できず。無念。

シェア

またはPlayer版

埋め込む »CMSなどでJSが使えない場合

関連スライド

各ページのテキスト
1.

AOSPを ミラーしてみた 横浜Androidプラットフォーム部 2011.10.23 [email protected]

2.

repo sync、 時間がかかって イヤですよね…

3.

待つ身はつらいわ...

4.

少し前、 kernel.org 突然のダウン!

5.

そのあおりで、 ここしばらく、 AOSPが 壊滅してました。

6.

仕事にも、遊びにも、 重大な問題…

7.

その間、皆さん、 どう生活されて いましたか?

8.

codeaurora.org の汚れた水を飲んだ?

9.

android.git.linaro.org の軒下を間借り?

10.

OESFのGitHub OHAミラー乞食?

11.

いずれにしても、 つらい日々でありました。

12.

祝! AOSP復活

13.

git.android.kernel.org ⇩ android.googlesource.com

14.

so for the moment gitweb source browsing and Gerrit Code Review are still unavailable.

15.

The kernel source trees aren't available at the moment. Getting them back is definitely on the to-do list.

16.

復旧には、 まだ時間が 必要なようです。

17.

Since Ice Cream Sandwich does everything that Honeycomb does (and much more), there's no plan to release Honeycomb in AOSP.

18.

黒歴史 ...

19.

あっと、 話をもとに もどして…

20.

だいぶ速くは なったけど、 それでも、 syncは つらい時間です…

21.

Mirroring AOSP ? https://groups.google.com/forum/#!topic/ android-building/2gLwqjlQq3A

22.

mjd!

23.

AOSPを自分のマシンに 簡単にミラーできる?

24.

syncの苦悩からの開放…

25.

やってみましょう。

26.

$ mkdir /usr/local/android-mirror $ cd /usr/local/android-mirror $ repo init --mirror -u https:// android.googlesource.com/mirror/manifest $ repo sync

27.

$ mkdir /usr/local/android-2.3.7 $ cd /usr/local/android-2.3.7 $ repo init -u /usr/local/mirror/platform/ manifest.git -b android-2.3.7̲r1 $ repo sync

28.

簡単すぎです!

29.

実際はこうでした…

30.

kinneko@BuildSV:~$ mkdir AOSP kinneko@BuildSV:~$ cd AOSP kinneko@BuildSV:~/AOSP$ ../repo init -mirror -u https://android.googlesource.com/ mirror/manifest

31.

Get https://android.googlesource.com/mirror/manifest remote: Counting objects: 3, done remote: Total 3 (delta 0), reused 3 (delta 0) Unpacking objects: 100% (3/3), done. From https://android.googlesource.com/mirror/manifest * [new branch] master -> origin/master repo mirror initialized in /home/kinneko/AOSP

32.

kinneko@BuildSV:~/AOSP$ ../repo sync From /home/kinneko/AOSP/device/google/accessory/ arduino.git/clone.bundle * [new branch] master -> master * [new branch] gingerbread -> gingerbread remote: Counting objects: 6, done remote: Finding sources: 100% (6/6) remote: Total 6 (delta 0), reused 6 (delta 0) Unpacking objects: 100% (6/6), done. (略)

33.

なんか、たまに error: RPC failed; result=28, HTTP code = 0 fatal: The remote end hung up unexpectedly とか出ますね。

34.

remote: Counting objects: 15326, done remote: Compressing objects: 100% (2793/2793) error: RPC failed; result=28, HTTP code = 0iB | 110 KiB/s fatal: The remote end hung up unexpectedly error: RPC failed; result=28, HTTP code = 0 MiB | 311 KiB/s fatal: The remote end hung up unexpectedly error: Cannot fetch toolchain/gmp61), 18.19 MiB | 198 KiB/s error: RPC failed; result=28, HTTP code = 0 MiB | 187 KiB/s fatal: The remote end hung up unexpectedly error: RPC failed; result=28, HTTP code = 0 MiB | 104 KiB/s fatal: The remote end hung up unexpectedly error: Cannot fetch toolchain/gold

35.

gitは、 JBQは1.7.3.1を使っているそうです。 Ubuntu 11.04だと1.7.4.1-3かな。 最近updateしてないけど。

36.

deviceの下のバイナリとか、 なんか落とすのイヤだなぁ。 使わないのに。

37.

error: Exited sync due to fetch errors エラーで落ちた。

38.

error: error: error: error: Exited Exited Exited Exited sync sync sync sync due due due due to to to to fetch fetch fetch fetch errors errors errors errors error: Exited sync due to fetch errors error: Exited sync due to fetch errors error: Exited sync due to fetch errors error: Exited sync due to fetch errors error: Exited sync due to fetch errors エラーで落ちた。再実行しる。

39.

TLSでエラーだと...

40.

error: Cannot fetch platform/tools/tradefederation error: gnutls̲handshake() failed: A TLS packet with unexpected length was received. while accessing https://android.googlesource.com//toolchain/build/ info/refs fatal: HTTP request failed error: Cannot fetch toolchain/build

41.

error: gnutls̲handshake() failed: A TLS packet with unexpected length was received. while accessing https://android.googlesource.com//platform/external/ v8/info/refs

42.

なんか、pythonのエラーまで出てます... ダメかも。

43.
[beta]
Exception in thread Thread-224:0% (665/6647)
Traceback (most recent call last):
File "/usr/lib/python2.7/threading.py", line 552, in ̲̲bootstrap̲inner
self.run()
File "/usr/lib/python2.7/threading.py", line 505, in run
self.̲̲target(*self.̲̲args, **self.̲̲kwargs)
File "/home/kinneko/AOSP/.repo/repo/subcmds/sync.py", line 182, in
̲FetchHelper
success = project.Sync̲NetworkHalf(quiet=opt.quiet)
File "/home/kinneko/AOSP/.repo/repo/project.py", line 926, in
Sync̲NetworkHalf
if alt̲dir is None and self.̲ApplyCloneBundle(initial=is̲new, quiet=quiet):
File "/home/kinneko/AOSP/.repo/repo/project.py", line 1444, in
̲ApplyCloneBundle
exist̲dst = self.̲FetchBundle(bundle̲url, bundle̲tmp, bundle̲dst, quiet)
File "/home/kinneko/AOSP/.repo/repo/project.py", line 1508, in ̲FetchBundle
raise DownloadError('%s: %s ' % (req.get̲host(), str(e)))
DownloadError: android.googlesource.com: <urlopen error [Errno 8] ̲ssl.c:499:
EOF occurred in violation of protocol>

44.

platform/prebuilt 1104MB でかすぎ。

45.

kinneko@BuildSV:~/AOSP$ ../repo sync Fetching projects: 100% (233/233), done. 終わった。 なんどもリトライしたよ。 丸一日がかりだったわ... orz

46.

使用容量は? kinneko@BuildSV:~/AOSP$ du -sh ./ 3.3G ./ まぁ、こんなもんでしょ。

47.

さて、 AOSPローカルミラーから、 syncしてみる。

48.

kinneko@BuildSV:~$ mkdir mydroid kinneko@BuildSV:~$ cd mydroid/ kinneko@BuildSV:~/mydroid$ ../repo init u /home/kinneko/AOSP/platform/ manifest.git -b gingerbread (略) repo initialized in /home/kinneko/mydroid

49.

kinneko@BuildSV:~/mydroid$ ../repo sync (略) error: pack-objects died of signal 11 error: git upload-pack: git-pack-objects died with error. fatal: git upload-pack: aborting due to possible repository corruption on the remote side. remote: aborting due to possible repository corruption on the remote side. fatal: early EOF fatal: index-pack failed (略) Fetching projects: 99% (169/170) error: Cannot fetch platform/ external/webkit error: Exited sync due to fetch errors Webkit壊れているって...

50.

普通にミラーを再度syncしても、 異常はない。 ローカル取得分が壊れていると判断。 webkitのgitリポジトリをバッサリ削除して、 再取得してみる。

51.

kinneko@BuildSV:~/AOSP$ rm -rf platform/ external/webkit.git kinneko@BuildSV:~/AOSP$ ../repo sync Fetching projects: 67% (157/233) Downloading platform/external/webkit: (5MB/56MB) (略) Fetching projects: 100% (233/233), done. 8%

52.

うまくいったようだ。

53.

ミラーのsyncがうまく いったからといって、 ファイルが壊れていない 保証はない!

54.

再取得後、再度syncしてみる。

55.

kinneko@BuildSV:~/AOSP$ cd ../mydroid/ kinneko@BuildSV:~/mydroid$ ../repo init -u /home/ kinneko/AOSP/platform/manifest.git -b gingerbread kinneko@BuildSV:~/mydroid$ time ../repo sync (略) Fetching projects: 100% (170/170), done. Checking out files: 100% (12174/12174), done.ut files: 0% (13/12174) Checking out files: 100% (10462/10462), done.ut files: 0% (76/10462) Syncing work tree: 100% (170/170), done. real 2m12.760s user 2m50.090s sys 0m26.840s

56.

2分強!

57.

すげー、 -jオプションなしで、 2分強くらい! 快適すぎです。 まるで repo sync -l のよう!

58.

kinneko@BuildSV:~/mydroid$ time ../repo sync (略) real 2m0.475s user 2m54.190s sys 0m28.450s -j12

59.

ほとんど、IOの処理なので、 -jオプションを使っても、 速くならない。

60.

ビルドしてみる。

61.

kinneko@BuildSV:~$ cd mydroid/ kinneko@BuildSV:~/mydroid$ export ARCH=arm kinneko@BuildSV:~/mydroid$ export PATH=/home/ kinneko/panda/L27.12.1-P2/build̲tools/arm-2010q1/ bin:/usr/bin:/bin kinneko@BuildSV:~/mydroid$ export CROSS̲COMPILE=arm-none-linux-gnueabikinneko@BuildSV:~/mydroid$ . build/envsetup.sh including device/htc/passion/vendorsetup.sh including device/samsung/crespo/vendorsetup.sh including device/samsung/crespo4g/vendorsetup.sh kinneko@BuildSV:~/mydroid$ lunch generic-eng

62.

kinneko@BuildSV:~/mydroid$ time make -j12 ========================================= PLATFORM̲VERSION̲CODENAME=REL PLATFORM̲VERSION=2.3.7 (略) real 12m2.785s user 100m36.420s sys 5m35.710s

63.

ビルド時間は お金で買える!

65.

model name : i7 980 3.33GHz Intel(R) Core(TM) CPU MemTotal: 12323396 kB @

66.

どのみち、 ICSのビルドには、 このくらいのリソースが 必要です。

67.

何かと一筋縄では うまくいかなかった ですが、

68.

使わない手は ありませんよ!

69.

syncの苦悩からの開放…

70.

“syncの苦悩からの開放” それは、もう、 あなたのものです!

71.

それ以外にも…

72.

・独自ブランチの運用 ・鯖としてセットアップして、 チームで使えるリポジトリに ・AOSPとのsync前に一度やって おくと差分だけのsyncで済む

73.

・AOSP死んでても、 影響ぜんぜんない! ・WAN接続なくてもsyncできる! ・裏でAOSP syncしておけば、 いつでも最新環境を一瞬で入手。

74.

何より、 syncごときで イラっと しなくなります。

75.

おしまい