Xperia XZ2 Compact can't boot after recovery flash

Hi everyone.
I had a Sony Xperia XZ2 Compact on which I had installed /e/OS. Everything went smoothly and everything worked well. Unfortunately this phone was broken and… I bought another Xperia XZ2 Compact because I loved it so much.

I started the installation process just as usual. I unlocked the bootloader. Then I flashed the recovery image as said, using fastboot flash boot recovery-e-1.17-t-20231113351094-dev-xz2c.img. The resulting output was:

Warning: skip copying boot_a image avb footer (boot_a partition size: 0, boot_a image size: 67108864).
Sending 'boot_a' (65536 KB)                        OKAY [  1.549s]
Writing 'boot_a'                                   OKAY [  0.611s]
Finished. Total time: 2.167s

Then I tried to boot on the recovery… and nothing. The phone is stuck on the SONY logo. Can’t boot either on the recovery, or on Android directly. Tried multiple times, nothing changed. I really don’t know what went wrong. I can still access fastboot. Here is the result of fastboot getvar all:

$ fastboot getvar all
(bootloader) unlocked:yes
(bootloader) off-mode-charge:0
(bootloader) charger-screen-enabled:0
(bootloader) battery-soc-ok:yes
(bootloader) battery-voltage:4266
(bootloader) version-baseband:1311-7916_51.1.A.2.183
(bootloader) version-bootloader:1310-7079_X_Boot_SDM845_LA1.0_O_51-A
(bootloader) variant:SDM UFS
(bootloader) partition-type:userdata:ext4
(bootloader) partition-size:userdata: 0xBFA96C000
(bootloader) partition-type:system_a:ext4
(bootloader) partition-size:system_a: 0xFC000000
(bootloader) has-slot:modem:yes
(bootloader) has-slot:system:yes
(bootloader) current-slot:a
(bootloader) has-slot:boot:yes
(bootloader) slot-retry-count:b:0
(bootloader) slot-unbootable:b:no
(bootloader) slot-successful:b:no
(bootloader) slot-retry-count:a:4
(bootloader) slot-unbootable:a:no
(bootloader) slot-successful:a:no
(bootloader) slot-count:2
(bootloader) secure:no
(bootloader) serialno:BH902F3JBZ
(bootloader) serial:faccb004
(bootloader) product:H8314
(bootloader) max-download-size:536870912
(bootloader) kernel:uefi
all: 
Finished. Total time: 0.003s

What is happening ? I only see two things that I’ve might done wrong:

  • After having flashed the recovery, the guide ask to power down the phone, and then boot on it using the Power+Vol down combination. Instead, I just did fastboot reboot recovery. Is this a big deal ?
  • I saw that at the beginning of the guide, there is this advice : Before following these instructions please ensure that the device is on the latest Android 10 firmware.. I have to admit I have not done this, the original Android was 8 if I remember correctly… Might this be the source of the problem ?

Also, I tried doing fastboot boot recovery-e-1.12.3-s-20230617300623-dev-xz2c.img. The screen gets black for ~15 seconds, then go back to the SONY logo.

Could you help me ? Thanks.

Problem solved. Learned a lot about A/B partitioning in order to get out of this situation. I think I corrupted the OS by updating from Android 8 to Android 13 with only one install.

So my A slot was corrupted because of me. My B slot could not boot either, I don’t know why. I switched to the B slot. I downloaded an official Sony firmware using Xperifirm. Then, using Newflasher, I flashed all the B partitions with the official firmware from Sony. My phone could then boot on the B slot, leading to a stock Android 10. I checked the available updates in order to make sure I had an updated Android 10, as said in the installation guide. Then I installed the recovery exactly as said in the guide. I made sure to follow the instructions in the «Ensuring all firmware partitions are consistent», which was necessary because, remember, my A slot was corrupted because of me. This allowed me to get a valid A slot, just like the B slot. And then, from here, I just followed the rest of the guide as usual. My /e/OS is now working.

1 Like

Hello

Glad you sorted that out. I saw your post yesterday but couldn’t answer to you. I wanted to tell you to copy the partitions as requested ( Ensuring all firmware partitions are consistent from https://doc.e.foundation/devices/xz2c/install ).
My XZ2C is on slot a and my XZ2 premium is on slot b.
If you have found a very good link with explanations for A/B partitions please share it.

Sure ! My main source of information on A/B slots is this article on XDA. Reading it thoroughly gives you a good knowledge of how all this works.

However there is just one information that is not (anymore ?) correct :

To install a custom recovery on A/B devices, we thus need to modify the boot partition and replace the stock recovery with our own. This is why to install TWRP you need to use a fastboot command to boot a custom boot image first and then flash the TWRP installation script, as fastboot can’t patch partitions—only flash over them entirely.

I don’t know why but the /e/OS guide doesn’t actually tell you to temporarily boot on recovery (with fastboot boot [...]), but rather to flash the boot section, as usual (with fastboot flash boot [...]).

Thanks for the link.

This topic was automatically closed after 60 days. New replies are no longer allowed.