Search code examples
androidandroid-sourcefastbootgoogle-pixelflashing

Pixel 4a Android 11 Sunfish custom build "no valid slot to boot" error after flashing


I built AOSP Android 11 Sunfish by my self and try to flash out images using fastboot into the phone. The entire build and flashing process is done successfully, however, after flashing is done, the device is stuck in fastboot page of Pixel 4a and publishes an error "Enter reason: no valid slot to boot".

Note that I have reexamined the entire flashing process using a factory standard build from the official Android project website, and everything goes well with that and the device starts to work without any error.

During all flashing process, the device works well and autonomously boots into the fastboot mode to flash the product directory into the right place. After the final round of boot, the Google logo appears and then, the device runs into an error described earlier. The entire flashing log is as follows:

fastboot flashall -w
--------------------------------------------
Bootloader Version...: s5-0.3-6835615
Baseband Version.....: g7150-00023-201008-B-6891498
Serial Number........: *****************
--------------------------------------------
Checking 'product'                                 OKAY [  0.069s]
Setting current slot to 'a'                        OKAY [  0.151s]
Sending 'boot_a' (65536 KB)                        OKAY [  2.490s]
Writing 'boot_a'                                   OKAY [  0.299s]
Sending 'dtbo_a' (8192 KB)                         OKAY [  0.420s]
Writing 'dtbo_a'                                   OKAY [  0.094s]
Sending 'vbmeta_a' (4 KB)                          OKAY [  0.140s]
Writing 'vbmeta_a'                                 OKAY [  0.077s]
Sending 'vbmeta_system_a' (4 KB)                   OKAY [  0.140s]
Writing 'vbmeta_system_a'                          OKAY [  0.077s]
Rebooting into fastboot                            OKAY [  0.070s]
< waiting for any device >
Sending 'super' (4 KB)                             OKAY [  0.008s]
Updating super partition                           OKAY [  0.011s]
Resizing 'product_a'                               OKAY [  0.006s]
Resizing 'system_a'                                OKAY [  0.006s]
Resizing 'system_ext_a'                            OKAY [  0.006s]
Resizing 'system_b'                                OKAY [  0.004s]
Resizing 'product_a'                               OKAY [  0.007s]
Sending 'product_a' (232200 KB)                    OKAY [  6.720s]
Writing 'product_a'                                OKAY [  1.841s]
Resizing 'system_a'                                OKAY [  0.005s]
Sending sparse 'system_a' 1/4 (262140 KB)          OKAY [  7.693s]
Writing 'system_a'                                 OKAY [  1.962s]
Sending sparse 'system_a' 2/4 (262140 KB)          OKAY [  7.645s]
Writing 'system_a'                                 OKAY [  0.941s]
Sending sparse 'system_a' 3/4 (262140 KB)          OKAY [  7.741s]
Writing 'system_a'                                 OKAY [  0.909s]
Sending sparse 'system_a' 4/4 (72052 KB)           OKAY [  2.165s]
Writing 'system_a'                                 OKAY [  0.315s]
Resizing 'system_ext_a'                            OKAY [  0.006s]
Sending 'system_ext_a' (108124 KB)                 OKAY [  3.240s]
Writing 'system_ext_a'                             OKAY [  1.443s]
Resizing 'system_b'                                OKAY [  0.005s]
Sending 'system_b' (60 KB)                         OKAY [  0.002s]
Writing 'system_b'                                 OKAY [  0.022s]
Erasing 'userdata'                                 OKAY [  8.433s]
Erase successful, but not automatically formatting.
File system type raw not supported.
Erasing 'metadata'                                 OKAY [  0.013s]
Erase successful, but not automatically formatting.
File system type raw not supported.
Rebooting                                          OKAY [  0.000s]
Finished. Total time: 72.623s

Also, the output of getvar command is as follows after flashing:

    enter codfastboot getvar all
(bootloader) product:sunfish
(bootloader) serialno:*****************
(bootloader) variant:SM7 UFS
(bootloader) max-download-size:0x10000000
(bootloader) slot-suffixes:_a,_b
(bootloader) version-bootloader:s5-0.3-6835615
(bootloader) version-baseband:g7150-00023-201008-B-6891498
(bootloader) secure-boot:PRODUCTION
(bootloader) secure:yes
(bootloader) hw-revision:MP1.0
(bootloader) is-userspace:no
(bootloader) slot-count:2
(bootloader) current-slot:a
(bootloader) unlocked:yes
(bootloader) nos-production:yes
(bootloader) off-mode-charge:1
(bootloader) slot-retry-count:a:0
(bootloader) slot-unbootable:a:no
(bootloader) slot-successful:a:no
(bootloader) slot-retry-count:b:0
(bootloader) slot-unbootable:b:yes
(bootloader) slot-successful:b:no
(bootloader) battery-voltage:4455
(bootloader) battery-soc-ok:yes
(bootloader) snapshot-update-status:none
(bootloader) storage-vendor:MICRON
(bootloader) storage-model:MT128GASAO4U21
(bootloader) storage-rev:0302
(bootloader) citadel-fw:0.0.3/brick_v0.0.8232-b1e3ea340 2020-09-25 16:57:
(bootloader) auto-shutdown:0
(bootloader) partition-type:ssd:raw
(bootloader) partition-size:ssd:0x2000
(bootloader) partition-type:persist:raw
(bootloader) partition-size:persist:0x2000000
(bootloader) partition-type:misc:raw
(bootloader) partition-size:misc:0x100000
(bootloader) partition-type:keystore:raw
(bootloader) partition-size:keystore:0x80000
(bootloader) partition-type:frp:raw
(bootloader) partition-size:frp:0x80000
(bootloader) partition-type:boot_a:raw
(bootloader) partition-size:boot_a:0x4000000
(bootloader) partition-type:boot_b:raw
(bootloader) partition-size:boot_b:0x4000000
(bootloader) partition-type:modem_a:raw
(bootloader) partition-size:modem_a:0x6000000
(bootloader) partition-type:modem_b:raw
(bootloader) partition-size:modem_b:0x6000000
(bootloader) partition-type:klog:raw
(bootloader) partition-size:klog:0x800000
(bootloader) partition-type:metadata:raw
(bootloader) partition-size:metadata:0x1000000
(bootloader) partition-type:vbmeta_system_a:raw
(bootloader) partition-size:vbmeta_system_a:0x10000
(bootloader) partition-type:vbmeta_system_b:raw
(bootloader) partition-size:vbmeta_system_b:0x10000
(bootloader) partition-type:super:raw
(bootloader) partition-size:super:0x245800000
(bootloader) partition-type:userdata:raw
(bootloader) partition-size:userdata:0x1B65FFB000
(bootloader) partition-type:xbl_a:raw
(bootloader) partition-size:xbl_a:0x380000
(bootloader) partition-type:xbl_config_a:raw
(bootloader) partition-size:xbl_config_a:0x20000
(bootloader) partition-type:xbl_b:raw
(bootloader) partition-size:xbl_b:0x380000
(bootloader) partition-type:xbl_config_b:raw
(bootloader) partition-size:xbl_config_b:0x20000
(bootloader) partition-type:ALIGN_TO_128K_1:raw
(bootloader) partition-size:ALIGN_TO_128K_1:0x1A000
(bootloader) partition-type:cdt:raw
(bootloader) partition-size:cdt:0x20000
(bootloader) partition-type:cdt_backup:raw
(bootloader) partition-size:cdt_backup:0x20000
(bootloader) partition-type:ddr:raw
(bootloader) partition-size:ddr:0x100000
(bootloader) partition-type:aop_a:raw
(bootloader) partition-size:aop_a:0x80000
(bootloader) partition-type:tz_a:raw
(bootloader) partition-size:tz_a:0x400000
(bootloader) partition-type:hyp_a:raw
(bootloader) partition-size:hyp_a:0x84000
(bootloader) partition-type:abl_a:raw
(bootloader) partition-size:abl_a:0x200000
(bootloader) partition-type:keymaster_a:raw
(bootloader) partition-size:keymaster_a:0x80000
(bootloader) partition-type:cmnlib_a:raw
(bootloader) partition-size:cmnlib_a:0x80000
(bootloader) partition-type:cmnlib64_a:raw
(bootloader) partition-size:cmnlib64_a:0x80000
(bootloader) partition-type:devcfg_a:raw
(bootloader) partition-size:devcfg_a:0x20000
(bootloader) partition-type:qupfw_a:raw
(bootloader) partition-size:qupfw_a:0x14000
(bootloader) partition-type:vbmeta_a:raw
(bootloader) partition-size:vbmeta_a:0x10000
(bootloader) partition-type:dtbo_a:raw
(bootloader) partition-size:dtbo_a:0x800000
(bootloader) partition-type:uefisecapp_a:raw
(bootloader) partition-size:uefisecapp_a:0x200000
(bootloader) partition-type:imagefv_a:raw
(bootloader) partition-size:imagefv_a:0x200000
(bootloader) partition-type:apdp_a:raw
(bootloader) partition-size:apdp_a:0x10000
(bootloader) partition-type:msadp_a:raw
(bootloader) partition-size:msadp_a:0x10000
(bootloader) partition-type:aop_b:raw
(bootloader) partition-size:aop_b:0x80000
(bootloader) partition-type:tz_b:raw
(bootloader) partition-size:tz_b:0x400000
(bootloader) partition-type:hyp_b:raw
(bootloader) partition-size:hyp_b:0x84000
(bootloader) partition-type:abl_b:raw
(bootloader) partition-size:abl_b:0x200000
(bootloader) partition-type:keymaster_b:raw
(bootloader) partition-size:keymaster_b:0x80000
(bootloader) partition-type:cmnlib_b:raw
(bootloader) partition-size:cmnlib_b:0x80000
(bootloader) partition-type:cmnlib64_b:raw
(bootloader) partition-size:cmnlib64_b:0x80000
(bootloader) partition-type:devcfg_b:raw
(bootloader) partition-size:devcfg_b:0x20000
(bootloader) partition-type:qupfw_b:raw
(bootloader) partition-size:qupfw_b:0x14000
(bootloader) partition-type:vbmeta_b:raw
(bootloader) partition-size:vbmeta_b:0x10000
(bootloader) partition-type:dtbo_b:raw
(bootloader) partition-size:dtbo_b:0x800000
(bootloader) partition-type:uefisecapp_b:raw
(bootloader) partition-size:uefisecapp_b:0x200000
(bootloader) partition-type:imagefv_b:raw
(bootloader) partition-size:imagefv_b:0x200000
(bootloader) partition-type:apdp_b:raw
(bootloader) partition-size:apdp_b:0x10000
(bootloader) partition-type:msadp_b:raw
(bootloader) partition-size:msadp_b:0x10000
(bootloader) partition-type:devinfo:raw
(bootloader) partition-size:devinfo:0x1000
(bootloader) partition-type:spunvm:raw
(bootloader) partition-size:spunvm:0x800000
(bootloader) partition-type:splash:raw
(bootloader) partition-size:splash:0x8000
(bootloader) partition-type:limits:raw
(bootloader) partition-size:limits:0x1000
(bootloader) partition-type:toolsfv:raw
(bootloader) partition-size:toolsfv:0x100000
(bootloader) partition-type:logfs:raw
(bootloader) partition-size:logfs:0x800000
(bootloader) partition-type:storsec:raw
(bootloader) partition-size:storsec:0x20000
(bootloader) partition-type:uefivarstore:raw
(bootloader) partition-size:uefivarstore:0x80000
(bootloader) partition-type:secdata:raw
(bootloader) partition-size:secdata:0x7000
(bootloader) partition-type:ALIGN_TO_128K_2:raw
(bootloader) partition-size:ALIGN_TO_128K_2:0x1A000
(bootloader) partition-type:modemst1:raw
(bootloader) partition-size:modemst1:0x200000
(bootloader) partition-type:modemst2:raw
(bootloader) partition-size:modemst2:0x200000
(bootloader) partition-type:fsg:raw
(bootloader) partition-size:fsg:0x200000
(bootloader) partition-type:fsc:raw
(bootloader) partition-size:fsc:0x20000
(bootloader) partition-type:system_a:raw
(bootloader) partition-size:system_a:0x3491C000
(bootloader) partition-type:system_b:raw
(bootloader) partition-size:system_b:0x55000
(bootloader) partition-type:product_a:raw
(bootloader) partition-size:product_a:0xE38A000
(bootloader) partition-type:product_b:raw
(bootloader) partition-size:product_b:0x0
(bootloader) partition-type:system_ext_a:raw
(bootloader) partition-size:system_ext_a:0x69FC000
(bootloader) partition-type:system_ext_b:raw
(bootloader) partition-size:system_ext_b:0x0
all: 
Finished. Total time: 0.104s

My device is unlocked, and all standard process of flashing is done. Maybe the problem is with my out structure. So, the following image files are built after compiling aosp_sunfish-userdebug lunch: enter image description here

My phone state after flashing: enter image description here

Please help me on how I can flash my custom sunfish build into the Pixel 4a phone. I tried every popular solutions in stackoverflow and XDA. If extra information is needed, please let me know.


Solution

  • Finally, I found out that the problem is with missing vendor image. I should have downloaded the Qualcomm drivers of Pixel-4a and its official vendor image from here: https://developers.google.com/android/drivers

    After this, I could extract all of these into a vendor folder, and placed it into the root of my AOSP WORKING_DIRECTORY. Then, I rebuilt the sunfish project, and a few new images were created including the vendor image.

    I could re-flash the entire out images into the Pixel-4a phone without any error using fastboot flashall -w command. Now, everything seems to be in order, and my custom AOSP project works properly on my Pixel-4a phone.

    The new situation of my out sunfish directory is as follows: enter image description here