Flashing stock Android - sailfishos-sony-nagara/main GitHub Wiki
To avoid hard-bricking the device while flashing the phone, we need to make sure that the latest version is on the both slots. Otherwise, hard bricking can happen as in https://github.com/sonyxperiadev/bug_tracker/issues/824 .
To get Stock ROMs, install XperiaFirm. See instructions at https://xperifirm.com :
-
install Mono: emerge -av dev-lang/mono
-
download executable at https://xperifirm.com
With obtained image, this has to be flashed into the both slots with newflasher. When having active slot B and flashing only on that, Xperia entered bootloop (showed SONY and then rebooted). For flashing:
-
compile newflasher from sources (Linux) or get executable (not sure if they are available).
-
enter a folder with downloaded ROM
-
Connect the device in flash mode (switch it off; keep VolumeDown and connect to USB).
-
Make sure you have USB2 connection. For example, find device using
lsusb
and check it withlsusb -d 0fce:b00b
(replace with your ID) and look forbcdUSB
. For USB2 it would start with 2. In my case, its 2.1. -
AS ROOT: start newflasher by pointing to its location as in ~user/code/sailfish/port/nagara/newflasher/newflasher
-
On first start, agree to dump TA. newflasher will exit after that dump
-
Move TA data into some safe backuped place
-
AS ROOT: Start newflasher again in the folder with ROM
-
Proceed with flashing while selecting to power off the device. At the end of flash, my device stayed on in flash mode
-
After a flash, note the active slot. Switch a slot (from a->b or b->a) while keeping device connected:
fastboot --set-active=a/b
-
AS ROOT: Start newflasher again in the folder with ROM
-
In my case, I stayed on slot a and I would recommend to switch to it.
-
Unplug the device, wait couple of seconds and boot by pressing power button
How to get out of bootloop:
- While device shows SONY, hold on to VolumeUp and plugin to PC. Wait till reboot while keeping VolumeUp. You should enter fastboot. Then you could unplug the device to power it off or proceed with fastboot. If powering off, you could get into flash mode as usual.