Bootloop after building
Bargest opened this issue · comments
Hello,
I've built according to https://github.com/robherring/generic_device/wiki/Building
The artifacts are:
android-8.1.0, linaro_arm64-userdebug, kernel Linux/arm64 4.14.0-rc4, qemu 2.12.
While building I've got a warning:
external/libdrm/libkms/Android.mk:19: warning: invalid GPU drivers: freedreno
But the build finished successfully.
Then I'm trying to launch it using this cmd line:
~/qemu/aarch64-softmmu/qemu-system-aarch64 \
-cpu cortex-a57 -machine type=virt \
-append "console=ttyAMA0,38400 init=/init rootwait drm.rnodes=1 vt.global_cursor_default=0 androidboot.selinux=permissive debug drm.debug=1 qemu=1" \
-m 1024 \
-serial mon:stdio \
-kernel ~/linux-build/linux/arch/arm64/boot/Image \
-initrd ~/android-8/out/target/product/linaro_arm64/ramdisk.img \
-drive index=0,if=none,id=system,file=system.img,format=raw \
-device virtio-blk-pci,drive=system \
-drive index=1,if=none,id=cache,file=cache.img,format=raw \
-device virtio-blk-pci,drive=cache \
-drive index=2,if=none,id=userdata,file=userdata.img,format=raw \
-device virtio-blk-pci,drive=userdata \
-drive index=3,if=none,id=vendor,file=vendor.img,format=raw \
-device virtio-blk-pci,drive=vendor \
-netdev user,id=mynet,hostfwd=tcp::5555-:5555 \
-device virtio-net-pci,netdev=mynet \
-device virtio-keyboard-pci \
-d guest_errors \
-device VGA -display gtk
$*
Android starts booting, but there is nothing on screen. After some time I'm getting a loop in console: android starts services, then hwcomposer-2-1 is killed and it brings down the whole system, making it to kill and restart all other services. The log can be found here.
I've spent weeks trying to understand what is going on, but found nothing.
Could you suggest how this can be fixed?
Software rendering doesn't work anymore due to changes in AOSP (SurfaceFlinger requires GLES2.0 now).
Thank you for a quick reply.
I've rebuilt android, ensuring that "[ ] Force Software rendering" is unset, and tried 2 versions
HWComposer support (DRM HWComposer)
HWComposer support (Gralloc support for Mali)
in menuconfig.
Also I switched to hardware rendering, modifying the command line:
~/qemu/aarch64-softmmu/qemu-system-aarch64 \
-cpu cortex-a57 -machine type=virt \
-append "console=ttyAMA0,38400 init=/init rootwait drm.rnodes=1 vt.global_cursor_default=0 androidboot.selinux=permissive debug drm.debug=1" \
-m 1024 \
-serial mon:stdio \
-kernel ~/linux-build/linux/arch/arm64/boot/Image \
-initrd ~/android-8/out/target/product/linaro_arm64/ramdisk.img \
-drive index=0,if=none,id=system,file=system.img,format=raw \
-device virtio-blk-pci,drive=system \
-drive index=1,if=none,id=cache,file=cache.img,format=raw \
-device virtio-blk-pci,drive=cache \
-drive index=2,if=none,id=userdata,file=userdata.img,format=raw \
-device virtio-blk-pci,drive=userdata \
-drive index=3,if=none,id=vendor,file=vendor.img,format=raw \
-device virtio-blk-pci,drive=vendor \
-netdev user,id=mynet,hostfwd=tcp::5555-:5555 \
-device virtio-net-pci,netdev=mynet \
-device virtio-keyboard-pci \
-d guest_errors \
-nodefaults \
-device virtio-gpu-pci,virgl -display gtk,gl=on
$*
However, the log is practically the same in both cases of HWComposer. I've updated the gist in the first post.
What else can cause this error?
I've also found this in logcat:
07-18 17:49:06.647 1777 1777 D vndksupport: Loading /vendor/lib/hw/android.hardware.audio@2.0-impl.so from current namespace instead of sphal namespace.
07-18 17:49:06.664 1781 1781 D vndksupport: Loading /vendor/lib64/hw/android.hardware.graphics.allocator@2.0-impl.so from current namespace instead of sphal namespace.
07-18 17:49:06.808 1780 1780 D vndksupport: Loading /vendor/lib/hw/android.hardware.drm@1.0-impl.so from current namespace instead of sphal namespace.
07-18 17:49:07.178 1781 1781 D vndksupport: Loading /vendor/lib64/hw/gralloc.gbm.so from current namespace instead of sphal namespace.
07-18 17:49:07.565 1781 1781 E GRALLOC-GBM: failed to open /dev/dri/renderD128
07-18 17:49:07.567 1781 1781 F Gralloc0Allocator: failed to open gralloc0 device: Invalid argument
Seems that gralloc cannot find the device. After some research I've found out that kernel build was resetting CONFIG_DRM_VIRTIO_GPU=y to CONFIG_DRM_VIRTIO_GPU=m. Fixed this.
But now android stucks on boot logo, at logcat I can see that system_server crashes with message
Abort message: 'Device claims wide gamut support, cannot find matching config, error = EGL_SUCCESS'
and
07-18 20:33:47.655 1833 1833 W hwc-gl-worker: EGL_ANDROID_native_fence_sync extension not supported
07-18 20:33:47.945 1833 1833 E libEGL : validate_display:92 error 3008 (EGL_BAD_DISPLAY)
07-18 20:33:47.946 1833 1833 E hwc-gl-worker: EndContext failed: EGL_BAD_DISPLAY
Also system_server periodically crashes with just SIGSEGV.
What this could be related to?