现在需要查看emulator如何加载文件系统的,需要编译android emulator source。
123
下载cmake
git clone https://android.googlesource.com/platform/prebuilts/cmake/linux-x86
日子
tom@tom-linuxer:~/work/android-10/aosp/external/qemu$ ./android/rebuild.sh
Running under Python 3.8.0, Platform: Linux-5.3.0-45-generic-x86_64-with-glibc2.27
Clearing out /home/tom/work/android-10/aosp/external/qemu/objs
Running: /home/tom/work/android-10/aosp/prebuilts/cmake/linux-x86/bin/cmake -B/home/tom/work/android-10/aosp/external/qemu/objs -DCMAKE_TOOLCHAIN_FILE=/home/tom/work/android-10/aosp/external/qemu/android/build/cmake/toolchain-linux-x86_64.cmake -DOPTION_CRASHUPLOAD=NONE -DCMAKE_BUILD_TYPE=Release -DQTWEBENGINE=False -DOPTION_SDK_TOOLS_REVISION=29.0.13 -G Ninja /home/tom/work/android-10/aosp/external/qemu in /home/tom/work/android-10/aosp/external/qemu/objs
b'CMake Warning (dev) in CMakeLists.txt:'
b' No project() command is present. The top-level CMakeLists.txt file must'
b' contain a literal, direct call to the project() command. Add a line of'
b' code such as'
b''
b' project(ProjectName)'
b''
b' near the top of the file, but after cmake_minimum_required().'
b''
b' CMake is pretending there is a "project(Project)" command on the first'
b' line.'
b'This warning is for project developers. Use -Wno-dev to suppress it.'
b''
b"Running /home/tom/work/android-10/aosp/external/qemu/android/scripts/unix/gen-android-sdk-toolchain.sh '--host=linux-x86_64' '/home/tom/work/android-10/aosp/external/qemu/objs/toolchain' '' '--aosp-dir=/home/tom/work/android-10/aosp' '--aosp-clang_ver=clang-r353983b' '--verbosity=2'"
b''
b"Running /home/tom/work/android-10/aosp/external/qemu/android/scripts/unix/gen-android-sdk-toolchain.sh '--host=linux-x86_64' '--print=binprefix' 'unused' '--aosp-dir=/home/tom/work/android-10/aosp' '--aosp-clang_ver=clang-r353983b' '--verbosity=0'"
b'x86_64-linux-'
b''
b"Running /home/tom/work/android-10/aosp/external/qemu/android/scripts/unix/gen-android-sdk-toolchain.sh '--host=linux-x86_64' '--print=sysroot' 'unused' '--aosp-dir=/home/tom/work/android-10/aosp' '--aosp-clang_ver=clang-r353983b' '--verbosity=0'"
b'/home/tom/work/android-10/aosp/prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.17-4.8/x86_64-linux'
b"Running /home/tom/work/android-10/aosp/external/qemu/android/scripts/unix/gen-android-sdk-toolchain.sh '--host=linux-x86_64' '--print=libcplusplus' 'unused_param' '--aosp-dir=/home/tom/work/android-10/aosp' '--aosp-clang_ver=clang-r353983b' '--verbosity=0'"
b'/home/tom/work/android-10/aosp/prebuilts/clang/host/linux-x86/clang-r353983b/lib64/libc++.so'
b''
b'-- The C compiler identification is Clang 9.0.2'
b'-- The CXX compiler identification is Clang 9.0.2'
b'-- Check for working C compiler: /home/tom/work/android-10/aosp/external/qemu/objs/toolchain/x86_64-linux-gcc'
b'-- Check for working C compiler: /home/tom/work/android-10/aosp/external/qemu/objs/toolchain/x86_64-linux-gcc - works'
b'-- Detecting C compiler ABI info'
b'-- Detecting C compiler ABI info - done'
b'-- Detecting C compile features'
b'-- Detecting C compile features - done'
b'-- Check for working CXX compiler: /home/tom/work/android-10/aosp/external/qemu/objs/toolchain/x86_64-linux-g++'
b'-- Check for working CXX compiler: /home/tom/work/android-10/aosp/external/qemu/objs/toolchain/x86_64-linux-g++ - works'
b'-- Detecting CXX compiler ABI info'
b'-- Detecting CXX compiler ABI info - done'
b'-- Detecting CXX compile features'
b'-- Detecting CXX compile features - done'
b'-- Configured host linux-x86_64 to target: linux-x86_64, target os: linux/linux'
b'CMake Error at android/build/cmake/prebuilts.cmake:96 (message):'
b' The include directory'
b' /home/tom/work/android-10/aosp/prebuilts/android-emulator-build/qemu-android-deps/linux-x86_64/include/glib-2.0'
b' of GLIB2 does not exist..'
b'Call Stack (most recent call first):'
b' CMakeLists.txt:251 (prebuilt)'
b''
b''
b'-- Configuring incomplete, errors occurred!'
b'See also "/home/tom/work/android-10/aosp/external/qemu/objs/CMakeFiles/CMakeOutput.log".'
Traceback (most recent call last):
File "./android/build/python/cmake.py", line 20, in
cmake.launch()
File "/home/tom/work/android-10/aosp/external/qemu/android/build/python/aemu/cmake.py", line 172, in launch
app.run(main)
File "/home/tom/.local/lib/python3.8/site-packages/absl/app.py", line 299, in run
_run_main(main, args)
File "/home/tom/.local/lib/python3.8/site-packages/absl/app.py", line 250, in _run_main
sys.exit(main(argv))
File "/home/tom/work/android-10/aosp/external/qemu/android/build/python/aemu/cmake.py", line 135, in main
configure()
File "/home/tom/work/android-10/aosp/external/qemu/android/build/python/aemu/cmake.py", line 116, in configure
run(cmake_cmd, FLAGS.out)
File "/home/tom/work/android-10/aosp/external/qemu/android/build/python/aemu/process.py", line 95, in run
raise Exception('Failed to run %s - %s' %
Exception: Failed to run /home/tom/work/android-10/aosp/prebuilts/cmake/linux-x86/bin/cmake -B/home/tom/work/android-10/aosp/external/qemu/objs -DCMAKE_TOOLCHAIN_FILE=/home/tom/work/android-10/aosp/external/qemu/android/build/cmake/toolchain-linux-x86_64.cmake -DOPTION_CRASHUPLOAD=NONE -DCMAKE_BUILD_TYPE=Release -DQTWEBENGINE=False -DOPTION_SDK_TOOLS_REVISION=29.0.13 -G Ninja /home/tom/work/android-10/aosp/external/qemu - 1
可以看到报错:
b'CMake Error at android/build/cmake/prebuilts.cmake:96 (message):'
b' The include directory'
b' /home/tom/work/android-10/aosp/prebuilts/android-emulator-build/qemu-android-deps/linux-x86_64/include/glib-2.0'
b' of GLIB2 does not exist..'
可以看出是没有这个文件
错误如下:
b'-- Detecting C compile features - done'
b'-- Check for working CXX compiler using: Ninja'
b'-- Check for working CXX compiler using: Ninja -- works'
b'-- Detecting CXX compiler ABI info'
b'-- Detecting CXX compiler ABI info - done'
b'-- Detecting CXX compile features'
b'-- Detecting CXX compile features - done'
b'-- Configured host linux-x86_64 to target: linux-x86_64, target os: linux/linux'
b'CMake Error at android/build/cmake/prebuilts.cmake:96 (message):'
b' The include directory'
b' /home/tom/work/android-10/aosp/prebuilts/android-emulator-build/common/virglrenderer/linux-x86_64/include/virgl'
b' of VIRGLRENDERER does not exist..'
b'Call Stack (most recent call first):'
b' CMakeLists.txt:256 (prebuilt)'
下载源码:
cd aosp/prebuilts/android-emulator-build
git clone https://android.googlesource.com/platform/prebuilts/android-emulator-build/common
git checkout -b emu-29.0-release remotes/origin/emu-29.0-release
报错如下:
b'-- Including zlib version: 1.2.11'
b'-- Found Protobuf: Protocol Buffers, Version: 3.0.0 (3.0.0-beta-3) '
b'-- Using prebuilt openssl..'
b'CMake Error at android/build/cmake/prebuilts.cmake:96 (message):'
b' The include directory'
b' /home/tom/work/android-10/aosp/prebuilts/android-emulator-build/curl/linux-x86_64/include'
b' of OpenSSL does not exist..'
b'Call Stack (most recent call first):'
b' android/third_party/CMakeLists.txt:63 (prebuilt)'
b''
b''
b'-- Configuring incomplete, errors occurred!'
安装:
cd aosp/prebuilts/android-emulator-build
git clone https://android.googlesource.com/platform/prebuilts/android-emulator-build/curl
git checkout -b emu-29.0-release remotes/origin/emu-29.0-release
https://android.googlesource.com/platform/prebuilts/android-emulator-build/
在这个网页下,下载所有源码
https://android.googlesource.com/platform/prebuilts/android-emulator-build/
主要仓库:
archive
common
curl
mesa
mesa-deps
protobuf
qemu-android-deps
qt
Building AOSP Emulator