如何查找android emulator内核的精确版本

android api22, arm images

root@generic:/ # cat /proc/version
Linux version 3.4.67-01422-gd3ffcc7-dirty (digit@tyrion.par.corp.google.com) (gcc version 4.8 (GCC) ) #1 PREEMPT Tue Sep 16 19:34:06 CEST 2014

内核版本3.4.67,下载goldfish代码:

git clone git://mirrors.ustc.edu.cn/aosp/kernel/goldfish.git

$ git branch -a
* (no branch)
  master
  remotes/origin/HEAD -> origin/master
  remotes/origin/android-3.10
  remotes/origin/android-3.18
  remotes/origin/android-3.4
  remotes/origin/android-goldfish-2.6.29
  remotes/origin/android-goldfish-3.10
  remotes/origin/android-goldfish-3.10-l-mr1-dev
  remotes/origin/android-goldfish-3.10-m-dev
  remotes/origin/android-goldfish-3.18-dev
  remotes/origin/android-goldfish-3.4
  remotes/origin/android-goldfish-3.4-l-mr1-dev
  remotes/origin/android-goldfish-4.4-dev
  remotes/origin/linux-goldfish-3.0-wip
  remotes/origin/master
git checkout remotes/origin/android-goldfish-3.4
但是,预编译好的kernel-qemu到底对应了哪个commit id呢?
看版本号,发现g后面的就是commit id,d3ffcc7
然后git checkout d3ffcc7就可以了


android api22, x86 images

root@generic_x86:/ # cat /proc/version                                         
Linux version 3.4.67+ (digit@tyrion.par.corp.google.com) (gcc version 4.8 (GCC) ) #3 PREEMPT Tue Sep 16 19:46:22 CEST 2014
没有goldfish commit id信息,怎么玩呢?

1、求取预编译的kernel-qemu的md5sum为6c5f6f4359c7b94b637ef266387c5ff9

2、cd android-5.1.0_r1/prebuilts/qemu-kernel/

3、求取x86/kernel-qemu的md5sum,对比是否相同

4、相同,那么看commit msg,里面有说明对应的goldfish commit id是多少

5、不同,git reset --hard <上一次的prebuilts commit id>,回到第3步

最后,得到的commit msg是:

commit 2cd41c75898f6eb19619e4d03fd39e08821a1e38
Author: David 'Digit' Turner <digit@google.com>
Date:   Wed Sep 17 00:14:04 2014 +0200

    Upgrade qemu kernels to support multinetwork.

    This patch updates the binaries of emulator-specific kernels to
    the following revisions (https://android.googlesource.com/kernel/goldfish):

      android-goldfish-3.4:   ea97df6 goldfish: Enable multinetwork kernel featu
      android-goldfish-3.10:  64a0393 goldfish: Enable multinetwork kernel featu

    The main goals is to get multinetwork working, which is required to
    properly emulate Android L and beyond. This also includes other patches,
    including compatibility-related patches for the ARM64 kernel that make
    ARMv7 binaries run properly under it.

    BUG=17516983

    Change-Id: I2f1c352b72ca6b254dbcb9732dee3c014867ae99

goldfish commit id是ea97df6


PS:如果用md5sum的方式,得到的arm的goldfish commit id也是ea97df6


上一篇:shell脚本test命令没用好,写了好几天的代码全被删了


下一篇:Java零基础入门学习1:初探Java世界