Trouble getting unmodified AOSP 6.0.0_r26 to boot on Nexus 5X

1,153 views
Skip to first unread message

Hamilton Turner

unread,
Nov 24, 2015, 4:11:26 PM11/24/15
to Android Building
Hi all, 

I did a repo init + sync with the manifest branch android-6.0.0_r26, then a lunch aosp_bullhead-eng. Everything compiled successfully, so I plugged in a brand new Nexus 5X, did the oem unlock, and a fastboot -w flashall. 

The phone hangs on boot at the 'android' logo. It gets far enough for adbd to start, so I can logcat and shell. It appears to be stuck on some part of the initial disk encryption, but there are no obvious errors in the logs - perhaps some of the various init.*.rc files have not been merged together successfully and init is just patiently waiting on some trigger that is never happening. 

As a sanity check I added androidboot.selinux=permissive to the kernel command line and rebuilt. No change. 

Here is all the logcat (from logcat -b all) I get before it hangs (dmesg doesn't show anything else either) - http://sprunge.us/iNTD

Any thoughts would be greatly appreciated!

Best, 
Hamilton





Hamilton Turner

unread,
Nov 27, 2015, 8:38:13 PM11/27/15
to Android Building
Finally resolved this by reflashing the nexus factory image, booting the phone once with the factory image, returning to fastboot and reflashing my AOSP build. It then booted successfully, crazy! I had been flashing the heck out of this phone, seems that at some point something happened to the filesystem that even a fastboot -w flashall was not correcting. 

In retrospect, I suspect it was a bug somewhere in the cryptfs. The log has none of the usual first-boot "cryptfs: Encrypting..." output. I stepped through init.rc and determined that everything was happening correctly up to setting setprop vold.post_fs_data_done from init.bullhead.rc, but there was never another change in the value of vold.decrypt - it appeared to be totally hung. I was actually able to continue the boot in this "broken" state by issuing adb shell setprop vold.decrypt trigger_restart_framework, but naturally this was pretty hacky. If anyone has any analysis of what might have caused this I'd love to know. After the "flash factory image" trick I cannot get the boot to hang again, whatever the issue was it's gone now

Best, 
Hamilton

Will Fairclough

unread,
Nov 27, 2015, 8:38:56 PM11/27/15
to Android Building
Hello Hamilton,

My guess is that when you run flashall it overwrote the vendor partition on the device with all the proprietary binaries. On AOSP development builds for Nexus 5X, 6P and 9 only boot, recovery, and system partitions need to be updated. 

You will want to download the 6.0.0 (MDB08M) factory image for android-6.0.0_r26 from https://developers.google.com/android/nexus/images?hl=en#bullhead and unzip the 

image-bullhead-mdb08m.zip file inside to get at the vendor.img

Then you can reflash the vendor partition:

adb reboot bootloader
fastboot flash vendor vendor
.img
fastboot reboot

You can also add this vendor.img to your source tree and modify the device/lge/bullhead/device.mk to include a line to copy this vendor.img 



PRODUCT_COPY_FILES += device/lge/bullhead/vendor.img:vendor.img


Hope this helps.

Hamilton Turner

unread,
Dec 2, 2015, 10:05:49 AM12/2/15
to Android Building
Thanks, that definitely seems possible. Not sure where I would have gotten a stray vendor.img from, AFAIK compiling just AOSP sources with Android M targeting bullhead will not generate a vendor.img. I've continued to use flashall, and have not experienced this again (and no vendor.img's are being built), but I'd definitely not rule out that one was accidentally built for some odd reason and that caused all the errors. Glad it's done, that was a tricky one!

best,
Hamilton

Paul Moore

unread,
Dec 3, 2015, 2:17:15 PM12/3/15
to Android Building
Hello Will,

I've also just encountered the same problem, however, with the Nexus 6P. I didn't sideload the vendor.img file before running  the "fastboot flashall -w" command, and the phone hangs displaying the Google logo during reboot.
However, I can't reboot to the downloader

adb reboot bootloader
error
: insufficient permissions for device

I can't access the device

adb devices
List of devices attached
????????????    no permissions


I guess I need to add an entry for Nexus 6P (and also for 5X) to the /etc/udev/rules.d/51-android.rules file. For this, I need the idProduct code for these two phones. 

# adb protocol on hammerhead (Nexus 5)
SUBSYSTEM
=="usb", ATTR{idVendor}=="18d1", ATTR{idProduct}=="4ee1", MODE="0600", OWNER="paul"

Where can I find this code?

I've seen some versions of this fileout the idProduct codes. Is this correct?

Many thanks,
Paul

Will Fairclough

unread,
Dec 4, 2015, 1:45:02 PM12/4/15
to Android Building
Hi Paul,

I am not sure where to find the idProduct. This is what my /etc/udev.rules.d/51-android.rules looks like:

#Acer
SUBSYSTEM=="usb", ATTR{idVendor}=="0502", MODE="0664", GROUP="plugdev"
#ASUS
SUBSYSTEM=="usb", ATTR{idVendor}=="0b05", MODE="0664", GROUP="plugdev"
#Dell
SUBSYSTEM=="usb", ATTR{idVendor}=="413c", MODE="0664", GROUP="plugdev"
#Foxconn
SUBSYSTEM=="usb", ATTR{idVendor}=="0489", MODE="0664", GROUP="plugdev"
#Fujitsu & Fujitsu Toshiba
SUBSYSTEM=="usb", ATTR{idVendor}=="04c5", MODE="0664", GROUP="plugdev"
#Garmin-Asus
SUBSYSTEM=="usb", ATTR{idVendor}=="091e", MODE="0664", GROUP="plugdev"
#Google
SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", MODE="0664", GROUP="plugdev"
#Haier
SUBSYSTEM=="usb", ATTR{idVendor}=="201e", MODE="0664", GROUP="plugdev"
#Hisense
SUBSYSTEM=="usb", ATTR{idVendor}=="109b", MODE="0664", GROUP="plugdev"
#HTC
SUBSYSTEM=="usb", ATTR{idVendor}=="0bb4", MODE="0664", GROUP="plugdev"
#Huawei
SUBSYSTEM=="usb", ATTR{idVendor}=="12d1", MODE="0664", GROUP="plugdev"
#K-Touch
SUBSYSTEM=="usb", ATTR{idVendor}=="24e3", MODE="0664", GROUP="plugdev"
#KT Tech
SUBSYSTEM=="usb", ATTR{idVendor}=="2116", MODE="0664", GROUP="plugdev"
#Kyocera
SUBSYSTEM=="usb", ATTR{idVendor}=="0482", MODE="0664", GROUP="plugdev"
#Lenovo
SUBSYSTEM=="usb", ATTR{idVendor}=="17ef", MODE="0664", GROUP="plugdev"
#LG
SUBSYSTEM=="usb", ATTR{idVendor}=="1004", MODE="0664", GROUP="plugdev"
#Motorola
SUBSYSTEM=="usb", ATTR{idVendor}=="22b8", MODE="0664", GROUP="plugdev"
#MTK
SUBSYSTEM=="usb", ATTR{idVendor}=="0e8d", MODE="0664", GROUP="plugdev"
#NEC
SUBSYSTEM=="usb", ATTR{idVendor}=="0409", MODE="0664", GROUP="plugdev"
#Nook
SUBSYSTEM=="usb", ATTR{idVendor}=="2080", MODE="0664", GROUP="plugdev"
#Nvidia
SUBSYSTEM=="usb", ATTR{idVendor}=="0955", MODE="0664", GROUP="plugdev"
#OTGV
SUBSYSTEM=="usb", ATTR{idVendor}=="2257", MODE="0664", GROUP="plugdev"
#Pantech
SUBSYSTEM=="usb", ATTR{idVendor}=="10a9", MODE="0664", GROUP="plugdev"
#Pegatron
SUBSYSTEM=="usb", ATTR{idVendor}=="1d4d", MODE="0664", GROUP="plugdev"
#Philips
SUBSYSTEM=="usb", ATTR{idVendor}=="0471", MODE="0664", GROUP="plugdev"
#PMC-Sierra
SUBSYSTEM=="usb", ATTR{idVendor}=="04da", MODE="0664", GROUP="plugdev"
#Qualcomm
SUBSYSTEM=="usb", ATTR{idVendor}=="05c6", MODE="0664", GROUP="plugdev"
#SK Telesys
SUBSYSTEM=="usb", ATTR{idVendor}=="1f53", MODE="0664", GROUP="plugdev"
#Samsung
SUBSYSTEM=="usb", ATTR{idVendor}=="04e8", MODE="0664", GROUP="plugdev"
#Sharp
SUBSYSTEM=="usb", ATTR{idVendor}=="04dd", MODE="0664", GROUP="plugdev"
#Sony
SUBSYSTEM=="usb", ATTR{idVendor}=="054c", MODE="0664", GROUP="plugdev"
#Sony Ericsson
SUBSYSTEM=="usb", ATTR{idVendor}=="0fce", MODE="0664", GROUP="plugdev"
#Teleepoch
SUBSYSTEM=="usb", ATTR{idVendor}=="2340", MODE="0664", GROUP="plugdev"
#Toshiba
SUBSYSTEM=="usb", ATTR{idVendor}=="0930", MODE="0664", GROUP="plugdev"
#ZTE
SUBSYSTEM=="usb", ATTR{idVendor}=="19d2", MODE="0664", GROUP="plugdev"


This seems to work for my devices, Nexus 4, Nexus 5, Nexus 7, Nexus 5X and One Plus One

Will

Leo You

unread,
Dec 5, 2015, 11:33:08 AM12/5/15
to Android Building
try <lsusb> command on your PC to find out idVendor and idProduct of the usb device.

Paul Moore

unread,
Dec 7, 2015, 9:56:19 AM12/7/15
to Android Building
Thanks Leo, that worked.

Benton

unread,
Jan 18, 2016, 12:38:37 PM1/18/16
to Android Building
Hi I was wondering if you could help me with building AOSP.  I've been building it from the Google source, which builds successfully, but then when I load my images, and then the corresponding factory vendor image, my BT never works.  I'm kinda running out of ideas.  I've been building for MMB29K, and I was wondering if there was anything special you did to get the hardware to fully functioning?  Thanks!


On Tuesday, November 24, 2015 at 4:11:26 PM UTC-5, Hamilton Turner wrote:

eddyxd

unread,
Feb 2, 2016, 1:22:08 PM2/2/16
to Android Building
Hi, all,

I got the exact same issue, but flashing vender.img does't help? Is there any way we can get those proprietary binaries for Nexus5x/6p?



Yu-Chih


On Tuesday, November 24, 2015 at 4:11:26 PM UTC-5, Hamilton Turner wrote:

bechts...@gmail.com

unread,
Feb 2, 2016, 2:27:21 PM2/2/16
to Android Building
Information here summarizes the problem and provides an automation solution for Nexus 5x AOSP builds.

Everyone's hope is that Google revises the vendor blobs distribution policy for new Nexus devices.

eddyxd

unread,
Feb 2, 2016, 3:31:21 PM2/2/16
to Android Building
Got it. Thanks! Feel frustrated. I thought it might be easier to develop system by using Google's Nexus device, so I buy 6p and 5x but it turns out is not true........

vincent dang

unread,
Jun 30, 2016, 5:40:15 PM6/30/16
to Android Building
Hi all,
I'm having the same problem with my Nexus 6p that after flashing my AOSP aosp_angler-userdebug build images (boot.img, recovery.img, system.img), the phone displays "Your device is corrupt." and hangs displaying the Google logo during reboot. The phone can be reflashed with latest factory angler-mtc19v and recovers, but fails with AOSP aosp_angler-userdebug build. I've also tried to reflash the vendor.img from factory but it doesn't help. Has anyone had success with AOSP angler build, or known what the problem is? Thanks.



On Thursday, December 3, 2015 at 11:17:15 AM UTC-8, Paul Moore wrote:

Alex Mayle

unread,
Jul 1, 2016, 1:32:48 PM7/1/16
to android-...@googlegroups.com
In my experience, it will hang if you do not use the -w flag with flashall. (For the first time, at least). 

However this error message you are getting was also present when my Bluetooth and telephony wasn't working. Read my previous post for a fix. It links to a thread that will have all your answers and contains a repo with an automated solution. 

Sent from my iPhone
--
--
You received this message because you are subscribed to the "Android Building" mailing list.
To post to this group, send email to android-...@googlegroups.com
To unsubscribe from this group, send email to
android-buildi...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-building?hl=en

---
You received this message because you are subscribed to the Google Groups "Android Building" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-buildi...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Yiannis Cheung

unread,
Jul 10, 2016, 5:12:47 PM7/10/16
to Android Building

Hi Vincent,

I am facing the same issue, have you fixed this flash problem?
Reply all
Reply to author
Forward
0 new messages