Run Android Emulator with custom build kernel

360 views
Skip to first unread message

Юрий Шабалин

unread,
Nov 7, 2017, 10:57:48 AM11/7/17
to Android Building

I try to run android emulator with custom build kernel. The steps for build kernel:


git clone https://android.googlesource.com/kernel/goldfish/ -b android-goldfish-3.18
git clone https://android.googlesource.com/platform/prebuilts/gcc/linux-x86/x86/x86_64-linux-android-4.9
cd goldfish
export CROSS_COMPILE=x86_64-linux-android-
export ARCH=x86_64
export PATH=$PATH:/path/to/x86_64-linux-android-4.9/bin
make x86_64_ranchu_defconfig
make -j4

Then, when I try to run emulator with this image: 


     emulator -avd Nexus_5_API_24 -kernel /path/to/goldfish/arch/x86/boot/bzImage -show-kernel

Emulator window starts, I see "Android" logo, but nothing else happens. It is bootloop and in console I see this message again and again:


[   22.396836] init: Starting service 'netd'... 
[   22.397460] init: Starting service 'media'... 
[   22.397919] init: Starting service 'zygote'... 
[   22.808059] zygote[2021]: segfault at bf833000 ip afba292a sp bf8528f0 error 4 in libart.so[af66d000+745000] 
[   22.809470] init: Service 'zygote' (pid 2021) killed by signal 11 
[   22.809940] init: Service 'zygote' (pid 2021) killing any children in process group 
[   22.810545] init: write_file: Unable to open '/sys/android_power/request_state': No such file or directory 
[   22.811288] init: write_file: Unable to write to '/sys/power/state': Invalid argument 
[   22.811881] init: Service 'media' is being killed... 
[   22.812608] init: Service 'netd' is being killed... 
[   22.813030] init: Service 'media' (pid 2020) killed by signal 9 
[   22.813482] init: Service 'media' (pid 2020) killing any children in process group 
[   22.814085] init: Service 'netd' (pid 2019) killed by signal 9 
[   22.814533] init: Service 'netd' (pid 2019) killing any children in process group 
[   22.815129] init: Untracked pid 2129 killed by signal 9


I found some answer here: https://gist.github.com/yan12125/78a9004acb1bed5faf2ffd442163e2ef

But I don`t want and can`t build ASOP and add fix to thread.cc, because I need only custom kernel and official images from Google.

How I can build kernel to avoid this error or, maybe, it is some option when run emulator?


P.S. I also tried another branches for goldfish (android-goldfish-3.10), but with the same result.

Thank you for your answers!

Reply all
Reply to author
Forward
0 new messages