0
点赞
收藏
分享

微信扫一扫

Ubuntu 20.04编译AOSP 并启动模拟器

平台

CPU: Intel® Core™ i7-8700 CPU @ 3.20GHz
DDR: 24GB
硬盘: SSD 1TB
系统: Ubuntu 20.04 x64

概述

疫情期间居家办公, 为方便调试, 从清华镜像下载了AOSP的代码准备编译后尝试使用模拟器调试, 编译完成后, 发现模拟器启动不了, 要么卡死, 要么崩溃, 历经波折, 最终更新后得以解决, 特此记录.

环境搭建

参考, 建议以官方说明或厂商开发文档中的环境搭建说明为主

#JDK
sudo add-apt-repository ppa:openjdk-r/ppa
sudo apt-get update
#sudo apt-get install openjdk-7-jdk
sudo apt-get install openjdk-8-jdk

sudo apt-get install vim
sudo apt-get install minicom

#追加源
sudo gedit /etc/apt/sources.list
+ deb http://us.archive.ubuntu.com/ubuntu trusty main universe
sudo apt-get update

#安装依赖
sudo apt-get install git gnupg flex bison gperf build-essential zip curl libc6-dev libncurses5-dev:i386 x11proto-core-dev libx11-dev:i386 libreadline6-dev:i386 libgl1-mesa-glx:i386 libgl1-mesa-dev g++-multilib tofrodos python-markdown libxml2-utils xsltproc zlib1g-dev:i386
sudo apt-get install lzop libncurses5
sudo ln -s /usr/lib/i386-linux-gnu/mesa/libGL.so.1 /usr/lib/i386-linux-gnu/libGL.so
sudo apt-get install mingw32
sudo apt-get install automake make perl gcc g++
sudo apt-get install libncurses5

# make kernel
# scripts/extract-cert.c:21:10: fatal error: openssl/bio.h: No such file or directory
#   21 | #include <openssl/bio.h>
#      |          ^~~~~~~~~~~~~~~
sudo apt-get install libssl-dev

#Android编译环境补充
sudo ln -sf /usr/bin/python2.7 /usr/bin/python 

#ifconfig
sudo apt install net-tools


# 编译RK3399_LINUX 时出现: [awk: line 2: function strtonum never defined] https://blog.csdn.net/liangtianmeng/article/details/86020254
sudo apt-get install gawk

## Android 11 u-boot 
sudo apt-get install device-tree-compiler

## X2000 kernel
sudo apt install u-boot-tools

## make menuconfig 失败
sudo apt-get install libncurses5-dev

获取源码并编译

下载:
Android 镜像使用帮助

编译:

source ./build/envsetup.sh
#官网中使用的是: lunch aosp_arm-eng
#由于需要使用模拟器等相关开发环境, 本文编译直接使用, 
# 见 https://source.android.com/setup/create/avd
lunch sdk_phone_x86_64
make -j12

编译时长:

#### build completed successfully (02:11:17 (hh:mm:ss)) ####

启动模拟器:

## 在编译完成后可以直接运行
## 若关闭了终端, 或重新加载了环境, 则有可能导致执行错误,
## 建议执行前确认是否已经执行
## source ./build/envsetup.sh
## lunch xxxx
$ emulator

官网说明
在这里插入图片描述
模拟器启动成功
在这里插入图片描述


一些问题

编译问题

  1. Linux ps 命令导致AOSP编译失败
  2. 内存至少16GB, 刚开始只用8G, 单线程编译也会卡死.

模拟器无法正常启动
最早下载源码的时间是2022年3月1日
而直至2022年4月17日才成功把模拟器成功跑起来.
而解决的方法: 同步到最新 同步到最新 同步到最新


旧的代码第一次编译完成后, 无法启动

$source build/envsetup.sh
$lunch sdk_x86_64
$make
$emulator
INFO    | Android emulator version 31.3.5.0 (build_id 8311694) (CL:N/A)
INFO    | Duplicate loglines will be removed, if you wish to see each indiviudal line launch with the -log-nofilter flag.
WARNING | encryption is off
WARNING | cannot add library /media/anson/codes/aosp/prebuilts/android-emulator/linux-x86_64/qemu/linux-x86_64/lib64/vulkan/libvulkan.so: failed
INFO    | added library /media/anson/codes/aosp/prebuilts/android-emulator/linux-x86_64/lib64/vulkan/libvulkan.so
MESA-INTEL: warning: Performance support disabled, consider sysctl dev.i915.perf_stream_paranoid=0

INFO    | configAndStartRenderer: setting vsync to 60 hz
WARNING | *** No gRPC protection active, consider launching with the -grpc-use-jwt flag.***
INFO    | Started GRPC server at 127.0.0.1:8554, security: Local:none
INFO    | Advertising in: /run/user/1000/avd/running/pid_6593.ini
pulseaudio: set_sink_input_volume() failed
pulseaudio: Reason: Invalid argument
pulseaudio: set_sink_input_mute() failed
pulseaudio: Reason: Invalid argument
ERROR   | Unable to connect to adb daemon on port: 5037
$emulator
INFO    | Android emulator version 31.3.5.0 (build_id 8311694) (CL:N/A)
INFO    | Duplicate loglines will be removed, if you wish to see each indiviudal line launch with the -log-nofilter flag.
ERROR   | No initial system image for this configuration!

刚开始怀疑是系统环境问题, 于是又配置了硬件加速还有虚拟技术等功能检测12

而后, 根据3提示, 增加命令参数以显示更多的启动信息(增加 -verbose -show-kernel -shell):

$ emulator -verbose -show-kernel -shell
INFO    | Android emulator version 31.3.5.0 (build_id 8311694) (CL:N/A)
INFO    | Found ANDROID_PRODUCT_OUT: /media/anson/codes/aosp/out/target/product/emulator_x86
INFO    | Found build target architecture: x86
INFO    | argv[0]: 'emulator'; program directory: '/media/anson/codes/aosp/prebuilts/android-emulator/linux-x86_64'
INFO    | emuDirName: '/media/anson/codes/aosp/prebuilts/android-emulator/emulator'
INFO    | Probing for /media/anson/codes/aosp/out/target/product/emulator_x86/kernel-ranchu-64: file missing
INFO    | try dir /media/anson/codes/aosp/prebuilts/android-emulator/linux-x86_64
INFO    | Trying emulator path '/media/anson/codes/aosp/prebuilts/android-emulator/linux-x86_64/qemu/linux-x86_64/qemu-system-i386'
INFO    | Found target-specific 64-bit emulator binary: /media/anson/codes/aosp/prebuilts/android-emulator/linux-x86_64/qemu/linux-x86_64/qemu-system-i386
INFO    | Adding library search path: '/media/anson/codes/aosp/prebuilts/android-emulator/linux-x86_64/lib64'
INFO    | Adding library search path: '/media/anson/codes/aosp/prebuilts/android-emulator/linux-x86_64/lib64/gles_swiftshader'
INFO    | Adding library search path: '/media/anson/codes/aosp/prebuilts/android-emulator/linux-x86_64/lib64/libstdc++'
VERBOSE | Adding library search path for Qt: '/media/anson/codes/aosp/prebuilts/android-emulator/linux-x86_64/lib64/qt/lib'
VERBOSE | Silencing all qWarning(); use qCWarning(...) instead: QT_LOGGING_RULES=default.warning=false
VERBOSE | Setting Qt plugin search path: QT_QPA_PLATFORM_PLUGIN_PATH=/media/anson/codes/aosp/prebuilts/android-emulator/linux-x86_64/lib64/qt/plugins
VERBOSE | Setting Qt to use software OpenGL: QT_OPENGL=software
VERBOSE | Setting QML to use software QtQuick2D: QMLSCENE_DEVICE=softwarecontext
VERBOSE | Overriding pre-existing bad Qt high dpi settings...
VERBOSE | Setting LD_PRELOAD to /media/anson/codes/aosp/prebuilts/android-emulator/linux-x86_64/lib64/qt/lib/libfreetype.so.6
VERBOSE | emulator: Running :/media/anson/codes/aosp/prebuilts/android-emulator/linux-x86_64/qemu/linux-x86_64/qemu-system-i386
VERBOSE | qemu backend: argv[00] = "/media/anson/codes/aosp/prebuilts/android-emulator/linux-x86_64/qemu/linux-x86_64/qemu-system-i386"
VERBOSE | qemu backend: argv[01] = "-verbose"
VERBOSE | qemu backend: argv[02] = "-show-kernel"
VERBOSE | qemu backend: argv[03] = "-shell"
VERBOSE | Concatenated backend parameters:  /media/anson/codes/aosp/prebuilts/android-emulator/linux-x86_64/qemu/linux-x86_64/qemu-system-i386 -verbose -show-kernel -shell
INFO    | Duplicate loglines will be removed, if you wish to see each indiviudal line launch with the -log-nofilter flag.
VERBOSE | found Android build root: /media/anson/codes/aosp
VERBOSE | found Android build out:  /media/anson/codes/aosp/out/target/product/emulator_x86
VERBOSE | Cannot find boot properties file: /media/anson/codes/aosp/out/target/product/emulator_x86/boot.prop

VERBOSE | Found target API sdkVersion: 32

VERBOSE | Invalid int property: 'ro.build.version.incremental:eng.anson.20220320.212450'
VERBOSE | autoconfig: -skin HVGA
VERBOSE | autoconfig: -skindir /media/anson/codes/aosp/development/tools/emulator/skins/
VERBOSE | autoconfig: -kernel /media/anson/codes/aosp/prebuilts/qemu-kernel/x86/ranchu/kernel-qemu
VERBOSE | Target arch = 'x86'
VERBOSE | Auto-config: -qemu -cpu qemu32
VERBOSE | Auto-detect: Kernel image requires new device naming scheme.
VERBOSE | Auto-detect: Kernel does not support YAFFS2 partitions.
VERBOSE | autoconfig: -ramdisk /media/anson/codes/aosp/out/target/product/emulator_x86/ramdisk-qemu.img
VERBOSE | autoconfig: -sysdir /media/anson/codes/aosp/out/target/product/emulator_x86
VERBOSE | Using direct system image: /media/anson/codes/aosp/out/target/product/emulator_x86/system-qemu.img
VERBOSE | system partition size adjusted to match image file (4107 MB > 800 MB)

VERBOSE | Using direct vendor image: /media/anson/codes/aosp/out/target/product/emulator_x86/vendor-qemu.img
VERBOSE | autoconfig: -data /media/anson/codes/aosp/out/target/product/emulator_x86/userdata-qemu.img
VERBOSE | autoconfig: -initdata /media/anson/codes/aosp/out/target/product/emulator_x86/userdata.img
VERBOSE | autoconfig: -cache /media/anson/codes/aosp/out/target/product/emulator_x86/cache.img
VERBOSE | Increasing RAM size to 2048MB
VERBOSE | VM heap size 48MB is below hardware specified minimum of 512MB,setting it to that value
VERBOSE | System image is read only
VERBOSE | Found 1 DNS servers:
VERBOSE | 	127.0.0.53
VERBOSE | trying to load skin file '/media/anson/codes/aosp/development/tools/emulator/skins//HVGA/layout'
WARNING | encryption is off
VERBOSE | CPU Acceleration: working
VERBOSE | CPU Acceleration status: KVM (version 12) is installed and usable.
VERBOSE | handleCpuAcceleration: feature check for hvf
VERBOSE | GPU emulation enabled using 'host' mode
VERBOSE | Initializing hardware OpenGLES emulation support
VERBOSE | create display 0
VERBOSE | setDisplayPose 0 x 0 y 0 w 320 h 480 dpi 0
WARNING | cannot add library /media/anson/codes/aosp/prebuilts/android-emulator/linux-x86_64/qemu/linux-x86_64/lib64/vulkan/libvulkan.so: failed
INFO    | added library /media/anson/codes/aosp/prebuilts/android-emulator/linux-x86_64/lib64/vulkan/libvulkan.so
MESA-INTEL: warning: Performance support disabled, consider sysctl dev.i915.perf_stream_paranoid=0

INFO    | configAndStartRenderer: setting vsync to 60 hz
VERBOSE | Found 1 DNS servers:
VERBOSE | 	127.0.0.53
INFO    | Content of hardware configuration file:
INFO    | 	hw.cpu.arch = x86
INFO    | 	hw.cpu.model = qemu32
INFO    | 	hw.cpu.ncore = 2
INFO    | 	hw.ramSize = 2048
INFO    | 	hw.screen = multi-touch
INFO    | 	hw.mainKeys = true
INFO    | 	hw.trackBall = true
INFO    | 	hw.keyboard = false
INFO    | 	hw.keyboard.lid = false
INFO    | 	hw.keyboard.charmap = qwerty2
INFO    | 	hw.dPad = true
INFO    | 	hw.rotaryInput = false
INFO    | 	hw.gsmModem = true
INFO    | 	hw.gps = true
INFO    | 	hw.battery = true
INFO    | 	hw.accelerometer = true
INFO    | 	hw.gyroscope = true
INFO    | 	hw.audioInput = true
INFO    | 	hw.audioOutput = true
INFO    | 	hw.sdCard = true
INFO    | 	disk.cachePartition = true
INFO    | 	disk.cachePartition.path = /media/anson/codes/aosp/out/target/product/emulator_x86/cache.img
INFO    | 	disk.cachePartition.size = 66m
INFO    | 	test.quitAfterBootTimeOut = -1
INFO    | 	test.delayAdbTillBootComplete = 0
INFO    | 	test.monitorAdb = 0
INFO    | 	hw.lcd.width = 320
INFO    | 	hw.lcd.height = 480
INFO    | 	hw.lcd.depth = 16
INFO    | 	hw.lcd.density = 160
INFO    | 	hw.lcd.backlight = true
INFO    | 	hw.lcd.vsync = 60
INFO    | 	hw.gltransport = pipe
INFO    | 	hw.gltransport.asg.writeBufferSize = 1048576
INFO    | 	hw.gltransport.asg.writeStepSize = 4096
INFO    | 	hw.gltransport.asg.dataRingSize = 32768
INFO    | 	hw.gltransport.drawFlushInterval = 800
INFO    | 	hw.displayRegion.0.1.xOffset = -1
INFO    | 	hw.displayRegion.0.1.yOffset = -1
INFO    | 	hw.displayRegion.0.1.width = 0
INFO    | 	hw.displayRegion.0.1.height = 0
INFO    | 	hw.displayRegion.0.2.xOffset = -1
INFO    | 	hw.displayRegion.0.2.yOffset = -1
INFO    | 	hw.displayRegion.0.2.width = 0
INFO    | 	hw.displayRegion.0.2.height = 0
INFO    | 	hw.displayRegion.0.3.xOffset = -1
INFO    | 	hw.displayRegion.0.3.yOffset = -1
INFO    | 	hw.displayRegion.0.3.width = 0
INFO    | 	hw.displayRegion.0.3.height = 0
INFO    | 	hw.display1.width = 0
INFO    | 	hw.display1.height = 0
INFO    | 	hw.display1.density = 0
INFO    | 	hw.display1.xOffset = -1
INFO    | 	hw.display1.yOffset = -1
INFO    | 	hw.display1.flag = 0
INFO    | 	hw.display2.width = 0
INFO    | 	hw.display2.height = 0
INFO    | 	hw.display2.density = 0
INFO    | 	hw.display2.xOffset = -1
INFO    | 	hw.display2.yOffset = -1
INFO    | 	hw.display2.flag = 0
INFO    | 	hw.display3.width = 0
INFO    | 	hw.display3.height = 0
INFO    | 	hw.display3.density = 0
INFO    | 	hw.display3.xOffset = -1
INFO    | 	hw.display3.yOffset = -1
INFO    | 	hw.display3.flag = 0
INFO    | 	hw.multi_display_window = false
INFO    | 	hw.gpu.enabled = true
INFO    | 	hw.gpu.mode = host
INFO    | 	hw.initialOrientation = portrait
INFO    | 	hw.camera.back = emulated
INFO    | 	hw.camera.front = none
INFO    | 	vm.heapSize = 512
INFO    | 	hw.sensors.light = true
INFO    | 	hw.sensors.pressure = true
INFO    | 	hw.sensors.humidity = true
INFO    | 	hw.sensors.proximity = true
INFO    | 	hw.sensors.magnetic_field = true
INFO    | 	hw.sensors.magnetic_field_uncalibrated = true
INFO    | 	hw.sensors.gyroscope_uncalibrated = true
INFO    | 	hw.sensors.orientation = true
INFO    | 	hw.sensors.temperature = true
INFO    | 	hw.sensors.rgbclight = false
INFO    | 	hw.sensor.hinge = false
INFO    | 	hw.sensor.hinge.count = 0
INFO    | 	hw.sensor.hinge.type = 0
INFO    | 	hw.sensor.hinge.sub_type = 0
INFO    | 	hw.sensor.hinge.fold_to_displayRegion.0.1_at_posture = 1
INFO    | 	hw.sensor.roll = false
INFO    | 	hw.sensor.roll.count = 0
INFO    | 	hw.sensor.roll.resize_to_displayRegion.0.1_at_posture = 6
INFO    | 	hw.sensor.roll.resize_to_displayRegion.0.2_at_posture = 6
INFO    | 	hw.sensor.roll.resize_to_displayRegion.0.3_at_posture = 6
INFO    | 	hw.sensors.heart_rate = false
INFO    | 	hw.sensors.wrist_tilt = false
INFO    | 	hw.useext4 = true
INFO    | 	hw.arc = false
INFO    | 	hw.arc.autologin = false
INFO    | 	kernel.path = /media/anson/codes/aosp/prebuilts/qemu-kernel/x86/ranchu/kernel-qemu
INFO    | 	kernel.newDeviceNaming = yes
INFO    | 	kernel.supportsYaffs2 = no
INFO    | 	disk.ramdisk.path = /media/anson/codes/aosp/out/target/product/emulator_x86/ramdisk-qemu.img
INFO    | 	disk.systemPartition.path = /media/anson/codes/aosp/out/target/product/emulator_x86/system-qemu.img
INFO    | 	disk.systemPartition.size = 4107m
INFO    | 	disk.vendorPartition.path = /media/anson/codes/aosp/out/target/product/emulator_x86/vendor-qemu.img
INFO    | 	disk.vendorPartition.size = 800m
INFO    | 	disk.dataPartition.path = /media/anson/codes/aosp/out/target/product/emulator_x86/userdata-qemu.img
INFO    | 	disk.dataPartition.size = 800m
INFO    | 	PlayStore.enabled = false
INFO    | 	avd.name = <build>
INFO    | 	avd.id = <build>
INFO    | 	fastboot.forceColdBoot = false
INFO    | 	android.avd.home = /home/anson/.android/avd
INFO    | .
INFO    | QEMU options list:
INFO    | 	 argv[00] = "/media/anson/codes/aosp/prebuilts/android-emulator/linux-x86_64/qemu/linux-x86_64/qemu-system-i386"
INFO    | 	 argv[01] = "-dns-server"
INFO    | 	 argv[02] = "127.0.0.53"
INFO    | 	 argv[03] = "-mem-path"
INFO    | 	 argv[04] = "/media/anson/codes/aosp/out/target/product/emulator_x86/snapshots/default_boot/ram.img"
INFO    | 	 argv[05] = "-mem-file-shared"
INFO    | 	 argv[06] = "-serial"
INFO    | 	 argv[07] = "stdio"
INFO    | 	 argv[08] = "-device"
INFO    | 	 argv[09] = "goldfish_pstore,addr=0xff018000,size=0x10000,file=/media/anson/codes/aosp/out/target/product/emulator_x86/build.avd/data/misc/pstore/pstore.bin"
INFO    | 	 argv[10] = "-cpu"
INFO    | 	 argv[11] = "android32"
INFO    | 	 argv[12] = "-enable-kvm"
INFO    | 	 argv[13] = "-smp"
INFO    | 	 argv[14] = "cores=2"
INFO    | 	 argv[15] = "-m"
INFO    | 	 argv[16] = "2048"
INFO    | 	 argv[17] = "-lcd-density"
INFO    | 	 argv[18] = "160"
INFO    | 	 argv[19] = "-object"
INFO    | 	 argv[20] = "iothread,id=disk-iothread"
INFO    | 	 argv[21] = "-nodefaults"
INFO    | 	 argv[22] = "-kernel"
INFO    | 	 argv[23] = "/media/anson/codes/aosp/prebuilts/qemu-kernel/x86/ranchu/kernel-qemu"
INFO    | 	 argv[24] = "-initrd"
INFO    | 	 argv[25] = "/media/anson/codes/aosp/out/target/product/emulator_x86/ramdisk-qemu.img"
INFO    | 	 argv[26] = "-drive"
INFO    | 	 argv[27] = "if=none,index=0,id=system,if=none,file=/media/anson/codes/aosp/out/target/product/emulator_x86/system-qemu.img,read-only"
INFO    | 	 argv[28] = "-device"
INFO    | 	 argv[29] = "virtio-blk-pci,drive=system,iothread=disk-iothread,modern-pio-notify"
INFO    | 	 argv[30] = "-drive"
INFO    | 	 argv[31] = "if=none,index=1,id=cache,if=none,file=/media/anson/codes/aosp/out/target/product/emulator_x86/cache.img.qcow2,overlap-check=none,cache=unsafe,l2-cache-size=1048576"
INFO    | 	 argv[32] = "-device"
INFO    | 	 argv[33] = "virtio-blk-pci,drive=cache,iothread=disk-iothread,modern-pio-notify"
INFO    | 	 argv[34] = "-drive"
INFO    | 	 argv[35] = "if=none,index=2,id=userdata,if=none,file=/media/anson/codes/aosp/out/target/product/emulator_x86/userdata-qemu.img.qcow2,overlap-check=none,cache=unsafe,l2-cache-size=1048576"
INFO    | 	 argv[36] = "-device"
INFO    | 	 argv[37] = "virtio-blk-pci,drive=userdata,iothread=disk-iothread,modern-pio-notify"
INFO    | 	 argv[38] = "-drive"
INFO    | 	 argv[39] = "if=none,index=3,id=vendor,if=none,file=/media/anson/codes/aosp/out/target/product/emulator_x86/vendor-qemu.img,read-only"
INFO    | 	 argv[40] = "-device"
INFO    | 	 argv[41] = "virtio-blk-pci,drive=vendor,iothread=disk-iothread,modern-pio-notify"
INFO    | 	 argv[42] = "-netdev"
INFO    | 	 argv[43] = "user,id=mynet"
INFO    | 	 argv[44] = "-device"
INFO    | 	 argv[45] = "virtio-net-pci,netdev=mynet"
INFO    | 	 argv[46] = "-device"
INFO    | 	 argv[47] = "virtio-rng-pci"
INFO    | 	 argv[48] = "-show-cursor"
INFO    | 	 argv[49] = "-L"
INFO    | 	 argv[50] = "/media/anson/codes/aosp/prebuilts/android-emulator/linux-x86_64/lib/pc-bios"
INFO    | 	 argv[51] = "-soundhw"
INFO    | 	 argv[52] = "hda"
INFO    | 	 argv[53] = "-vga"
INFO    | 	 argv[54] = "none"
INFO    | 	 argv[55] = "-append"
INFO    | 	 argv[56] = "no_timer_check clocksource=pit no-kvmclock console=ttyS0,38400 cma=4M@0-4G loop.max_part=7 ramoops.mem_address=0xff018000 ramoops.mem_size=0x10000 memmap=0x10000$0xff018000 printk.devkmsg=on qemu=1 androidboot.hardware=ranchu androidboot.serialno=EMULATOR31X3X5X0 qemu.gles=1 qemu.settings.system.screen_off_timeout=1800000 qemu.vsync=60 qemu.gltransport=pipe qemu.gltransport.drawFlushInterval=800 qemu.opengles.version=131072 qemu.dalvik.vm.heapsize=512m qemu.camera_protocol_ver=1 qemu.camera_hq_edge_processing=0 androidboot.android_dt_dir=/sys/bus/platform/devices/ANDR0001:00/properties/android/ androidboot.vbmeta.size=6208 androidboot.vbmeta.hash_alg=sha256 androidboot.vbmeta.digest=1bdf25ee647d5053e6881a5652319e178099c4abef0cfb12263f62cadccfd971 androidboot.console=ttyS0 android.qemud=1 qemu.avd_name=<build>"
INFO    | 	 argv[57] = "-android-hw"
INFO    | 	 argv[58] = "/media/anson/codes/aosp/out/target/product/emulator_x86/hardware-qemu.ini"
INFO    | Concatenated QEMU options: /media/anson/codes/aosp/prebuilts/android-emulator/linux-x86_64/qemu/linux-x86_64/qemu-system-i386 -dns-server 127.0.0.53 -mem-path /media/anson/codes/aosp/out/target/product/emulator_x86/snapshots/default_boot/ram.img -mem-file-shared -serial stdio -device goldfish_pstore,addr=0xff018000,size=0x10000,file=/media/anson/codes/aosp/out/target/product/emulator_x86/build.avd/data/misc/pstore/pstore.bin -cpu android32 -enable-kvm -smp cores=2 -m 2048 -lcd-density 160 -object iothread,id=disk-iothread -nodefaults -kernel /media/anson/codes/aosp/prebuilts/qemu-kernel/x86/ranchu/kernel-qemu -initrd /media/anson/codes/aosp/out/target/product/emulator_x86/ramdisk-qemu.img -drive if=none,index=0,id=system,if=none,file=/media/anson/codes/aosp/out/target/product/emulator_x86/system-qemu.img,read-only -device virtio-blk-pci,drive=system,iothread=disk-iothread,modern-pio-notify -drive if=none,index=1,id=cache,if=none,file=/media/anson/codes/aosp/out/target/product/emulator_x86/cache.img.qcow2,overlap-check=none,cache=unsafe,l2-cache-size=1048576 -device virtio-blk-pci,drive=cache,iothread=disk-iothread,modern-pio-notify -drive if=none,index=2,id=userdata,if=none,file=/media/anson/codes/aosp/out/target/product/emulator_x86/userdata-qemu.img.qcow2,overlap-check=none,cache=unsafe,l2-cache-size=1048576 -device virtio-blk-pci,drive=userdata,iothread=disk-iothread,modern-pio-notify -drive if=none,index=3,id=vendor,if=none,file=/media/anson/codes/aosp/out/target/product/emulator_x86/vendor-qemu.img,read-only -device virtio-blk-pci,drive=vendor,iothread=disk-iothread,modern-pio-notify -netdev user,id=mynet -device virtio-net-pci,netdev=mynet -device virtio-rng-pci -show-cursor -L /media/anson/codes/aosp/prebuilts/android-emulator/linux-x86_64/lib/pc-bios -soundhw hda -vga none -append 'no_timer_check clocksource=pit no-kvmclock console=ttyS0,38400 cma=4M@0-4G loop.max_part=7 ramoops.mem_address=0xff018000 ramoops.mem_size=0x10000 memmap=0x10000$0xff018000 printk.devkmsg=on qemu=1 androidboot.hardwa
VERBOSE | Android qemu version 31.3.5.0 (build_id 8311694) (CL:N/A)
VERBOSE | Starting QEMU main loop
VERBOSE | registered 'boot-properties' qemud service
VERBOSE | Adding boot property: 'ro.opengles.version' = '131072'
VERBOSE | Adding boot property: 'qemu.sf.fake_camera' = 'back'
VERBOSE | Adding boot property: 'dalvik.vm.heapsize' = '512m'
VERBOSE | Adding boot property: 'qemu.hw.mainkeys' = '1'
VERBOSE | Adding boot property: 'qemu.sf.lcd_density' = '160'
VERBOSE | control console listening on port 5554, ADB on port 5555
VERBOSE | goldfish_events.have-dpad: true
VERBOSE | goldfish_events.have-trackball: true
VERBOSE | goldfish_events.have-camera: true
VERBOSE | goldfish_events.have-keyboard: false
VERBOSE | goldfish_events.have-lidswitch: false
VERBOSE | goldfish_events.have-tabletmode: false
VERBOSE | goldfish_events.have-touch: false
VERBOSE | goldfish_events.have-multitouch: true
VERBOSE | Not using any http proxy
VERBOSE | Adding boot property: 'qemu.timezone' = 'Asia/Shanghai'
VERBOSE | android_hw_fingerprint_init: fingerprint qemud listen service initialized
WARNING | *** No gRPC protection active, consider launching with the -grpc-use-jwt flag.***
INFO    | Started GRPC server at 127.0.0.1:8554, security: Local:none
INFO    | Advertising in: /run/user/1000/avd/running/pid_7963.ini
VERBOSE | emulator_window_fb_rotate
VERBOSE | No acpi ini file provided, using default
VERBOSE | Adding boot property: 'ro.opengles.version' = '131072'
VERBOSE | Adding boot property: 'qemu.sf.fake_camera' = 'back'
VERBOSE | Adding boot property: 'dalvik.vm.heapsize' = '512m'
VERBOSE | Adding boot property: 'qemu.hw.mainkeys' = '1'
VERBOSE | Adding boot property: 'qemu.sf.lcd_density' = '160'
VERBOSE | Adding boot property: 'qemu.timezone' = 'Asia/Shanghai'
pulseaudio: set_sink_input_volume() failed
pulseaudio: Reason: Invalid argument
pulseaudio: set_sink_input_mute() failed
pulseaudio: Reason: Invalid argument
VERBOSE |  no root specified:
qemu-system-i386: warning: TSC frequency mismatch between VM (3191998 kHz) and host (3191999 kHz), and TSC scaling unavailable
qemu-system-i386: warning: TSC frequency mismatch between VM (3191998 kHz) and host (3191999 kHz), and TSC scaling unavailable
VERBOSE | Path:/media/anson/codes/aosp/out/host/linux-x86/bin/adb protocol version: 41
VERBOSE | Path:/media/anson/codes/aosp/out/host/linux-x86/bin/adb protocol version: 41
VERBOSE | Found: 1 adb executables
VERBOSE | Adb: /media/anson/codes/aosp/out/host/linux-x86/bin/adb
VERBOSE | Path:/media/anson/codes/aosp/out/host/linux-x86/bin/adb protocol version: 41
ERROR   | Unable to connect to adb daemon on port: 5037
VERBOSE | No acpi ini file provided, using default
[    0.000000] Initializing cgroup subsys cpu
[    0.000000] Initializing cgroup subsys cpuacct
[    0.000000] Linux version 3.18.94+ (android-build@xpcc10.ams.corp.google.com) (gcc version 4.9 20140827 (prerelease) (GCC) ) #1 SMP PREEMPT Mon Feb 12 19:52:31 UTC 2018
[    0.000000] e820: BIOS-provided physical RAM map:
[    0.000000] BIOS-e820: [mem 0x0000000000000000-0x000000000009fbff] usable
[    0.000000] BIOS-e820: [mem 0x000000000009fc00-0x000000000009ffff] reserved
[    0.000000] BIOS-e820: [mem 0x00000000000f0000-0x00000000000fffff] reserved
[    0.000000] BIOS-e820: [mem 0x0000000000100000-0x000000007ffd7fff] usable
[    0.000000] BIOS-e820: [mem 0x000000007ffd8000-0x000000007fffffff] reserved
[    0.000000] BIOS-e820: [mem 0x00000000feffc000-0x00000000feffffff] reserved
[    0.000000] BIOS-e820: [mem 0x00000000fffc0000-0x00000000ffffffff] reserved
[    0.000000] Notice: NX (Execute Disable) protection missing in CPU!
[    0.000000] e820: user-defined physical RAM map:
[    0.000000] user: [mem 0x0000000000000000-0x000000000009fbff] usable
[    0.000000] user: [mem 0x000000000009fc00-0x000000000009ffff] reserved
[    0.000000] user: [mem 0x00000000000f0000-0x00000000000fffff] reserved
[    0.000000] user: [mem 0x0000000000100000-0x000000007ffd7fff] usable
[    0.000000] user: [mem 0x000000007ffd8000-0x000000007fffffff] reserved
[    0.000000] user: [mem 0x00000000feffc000-0x00000000feffffff] reserved
[    0.000000] user: [mem 0x00000000ff018000-0x00000000ff027fff] reserved
[    0.000000] user: [mem 0x00000000fffc0000-0x00000000ffffffff] reserved
[    0.000000] SMBIOS 2.8 present.
[    0.000000] e820: last_pfn = 0x7ffd8 max_arch_pfn = 0x100000
[    0.000000] found SMP MP-table at [mem 0x000f5b40-0x000f5b4f] mapped at [c00f5b40]
[    0.000000] init_memory_mapping: [mem 0x00000000-0x000fffff]
[    0.000000] init_memory_mapping: [mem 0x34800000-0x34bfffff]
[    0.000000] init_memory_mapping: [mem 0x30000000-0x347fffff]
[    0.000000] init_memory_mapping: [mem 0x00100000-0x2fffffff]
[    0.000000] init_memory_mapping: [mem 0x34c00000-0x34ffdfff]
[    0.000000] RAMDISK: [mem 0x7fda0000-0x7ffcffff]
[    0.000000] Allocated new RAMDISK: [mem 0x34dbf000-0x34fee4cb]
[    0.000000] Move RAMDISK from [mem 0x7fda0000-0x7ffcf4cb] to [mem 0x34dbf000-0x34fee4cb]
[    0.000000] ACPI: Early table checksum verification disabled
[    0.000000] ACPI: RSDP 0x00000000000F5940 000014 (v00 BOCHS )
[    0.000000] ACPI: RSDT 0x000000007FFE1B46 000030 (v01 BOCHS  BXPCRSDT 00000001 BXPC 00000001)
[    0.000000] ACPI: FACP 0x000000007FFE1A1A 000074 (v01 BOCHS  BXPCFACP 00000001 BXPC 00000001)
[    0.000000] ACPI: DSDT 0x000000007FFE0040 0019DA (v01 BOCHS  BXPCDSDT 00000001 BXPC 00000001)
[    0.000000] ACPI: FACS 0x000000007FFE0000 000040
[    0.000000] ACPI: APIC 0x000000007FFE1A8E 000080 (v01 BOCHS  BXPCAPIC 00000001 BXPC 00000001)
[    0.000000] ACPI: HPET 0x000000007FFE1B0E 000038 (v01 BOCHS  BXPCHPET 00000001 BXPC 00000001)
[    0.000000] 1199MB HIGHMEM available.
[    0.000000] 847MB LOWMEM available.
[    0.000000]   mapped low ram: 0 - 34ffe000
[    0.000000]   low ram: 0 - 34ffe000
[    0.000000] cma: Reserved 4 MiB at 0x34800000
[    0.000000] Zone ranges:
[    0.000000]   DMA      [mem 0x00001000-0x00ffffff]
[    0.000000]   Normal   [mem 0x01000000-0x34ffdfff]
[    0.000000]   HighMem  [mem 0x34ffe000-0x7ffd7fff]
[    0.000000] Movable zone start for each node
[    0.000000] Early memory node ranges
[    0.000000]   node   0: [mem 0x00001000-0x0009efff]
[    0.000000]   node   0: [mem 0x00100000-0x7ffd7fff]
[    0.000000] Initmem setup node 0 [mem 0x00001000-0x7ffd7fff]
[    0.000000] Using APIC driver default
[    0.000000] ACPI: PM-Timer IO Port: 0x608
[    0.000000] ACPI: LAPIC (acpi_id[0x00] lapic_id[0x00] enabled)
[    0.000000] ACPI: LAPIC (acpi_id[0x01] lapic_id[0x01] enabled)
[    0.000000] ACPI: LAPIC_NMI (acpi_id[0xff] dfl dfl lint[0x1])
[    0.000000] ACPI: IOAPIC (id[0x00] address[0xfec00000] gsi_base[0])
[    0.000000] IOAPIC[0]: apic_id 0, version 17, address 0xfec00000, GSI 0-23
[    0.000000] ACPI: INT_SRC_OVR (bus 0 bus_irq 0 global_irq 2 dfl dfl)
[    0.000000] ACPI: INT_SRC_OVR (bus 0 bus_irq 5 global_irq 5 high level)
[    0.000000] ACPI: INT_SRC_OVR (bus 0 bus_irq 9 global_irq 9 high level)
[    0.000000] ACPI: INT_SRC_OVR (bus 0 bus_irq 10 global_irq 10 high level)
[    0.000000] ACPI: INT_SRC_OVR (bus 0 bus_irq 11 global_irq 11 high level)
[    0.000000] Using ACPI (MADT) for SMP configuration information
[    0.000000] ACPI: HPET id: 0x8086a201 base: 0xfed00000
[    0.000000] smpboot: Allowing 2 CPUs, 0 hotplug CPUs
[    0.000000] e820: [mem 0x80000000-0xfeffbfff] available for PCI devices
[    0.000000] setup_percpu: NR_CPUS:512 nr_cpumask_bits:512 nr_cpu_ids:2 nr_node_ids:1
[    0.000000] PERCPU: Embedded 15 pages/cpu @f4d94000 s31936 r0 d29504 u61440
[    0.000000] Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 522454
[    0.000000] Kernel command line: no_timer_check clocksource=pit no-kvmclock console=ttyS0,38400 cma=4M@0-4G loop.max_part=7 ramoops.mem_address=0xff018000 ramoops.mem_size=0x10000 memmap=0x10000$0xff018000 printk.devkmsg=on qemu=1 androidboot.hardware=ranchu androidboot.serialno=EMULATOR31X3X5X0 qemu.gles=1 qemu.settings.system.screen_off_timeout=1800000 qemu.vsync=60 qemu.gltransport=pipe qemu.gltransport.drawFlushInterval=800 qemu.opengles.version=131072 qemu.dalvik.vm.heapsize=512m qemu.camera_protocol_ver=1 qemu.camera_hq_edge_processing=0 androidboot.android_dt_dir=/sys/bus/platform/devices/ANDR0001:00/properties/android/ androidboot.vbmeta.size=6208 androidboot.vbmeta.hash_alg=sha256 androidboot.vbmeta.digest=1bdf25ee647d5053e6881a5652319e178099c4abef0cfb12263f62cadccfd971 androidboot.console=ttyS0 android.qemud=1 qemu.avd_name=<build> mac80211_hwsim.mac_prefix=5554
[    0.000000] PID hash table entries: 4096 (order: 2, 16384 bytes)
[    0.000000] Dentry cache hash table entries: 131072 (order: 7, 524288 bytes)
[    0.000000] Inode-cache hash table entries: 65536 (order: 6, 262144 bytes)
[    0.000000] Initializing CPU#0
[    0.000000] Initializing HighMem for node 0 (00034ffe:0007ffd8)
[    0.000000] Initializing Movable for node 0 (00000000:00000000)
[    0.000000] Memory: 2062032K/2096600K available (5832K kernel code, 533K rwdata, 3252K rodata, 516K init, 540K bss, 30472K reserved, 4096K cma-reserved, 1228648K highmem)
[    0.000000] virtual kernel memory layout:
[    0.000000]     fixmap  : 0xfd7b6000 - 0xfffff000   (41252 kB)
[    0.000000]     pkmap   : 0xfd000000 - 0xfd400000   (4096 kB)
[    0.000000]     vmalloc : 0xf57fe000 - 0xfcffe000   ( 120 MB)
[    0.000000]     lowmem  : 0xc0000000 - 0xf4ffe000   ( 847 MB)
[    0.000000]       .init : 0xc0b68000 - 0xc0be9000   ( 516 kB)
[    0.000000]       .data : 0xc07b2378 - 0xc0b667c0   (3793 kB)
[    0.000000]       .text : 0xc0200000 - 0xc07b2378   (5832 kB)
[    0.000000] Checking if this processor honours the WP bit even in supervisor mode...Ok.
[    0.000000] SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=2, Nodes=1
[    0.000000] Preemptible hierarchical RCU implementation.
[    0.000000] 	RCU restricting CPUs from NR_CPUS=512 to nr_cpu_ids=2.
[    0.000000] RCU: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=2
[    0.000000] NR_IRQS:33024 nr_irqs:440 0
[    0.000000] console [ttyS0] enabled
[    0.000000] tsc: Fast TSC calibration using PIT
[    0.000000] tsc: Detected 3191.706 MHz processor
[    0.010001] Calibrating delay loop (skipped), value calculated using timer frequency.. 6383.41 BogoMIPS (lpj=31917060)
[    0.020003] pid_max: default: 32768 minimum: 301
[    0.020452] ACPI: Core revision 20140926
[    0.021333] ACPI: All ACPI Tables successfully acquired
[    0.021928] Security Framework initialized
[    0.022341] SELinux:  Initializing.
[    0.022659] Mount-cache hash table entries: 2048 (order: 1, 8192 bytes)
[    0.023310] Mountpoint-cache hash table entries: 2048 (order: 1, 8192 bytes)
[    0.024181] Initializing cgroup subsys freezer
[    0.024657] Initializing cgroup subsys debug
[    0.025108] CPU: Physical Processor ID: 0
[    0.025553] CPU: Processor Core ID: 0
[    0.025926] Last level iTLB entries: 4KB 0, 2MB 0, 4MB 0
[    0.025926] Last level dTLB entries: 4KB 0, 2MB 0, 4MB 0, 1GB 0
[    0.027267] Freeing SMP alternatives memory: 28K
[    0.027825] Enabling APIC mode:  Flat.  Using 1 I/O APICs
[    0.029480] ..TIMER: vector=0x30 apic1=0 pin1=2 apic2=-1 pin2=-1
[    0.030002] smpboot: CPU0: Intel Android 32-bit virtual processor (fam: 06, model: 06, stepping: 03)
[    0.040000] Performance Events: Broken PMU hardware detected, using software events only.
[    0.040000] Failed to access perfctr msr (MSR c1 is 0)
[    0.190156] x86: Booting SMP configuration:
[    0.191579] .... node  #0, CPUs:      #1
[    0.020000] Initializing CPU#1
[    0.352058] x86: Booted up 1 node, 2 CPUs
[    0.352616] smpboot: Total of 2 processors activated (12773.99 BogoMIPS)
[    0.353331] CPU1: update max cpu_capacity 1024
[    0.353799] NET: Registered protocol family 16
[    0.353799] ramoops: using module parameters
[    0.353799] console [pstore-1] enabled
[    0.353799] pstore: Registered ramoops as persistent store backend
[    0.353799] ramoops: attached 0x10000@0xff018000, ecc: 0/0
[    0.360001] CPU0: update max cpu_capacity 1024
[    0.380003] cpuidle: using governor ladder
[    0.400010] cpuidle: using governor menu
[    0.400631] ACPI: bus type PCI registered
[    0.401063] PCI: PCI BIOS revision 2.10 entry at 0xfd20f, last bus=0
[    0.401574] PCI: Using configuration type 1 for base access
[    0.470096] ACPI: Added _OSI(Module Device)
[    0.470914] ACPI: Added _OSI(Processor Device)
[    0.471800] ACPI: Added _OSI(3.0 _SCP Extensions)
[    0.472894] ACPI: Added _OSI(Processor Aggregator Device)
[    0.476481] ACPI: Interpreter enabled
[    0.477364] ACPI Exception: AE_NOT_FOUND, While evaluating Sleep State [\_S1_] (20140926/hwxface-580)
[    0.479611] ACPI Exception: AE_NOT_FOUND, While evaluating Sleep State [\_S2_] (20140926/hwxface-580)
[    0.481310] ACPI: (supports S0 S3 S5)
[    0.482186] ACPI: Using IOAPIC for interrupt routing
[    0.483450] PCI: Using host bridge windows from ACPI; if necessary, use "pci=nocrs" and report a bug
[    0.492115] ACPI: PCI Root Bridge [PCI0] (domain 0000 [bus 00-ff])
[    0.493592] acpi PNP0A03:00: _OSC: OS supports [Segments]
[    0.494892] acpi PNP0A03:00: _OSC failed (AE_NOT_FOUND); disabling ASPM
[    0.496473] acpi PNP0A03:00: host bridge window [0x400000000-0x800017fff] (ignored, not CPU addressable)
[    0.498334] acpi PNP0A03:00: fail to add MMCONFIG information, can't access extended PCI configuration space under this bridge.
[    0.500077] PCI host bridge to bus 0000:00
[    0.500836] pci_bus 0000:00: root bus resource [bus 00-ff]
[    0.501826] pci_bus 0000:00: root bus resource [io  0x0000-0x0cf7]
[    0.502751] pci_bus 0000:00: root bus resource [io  0x0d00-0xffff]
[    0.503682] pci_bus 0000:00: root bus resource [mem 0x000a0000-0x000bffff]
[    0.504718] pci_bus 0000:00: root bus resource [mem 0x80000000-0xfebfffff]
[    0.510218] pci 0000:00:01.1: legacy IDE quirk: reg 0x10: [io  0x01f0-0x01f7]
[    0.511130] pci 0000:00:01.1: legacy IDE quirk: reg 0x14: [io  0x03f6]
[    0.511958] pci 0000:00:01.1: legacy IDE quirk: reg 0x18: [io  0x0170-0x0177]
[    0.512757] pci 0000:00:01.1: legacy IDE quirk: reg 0x1c: [io  0x0376]
[    0.513934] pci 0000:00:01.3: can't claim BAR 7 [io  0x0600-0x063f]: address conflict with ACPI PM1a_EVT_BLK [io  0x0600-0x0603]
[    0.515207] pci 0000:00:01.3: quirk: [io  0x0700-0x070f] claimed by PIIX4 SMB
[    0.525956] pci 0000:00:03.0: reg 0x20: can't handle BAR above 4G (bus address 0x800000000)
[    0.535018] pci 0000:00:04.0: reg 0x20: can't handle BAR above 4G (bus address 0x800004000)
[    0.543008] pci 0000:00:05.0: reg 0x20: can't handle BAR above 4G (bus address 0x800008000)
[    0.552240] pci 0000:00:06.0: reg 0x20: can't handle BAR above 4G (bus address 0x80000c000)
[    0.558239] pci 0000:00:07.0: reg 0x20: can't handle BAR above 4G (bus address 0x800010000)
[    0.563441] pci 0000:00:08.0: reg 0x20: can't handle BAR above 4G (bus address 0x800014000)
[    0.566015] pci 0000:00:0b.0: reg 0x14: can't handle BAR larger than 4GB (size 0x3ffffffff)
[    0.570607] ACPI: PCI Interrupt Link [LNKA] (IRQs 5 *10 11)
[    0.571185] ACPI: PCI Interrupt Link [LNKB] (IRQs 5 *10 11)
[    0.573602] ACPI: PCI Interrupt Link [LNKC] (IRQs 5 10 *11)
[    0.574160] ACPI: PCI Interrupt Link [LNKD] (IRQs 5 10 *11)
[    0.574692] ACPI: PCI Interrupt Link [LNKS] (IRQs *9)
[    0.575517] ACPI: Enabled 2 GPEs in block 00 to 0F
[    0.575968] vgaarb: loaded
[    0.576280] SCSI subsystem initialized
[    0.590044] ACPI: bus type USB registered
[    0.590607] usbcore: registered new interface driver usbfs
[    0.591103] usbcore: registered new interface driver hub
[    0.591629] usbcore: registered new device driver usb
[    0.592047] pps_core: LinuxPPS API ver. 1 registered
[    0.592443] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>
[    0.593160] PTP clock support registered
[    0.593505] Advanced Linux Sound Architecture Driver Initialized.
[    0.593505] PCI: Using ACPI for IRQ routing
[    0.610006] cfg80211: Calling CRDA to update world regulatory domain
[    0.610533] NetLabel: Initializing
[    0.610811] NetLabel:  domain hash size = 128
[    0.611152] NetLabel:  protocols = UNLABELED CIPSOv4
[    0.611550] NetLabel:  unlabeled traffic allowed by default
[    0.612275] amd_nb: Cannot enumerate AMD northbridges
[    0.612733] Switched to clocksource hpet
[    0.616600] pnp: PnP ACPI init
[    0.617170] pnp: PnP ACPI: found 5 devices
[    0.649457] pci 0000:00:01.3: BAR 7: [io  0x0600-0x063f] has bogus alignment
[    0.650191] pci 0000:00:03.0: BAR 4: assigned [mem 0x80000000-0x80003fff 64bit pref]
[    0.651388] pci 0000:00:04.0: BAR 4: assigned [mem 0x80004000-0x80007fff 64bit pref]
[    0.652491] pci 0000:00:05.0: BAR 4: assigned [mem 0x80008000-0x8000bfff 64bit pref]
[    0.653626] pci 0000:00:06.0: BAR 4: assigned [mem 0x8000c000-0x8000ffff 64bit pref]
[    0.654738] pci 0000:00:07.0: BAR 4: assigned [mem 0x80010000-0x80013fff 64bit pref]
[    0.655837] pci 0000:00:08.0: BAR 4: assigned [mem 0x80014000-0x80017fff 64bit pref]
[    0.656758] pci 0000:00:0b.0: BAR 1: assigned [mem 0x80018000 64bit disabled]
[    0.657595] pci 0000:00:0b.0: BAR 1: error updating (0x80018004 != 0x000004)
[    0.658309] NET: Registered protocol family 2
[    0.658784] TCP established hash table entries: 8192 (order: 3, 32768 bytes)
[    0.659343] TCP bind hash table entries: 8192 (order: 4, 65536 bytes)
[    0.659852] TCP: Hash tables configured (established 8192 bind 8192)
[    0.660394] TCP: reno registered
[    0.660650] UDP hash table entries: 512 (order: 2, 16384 bytes)
[    0.661865] UDP-Lite hash table entries: 512 (order: 2, 16384 bytes)
[    0.662394] NET: Registered protocol family 1
[    0.662755] pci 0000:00:00.0: Limiting direct PCI/PCI transfers
[    0.663224] pci 0000:00:01.0: PIIX3: Enabling Passive Release
[    0.663687] pci 0000:00:01.0: Activating ISA DMA hang workarounds
[    0.664266] Trying to unpack rootfs image as initramfs...
[    0.664723] rootfs image is not initramfs (compression method lz4 not configured); looks like an initrd
[    0.666486] Freeing initrd memory: 2240K
[    0.667395] futex hash table entries: 512 (order: 3, 32768 bytes)
[    0.667906] Initialise system trusted keyring
[    0.668256] audit: initializing netlink subsys (disabled)
[    0.668696] audit: type=2000 audit(1649569721.660:1): initialized
[    0.669277] HugeTLB registered 4 MB page size, pre-allocated 0 pages
[    0.670722] VFS: Disk quotas dquot_6.5.2
[    0.671067] Dquot-cache hash table entries: 1024 (order 0, 4096 bytes)
[    0.671812] Registering sdcardfs 0.1
[    0.672141] fuse init (API version 7.23)
[    0.673177] Key type asymmetric registered
[    0.673512] Asymmetric key parser 'x509' registered
[    0.673901] Key type pkcs7_test registered
[    0.674228] bounce: pool size: 64 pages
[    0.674554] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 250)
[    0.675132] io scheduler noop registered
[    0.675448] io scheduler deadline registered
[    0.675796] io scheduler cfq registered (default)
[    0.676209] pci_hotplug: PCI Hot Plug PCI Core version: 0.5
[    0.683638] input: Power Button as /devices/LNXSYSTM:00/LNXPWRBN:00/input/input0
[    0.684265] ACPI: Power Button [PWRF]
[    0.701140] ACPI: PCI Interrupt Link [LNKC] enabled at IRQ 11
[    0.718662] ACPI: PCI Interrupt Link [LNKD] enabled at IRQ 10
[    0.735675] ACPI: PCI Interrupt Link [LNKA] enabled at IRQ 10
[    0.752945] ACPI: PCI Interrupt Link [LNKB] enabled at IRQ 11
[    0.786572] Serial: 8250/16550 driver, 4 ports, IRQ sharing disabled
[    0.809665] 00:04: ttyS0 at I/O 0x3f8 (irq = 4, base_baud = 115200) is a 16550A
[    0.810688] Non-volatile memory driver v1.3
[    0.812378] Linux agpgart interface v0.103
[    0.812998] [drm] Initialized drm 1.1.0 20060810
[    0.814674] brd: module loaded
[    0.815559] loop: module loaded
[    0.816828]  vda: vda1 vda2
[    0.817574]  vdb: unknown partition table
[    0.818439]  vdc: unknown partition table
[    0.819732]  vdd: vdd1
[    0.820024] Loading iSCSI transport class v2.0-870.
[    0.841063] scsi host0: ata_piix
[    0.851692] scsi host1: ata_piix
[    0.852072] ata1: PATA max MWDMA2 cmd 0x1f0 ctl 0x3f6 bmdma 0xc140 irq 14
[    0.852618] ata2: PATA max MWDMA2 cmd 0x170 ctl 0x376 bmdma 0xc148 irq 15
[    0.853205] tun: Universal TUN/TAP device driver, 1.6
[    0.853694] tun: (C) 1999-2004 Max Krasnyansky <maxk@qualcomm.com>
[    0.854507] e100: Intel(R) PRO/100 Network Driver, 3.5.24-k2-NAPI
[    0.854988] e100: Copyright(c) 1999-2006 Intel Corporation
[    0.855434] e1000: Intel(R) PRO/1000 Network Driver - version 7.3.21-k8-NAPI
[    0.855988] e1000: Copyright (c) 1999-2006 Intel Corporation.
[    0.856457] e1000e: Intel(R) PRO/1000 Network Driver - 2.3.2-k
[    0.856911] e1000e: Copyright(c) 1999 - 2014 Intel Corporation.
[    0.857382] sky2: driver version 1.30
[    0.857706] PPP generic driver version 2.4.2
[    0.858068] PPP BSD Compression module registered
[    0.858435] PPP Deflate Compression module registered
[    0.858840] PPP MPPE Compression module registered
[    0.859219] NET: Registered protocol family 24
[    0.859933] mac80211_hwsim: initializing netlink
[    0.860364] usbcore: registered new interface driver asix
[    0.860813] usbcore: registered new interface driver ax88179_178a
[    0.861304] usbcore: registered new interface driver cdc_ether
[    0.861757] usbcore: registered new interface driver net1080
[    0.862210] usbcore: registered new interface driver cdc_subset
[    0.862679] usbcore: registered new interface driver zaurus
[    0.863138] usbcore: registered new interface driver cdc_ncm
[    0.863677] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[    0.864226] ehci-pci: EHCI PCI platform driver
[    0.864627] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
[    0.865132] ohci-pci: OHCI PCI platform driver
[    0.865494] uhci_hcd: USB Universal Host Controller Interface driver
[    0.866029] usbcore: registered new interface driver usblp
[    0.866483] usbcore: registered new interface driver usb-storage
[    0.866993] mousedev: PS/2 mouse device common for all mice
[    0.868012] input: qwerty2 as /devices/platform/GFSH0002:00/input/input1
[    0.868734] input: goldfish_rotary as /devices/platform/GFSH0008:00/input/input2
[    0.869349] usbcore: registered new interface driver xpad
[    0.869794] usbcore: registered new interface driver usb_acecad
[    0.870304] usbcore: registered new interface driver aiptek
[    0.870768] usbcore: registered new interface driver gtco
[    0.871214] usbcore: registered new interface driver hanwang
[    0.871683] usbcore: registered new interface driver kbtab
[    0.872197] rtc_cmos 00:00: RTC can wake from S4
[    0.872727] rtc_cmos 00:00: rtc core: registered rtc_cmos as rtc0
[    0.873299] rtc_cmos 00:00: alarms up to one day, y3k, 114 bytes nvram, hpet irqs
[    0.873951] goldfish_rtc GFSH0007:00: rtc core: registered GFSH0007:00 as rtc1
[    0.874878] device-mapper: uevent: version 1.0.3
[    0.875302] device-mapper: ioctl: 4.28.0-ioctl (2014-09-17) initialised: dm-devel@redhat.com
[    0.886106] hidraw: raw HID events driver (C) Jiri Kosina
[    0.887057] usbcore: registered new interface driver usbhid
[    0.887508] usbhid: USB HID core driver
[    0.897980] ashmem: initialized
[    0.898471] goldfish_sync: Initialized goldfish sync device
[    0.915871] u32 classifier
[    0.916201]     Actions configured
[    0.916477] Netfilter messages via NETLINK v0.30.
[    0.916908] nf_conntrack version 0.5.0 (16384 buckets, 65536 max)
[    0.917488] ctnetlink v0.93: registering with nfnetlink.
[    0.918084] xt_time: kernel timezone is -0000
[    0.919325] sound hdaudioC0D0: autoconfig: line_outs=1 (0x3/0x0/0x0/0x0/0x0) type:line
[    0.919947] sound hdaudioC0D0:    speaker_outs=0 (0x0/0x0/0x0/0x0/0x0)
[    0.920489] sound hdaudioC0D0:    hp_outs=0 (0x0/0x0/0x0/0x0/0x0)
[    0.920970] sound hdaudioC0D0:    mono: mono_out=0x0
[    0.921349] sound hdaudioC0D0:    inputs:
[    0.921666] sound hdaudioC0D0:      Line=0x5
[    0.922772] ip_tables: (C) 2000-2006 Netfilter Core Team
[    0.923224] arp_tables: (C) 2002 David S. Miller
[    0.923623] TCP: cubic registered
[    0.923888] Initializing XFRM netlink socket
[    0.924320] NET: Registered protocol family 10
[    0.924961] mip6: Mobile IPv6
[    0.925202] ip6_tables: (C) 2000-2006 Netfilter Core Team
[    0.925650] sit: IPv6 over IPv4 tunneling driver
[    0.926106] NET: Registered protocol family 17
[    0.926471] NET: Registered protocol family 15
[    0.927098] Using IPI No-Shortcut mode
[    0.927482] Loading compiled-in X.509 certificates
[    0.927873] registered taskstats version 1
[    0.928768] console [netcon0] enabled
[    0.929076] netconsole: network logging started
[    0.929437] otg_wakelock_init: No USB transceiver found
[    0.929885] ALSA device list:
[    0.930189]   #0: HDA Intel at 0xfebc0000 irq 11
[    1.010697] md: Waiting for all devices to be available before autodetect
[    1.011938] md: If you don't use raid, use raid=noautodetect
[    1.013163] md: Autodetecting RAID arrays.
[    1.013957] md: Scanned 0 and added 0 devices.
[    1.014868] md: autorun ...
[    1.015483] md: ... autorun DONE.
[    1.016269] RAMDISK: lz4 image found at block 0
[    1.017253] RAMDISK: lz4 decompressor not configured!
[    1.018334] Invalid ramdisk decompression routine.  Select appropriate config option.
[    1.019999] Kernel panic - not syncing: Could not decompress initial ramdisk image.
[    1.020662] CPU: 1 PID: 1 Comm: swapper/0 Not tainted 3.18.94+ #1
[    1.020662] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.11.1-0-g0551a4be2c-prebuilt.qemu-project.org 04/01/2014
[    1.020662]  00000000 00000046 f34a3f0c c07a9e6c f35d8600 00000000 f34a3f24 c07a9098
[    1.020662]  00000000 f35d8600 00000000 00000000 f34a3f64 c0b694be c09ec083 c09ec036
[    1.020662]  c09ec0d7 f3424250 f320a100 00000000 00000003 00000004 f34a3f64 c0a248ae
[    1.020662] Call Trace:
[    1.020662]  [<c07a9e6c>] dump_stack+0x45/0x59
[    1.020662]  [<c07a9098>] panic+0x7c/0x17b
[    1.020662]  [<c0b694be>] rd_load_image+0x283/0x4a9
[    1.020662]  [<c0b697da>] initrd_load+0x3b/0x28a
[    1.020662]  [<c0b6905c>] prepare_namespace+0xc2/0x171
[    1.020662]  [<c0b68bd5>] kernel_init_freeable+0x158/0x165
[    1.020662]  [<c07a7b89>] kernel_init+0x8/0xce
[    1.020662]  [<c07b0801>] ret_from_kernel_thread+0x21/0x30
[    1.020662]  [<c07a7b81>] ? rest_init+0x70/0x70
[    1.020662] Kernel Offset: 0x0 from 0xc0200000 (relocation range: 0xc0000000-0xf57fdfff)
[    1.020662] Rebooting in 5 seconds..WARNING | Unknown tab selected.

Rebooting in 5 seconds… 跑到这里, 就不停地重启, 循环上面的内核部分的LOG, 模拟器只显示一个框和黑色界面, 不出现任何图像

后续尝试过launch不同的类型, 如lunch sdk_phone64_arm64 均无法解决上述问题
查阅不同的kernel尝试替换仍然一无所获.

aosp/prebuilts/qemu-kernel$ find . -name "kernel-qemu"
./arm64/3.10/kernel-qemu
./arm64/kernel-qemu
./arm64/ranchu/kernel-qemu
./arm/3.10/kernel-qemu
./arm/kernel-qemu
./arm/ranchu/kernel-qemu
./x86_64/3.10/kernel-qemu
./x86_64/kernel-qemu
./x86_64/ranchu/kernel-qemu
./mips/3.10/kernel-qemu
./mips/kernel-qemu
./mips/ranchu/kernel-qemu
./x86/3.10/kernel-qemu
./x86/kernel-qemu
./x86/ranchu/kernel-qemu
./mips64/3.10/kernel-qemu
./mips64/kernel-qemu
./mips64/ranchu/kernel-qemu

无奈之下, 尝试更新仓库, 意外地解决了,

附: 生成的相关文件

$ ll out/target/product/emulator_x86_64/
total 8831116
drwxrwxr-x 26 anson anson       4096 417 06:38 ./
drwxrwxr-x  3 anson anson       4096 416 10:10 ../
-rw-rw-r--  1 anson anson        660 416 10:12 advancedFeatures.ini
-rw-rw-r--  1 anson anson         22 416 10:12 android-info.txt
drwxrwxr-x 32 anson anson       4096 416 12:39 apex/
drwxrwxr-x  2 anson anson       4096 416 13:06 appcompat/
drwxrwxr-x  3 anson anson       4096 416 15:51 build.avd/
-rw-rw-r--  1 anson anson         90 416 10:11 build_fingerprint.txt
-rw-rw-r--  1 anson anson         61 416 10:11 build_thumbprint.txt
drwxrwxr-x  2 anson anson       4096 416 12:23 cache/
-rw-rw-r--  1 anson anson   16777216 416 12:23 cache.img
-rw-r--r--  1 anson anson     196616 416 15:50 cache.img.qcow2
-rw-rw-r--  1 anson anson     193024 416 10:10 clean_steps.mk
-rw-rw-r--  1 anson anson        417 416 10:12 config.ini
-rw-rw-r--  1 anson anson         48 416 10:11 .copied_headers_list
drwxrwxr-x  4 anson anson       4096 416 10:12 data/
drwxrwxr-x  2 anson anson       4096 416 12:23 debug_ramdisk/
drwxrwxr-x  2 anson anson      12288 416 12:06 dexpreopt_config/
-rw-rw-r--  1 anson anson         13 416 10:12 dtb.img
-rw-rw-r--  1 anson anson        186 417 06:38 emu-launch-params.txt
-rw-rw-r--  1 anson anson   18874368 416 10:12 encryptionkey.img
-rw-r--r--  1 anson anson    2031616 417 06:01 encryptionkey.img.qcow2
drwxrwxr-x  2 anson anson       4096 416 12:13 fake_packages/
drwxrwxr-x  4 anson anson       4096 416 10:43 gen/
-rw-rw-r--  1 anson anson       3607 417 06:38 hardware-qemu.ini
-rw-rw-r--  1 anson anson    2290696 417 06:38 initrd
-rw-rw-r--  1 anson anson    3567300 416 10:11 .installable_files.previous
-rw-rw-r--  1 anson anson     416060 416 13:05 installed-files.json
-rw-rw-r--  1 anson anson      52258 416 13:02 installed-files-product.json
-rw-rw-r--  1 anson anson      18853 416 13:02 installed-files-product.txt
-rw-rw-r--  1 anson anson        777 416 12:23 installed-files-ramdisk-debug.json
-rw-rw-r--  1 anson anson        228 416 12:23 installed-files-ramdisk-debug.txt
-rw-rw-r--  1 anson anson        304 416 12:23 installed-files-ramdisk.json
-rw-rw-r--  1 anson anson         81 416 12:23 installed-files-ramdisk.txt
-rw-rw-r--  1 anson anson       2597 416 10:13 installed-files-root.json
-rw-rw-r--  1 anson anson        560 416 10:13 installed-files-root.txt
-rw-rw-r--  1 anson anson       6413 416 13:06 installed-files-system_ext.json
-rw-rw-r--  1 anson anson       2366 416 13:06 installed-files-system_ext.txt
-rw-rw-r--  1 anson anson     133121 416 13:05 installed-files.txt
-rw-rw-r--  1 anson anson     131702 416 13:02 installed-files-vendor.json
-rw-rw-r--  1 anson anson       8800 416 12:23 installed-files-vendor-ramdisk-debug.json
-rw-rw-r--  1 anson anson       2976 416 12:23 installed-files-vendor-ramdisk-debug.txt
-rw-rw-r--  1 anson anson       8327 416 10:44 installed-files-vendor-ramdisk.json
-rw-rw-r--  1 anson anson       2829 416 10:44 installed-files-vendor-ramdisk.txt
-rw-rw-r--  1 anson anson      43642 416 13:02 installed-files-vendor.txt
-rw-rw-r--  1 anson anson   24708960 416 10:12 kernel-ranchu
-rw-rw-r--  1 anson anson       6356 416 10:12 misc_info.txt
drwxrwxr-x  3 anson anson       4096 417 01:23 modem_simulator/
-rw-rw-r--  1 anson anson   49498429 416 10:12 module-info.json
-rw-rw-r--  1 anson anson   53000226 416 10:12 module-info.json.rsp
-rw-rw-r--  1 anson anson          0 417 06:38 multiinstance.lock
drwxrwxr-x 13 anson anson       4096 416 13:06 obj/
drwxrwxr-x  6 anson anson       4096 416 11:55 obj_x86/
-rw-rw-r--  1 anson anson         46 416 10:11 previous_build_config.mk
drwxrwxr-x  9 anson anson       4096 416 13:02 product/
-rw-rw-r--  1 anson anson  313065472 416 13:03 product.img
-rw-rw-r--  1 anson anson  315621376 416 13:03 product-qemu.img
-rw-rw-r--  1 anson anson         18 417 06:38 quickbootChoice.ini
drwxrwxr-x 10 anson anson       4096 416 12:23 ramdisk/
-rw-rw-r--  1 anson anson    1648094 416 12:23 ramdisk.img
-rw-rw-r--  1 anson anson    2288989 416 12:23 ramdisk-qemu.img
-rw-rw-r--  1 anson anson          0 417 06:38 read-snapshot.txt
drwxrwxr-x 27 anson anson       4096 416 10:12 root/
drwxr--r--  3 anson anson       4096 416 15:50 snapshots/
-rw-r--r--  1 anson anson       4592 416 12:23 super_empty.img
-rw-r--r--  1 anson anson 4303355904 416 13:06 super.img
drwxrwxr-x  8 anson anson       4096 416 12:23 symbols/
drwxrwxr-x 14 anson anson       4096 416 13:01 system/
drwxrwxr-x  7 anson anson       4096 416 12:54 system_ext/
-rw-rw-r--  1 anson anson  138182656 416 13:06 system_ext.img
-rw-rw-r--  1 anson anson  140509184 416 13:06 system_ext-qemu.img
-rw-rw-r--  1 anson anson 1047109632 416 13:05 system.img
-rw-rw-r--  1 anson anson        108 416 13:06 system-qemu-config.txt
-rw-rw-r--  1 anson anson 4306501632 416 13:06 system-qemu.img
drwxrwxr-x  2 anson anson       4096 416 10:12 test_harness_ramdisk/
drwxr-xr-x  2 anson anson       4096 417 06:02 tmpAdbCmds/
-rw-rw-r--  1 anson anson  576716800 416 12:23 userdata.img
-rw-r--r--  1 anson anson 6442450944 416 15:50 userdata-qemu.img
-rw-r--r--  1 anson anson  508821504 417 06:02 userdata-qemu.img.qcow2
-rw-rw-r--  1 anson anson       8192 416 13:06 vbmeta.img
drwxrwxr-x 11 anson anson       4096 416 12:23 vendor/
-rw-rw-r--  1 anson anson     872448 416 12:23 vendor_boot-debug.img
-rw-rw-r--  1 anson anson  100663296 416 11:51 vendor_boot.img
-rw-rw-r--  1 anson anson     872448 416 12:23 vendor_boot-test-harness.img
drwxrwxr-x  2 anson anson       4096 416 12:23 vendor_debug_ramdisk/
-rw-rw-r--  1 anson anson  161206272 416 13:02 vendor.img
-rw-rw-r--  1 anson anson  163577856 416 13:03 vendor-qemu.img
drwxrwxr-x  4 anson anson       4096 416 10:12 vendor_ramdisk/
-rw-rw-r--  1 anson anson     863456 416 12:23 vendor_ramdisk-debug.img
-rw-rw-r--  1 anson anson     640895 416 10:44 vendor_ramdisk.img
-rw-rw-r--  1 anson anson     863844 416 12:23 vendor_ramdisk-test-harness.img
-rw-rw-r--  1 anson anson        356 416 13:06 VerifiedBootParams.textproto
-rw-rw-r--  1 anson anson          3 416 15:50 version_num.cache

附正常启动LOG: android AOSP 模拟器启动成功日志


模拟器莫名奇妙崩溃

nouveau: kernel rejected pushbuf: Invalid argument
nouveau: ch6: krec 0 pushes 0 bufs 2 relocs 0
nouveau: ch6: buf 00000000 00000003 00000004 00000004 00000000
nouveau: ch6: buf 00000001 00000006 00000004 00000000 00000004
nouveau: kernel rejected pushbuf: Invalid argument
nouveau: ch6: krec 0 pushes 1 bufs 10 relocs 0
nouveau: ch6: buf 00000000 00000004 00000004 00000004 00000000
nouveau: ch6: buf 00000001 00000004 00000004 00000004 00000000
nouveau: ch6: buf 00000002 00000046 00000002 00000002 00000000
nouveau: ch6: buf 00000003 00000010 00000002 00000002 00000000
nouveau: ch6: buf 00000004 00000008 00000002 00000002 00000000
nouveau: ch6: buf 00000005 00000008 00000002 00000002 00000000
nouveau: ch6: buf 00000006 0000000a 00000002 00000002 00000000
nouveau: ch6: buf 00000007 00000006 00000004 00000000 00000004
nouveau: ch6: buf 00000008 00000016 00000002 00000000 00000002
nouveau: ch6: buf 00000009 00000016 00000002 00000000 00000002
nouveau: ch6: psh 00000001 00000060a0 0000006230
nouveau: 	0x200203fd
nouveau: 	0x05a00000
nouveau: 	0x0b900000
nouveau: 	0x20090200
Segmentation fault (core dumped)

参考4, 问题是由显卡导致的, 可以尝试以下解决办法:
打开 Software & Update > Additional Drivers
显示卡驱动改为:Using NVIDIA driver metapackage from nvidia-driver-510-server(propietary)
重启生效
在这里插入图片描述

参考

Establishing a Build Environment
使用清华镜像快速下载Android系统源代码
Building Android
Using Android Emulator Virtual Devices
aosp 12 编译后无法启动模拟器问题


  1. 为 Android 模拟器配置硬件加速` ↩︎

  2. 在 Linux 上配置虚拟机加速 ↩︎

  3. Android Emulator(X86) ↩︎

  4. Unable to run Genymotion on Ubuntu 14.04 ↩︎

举报

相关推荐

0 条评论