answered
2018-09-03 19:17:01 +0200
Reason :
The howto was written to a Sailfish X-running Xperia X.
Your Xperia X was running Android, so in addition to your installation (that you carefully backed up), there are other bits that needs to be switch back from Android to Sailfish X.
Namely :
Kernel problem
Sailfish X uses a slightly older kernel (3.10.84) than Android with several different options and drivers compiled in (Sailfish X has the BTRFS compiled in).
Drivers problem
Beware that the current android version on Sony Xperia uses much newer drivers than Sailfish.
Sony has currently Android 7.1 Nougat and 8.0 Oreo available for Xperia X, you probably ran one of these.
Sailfish X, according to the install isntructions still uses older drivers from AOSP 6.0.1 Marshmallow.
Fixing the problems
Simple fix
The simplest fix would be to first download a Sailfish X installer for the same version as the one you took your backup with (best to download it from Jolla on the same moment you make the backup to be sure to have the right version).
Then reflash the device using the regular procedure, including the part where you download the Sony binary drivers.
Once the reflashing is finished, you have a nearly-empty (i.e.: in factory state) partition /dev/mmcblk0p51
. You can now use the howto to over-write the default nearly-emptry system with your own backup.
Fixing from the command line
Using a laptop to only reflash the part you need is easier (because fastboot
know which partition hold what).
You need to to (assuming you are into the directory with all necessary images : SailfishX, Sony's blob, your backup) :
Flash the kernel, so you boot with Sailfish X's linux kernel (3.10.84, with BTRFS and other Sailfish bits) instead of Android's (3.10.108, with various android bits) :
fastboot flash boot hybris-boot.img
Optionnally flash the recovery, so you have Sailfish' instead of TWRP or whatever you did use on Android :
fastboot flash recovery hybris-recovery.img
(At this point, it's now possible to boot into sailfish recovery with the button press trick instead of needing to upload it through fastboot boot
)
Flash the Sony blob:
fastboot flash oem SW_binaries_for_Xperia_AOSP_M_MR1_3.10_v13_loire.img
(At this point your Xperia is now able to boot into Sailfish X again)
Flash your backup :
gzip -d -k backup.img.gz
fastboot flash userdata backup.img
(At this point your Xperia should work as before)
Flash the factory reset back up partition :
fastboot flash system fimage.img001
(At this point your Xperia is exactly as before your Android tests)
Now you can safely reboot, your Xperia X should work just like before the switch to Android.
From within Sailfish recovery
It's possible but you need to pay special attention to be sure that you're overwriting the right partition.
DISCLAIMER: I haven't fully check this one method, proceed with care. Don't blame me if you brick your smartphone.
Assuming you have mounted the SD card, and are in the directory with all the img files (Sailfish X, Sony blob, compressed backup).
(Note: I use blocks of size bs=4096
but you could skip this argument and let dd
use smaller blocks)
Flash the kernel :
blkid /dev/mmcblk0p22
Double check that this partition 22 is PARTLABEL="boot
otherwise, you might brick your phone.
dd bs=4096 if=hybris-boot.img of=/dev/mmcblk0p22
Flash the Sony blob:
blkid /dev/mmcblk28
Double check that this partition 28 is PARTLABEL="oem"
and LABEL="odm"
(usually TYPE="ext4"
)
dd bs=4096 if=SW_binaries_for_Xperia_AOSP_M_MR1_3.10_v13_loire.img of=/dev/mmcblk28
Flash your backup :
blkid /dev/mmcblk51
Normally this partition 51 is PARTLABEL="userdata"
(usually TYPE="ext4"
on Android, and TYPE="LVM2_member"
on Sailfish X)
gzip -d -c backup.img.gz | dd bs=4096 of=/dev/mmcblk0p51
At this point your Xperia should be bootable. For the remaining parts :
Flash the recovery :
blkid /dev/mmcblk0p42
Double check that the partition 42 is PARTLABEL="FOTAKernel"
dd bs=4096 if=hybris-recovery.img of=/dev/mmcblk0p42
Flash the factory reset back up partition :
blkid /dev/mmcblk0p52
Normally this partition 51 is PARTLABEL="system"
(it usually is TYPE="ext4"
, Sailfish calls it LABEL="fimage"
)
dd bs=4096 if=fimage.img001 of=/dev/mmcblk0p52
At this point your Xperia is exactly as before your Android tests.
Now you can safely reboot, your Xperia X should work just like before the switch to Android.
The reason :
The howto you link is a procedure to restore the LVM partition on a Sailfish X-running Xperia.
Your Xperia was running Android.
I'm writing a more detailed answer.
DrYak ( 2018-09-03 18:40:45 +0200 )edit