answered
2020-06-08 17:31:28 +0200
Howto restore encrypted Sailfish from WSOD (works on Xperia X and XA2)
This howto describes the steps needed to restore the functionality of encrypted phone which does not boot properly anymore (could be also useful for people who want to enable encryption but don't want to set up the phone all over again).
Create Backup tars in recovery mode
- Download install images from Jolla, unpack them, go to the unpacked folder. Get firmware from Sony, place it in the same folder.
Enter recovery mode:
- shut down the phone
press Volume Up and plug in USB Cable, when the LED turns blue execute:
fastboot boot hybris-recovery.img
when recovery has finished booting execute:
telnet 10.42.66.66
You may either select Shell or SSH Server, enter device's PIN when prompted.
cryptsetup luksOpen /dev/mapper/sailfish-home home
[Enter Password]
I have Sdcard encrypted, if you don't then simply mount it, otherwise:
cryptsetup luksOpen /dev/mmcblk1p1 sdcard
[Enter Password]
Mount the devices, root is already mounted on /rootfs
mkdir /mnt/home
mkdir /mnt/sdcard
mount /dev/mapper/home /mnt/home/
mount /dev/mapper/sdcard /mnt/sdcard/
Create Backups:
cd /rootfs/
tar -cvpf /mnt/sdcard/root.tar .
cd /mnt/home/
tar -cvpf /mnt/sdcard/home.tar .
Unmount and exit the shell:
cd
umount /mnt/home
umount /mnt/sdcard
cryptsetup luksClose home
cryptsetup luksClose sdcard
exit
Reboot, you may want to kill telnet afterwards.
Reflash the phone:
enable fastboot again and flash Sailfish anew:
./flash.sh
On the phone do the following (otherwise weird behaviour may occur):
- Set up Jolla Account (if previously set up)
- Install Alien Dalvik (if previously installed)
- Enable Developer mode (if previously enabled)
Repeat the steps needed to go to Recovery again, telnet to the phone and go to the shell
cryptsetup luksOpen /dev/mapper/sailfish-home home
[Enter Password]
cryptsetup luksOpen /dev/mmcblk1p1 sdcard
[Enter Password]
mkdir /mnt/home
mkdir /mnt/sdcard
mount /dev/mapper/home /mnt/home/
mount /dev/mapper/sdcard /mnt/sdcard/
tar -xvpf /mnt/sdcard/home.tar -C /mnt/home/
tar -xvpf /mnt/sdcard/root.tar ./usr -C /rootfs
tar -xvpf /mnt/sdcard/root.tar ./var -C /rootfs
tar -xvpf /mnt/sdcard/root.tar ./etc/zypp -C /rootfs/ #if you use Storeman
tar -xvpf /mnt/sdcard/root.tar ./etc/ssu -C /rootfs/ #if you use Storeman
tar -xvpf /mnt/sdcard/root.tar ./etc/crypto-sdcard -C /rootfs/ #if you use crypto-sdcard to automatically mount encrypted SDCard
cd
umount /mnt/home
umount /mnt/sdcard
cryptsetup luksClose home
cryptsetup luksClose sdcard
exit
Reboot. You may be required to re-login into your Jolla account.
IMPORTANT! Reinstall crypto-sdcard to re-enable automatic mount of encrypted SDCard
There. Your phone should work again.
Feel free to comment if I have missed something.
Sometimes a hard reset is helpfull. On Xperias push On/Off button togeter with volume + if you stay in the white screen. Push both buttons until phone start again.
4carlos ( 2020-06-02 18:53:51 +0200 )editDoesn't help in my case, sadly.
What does it mean when the LED is purpl-ish during WSOD?
erikderzweite ( 2020-06-02 22:57:12 +0200 )editI do have Defender on both devices and yes, I surely have installed some apps via Storeman from openrepos. Just tested by re-installing the Defender and rebooting: WSOD. Removed the defender via Recovery: boots again!
erikderzweite ( 2020-06-10 16:36:03 +0200 )edit