Warning
|
This guide is meant to be used with the Pro1 (QX1000 model, SOC SD835 or also called msm8998). If you have a Pro1x (QX1050 model, SOC SD662), head over here. |
Inspired from this guide and proofread by @kabouik, @pcfe and @enigma9o7.
sudo eopkg it android-tools
eopkg
is Solus' package manager and android-tools
is the package with which fastboot
is shipped in this distribution. Adapt the above depending on your distribution’s package manager and the name of the package containing fastboot
. Alternatively, you may also install it using snap with sudo snap install android-studio --classic
, in which case you should be able to execute it from ~/Android/Sdk/platform-tools
.
Pro¹ units shipped by F(x)tec after 2019/11/19 have their bootloader locked. You need to unlock it to use this guide.
Warning
|
Unlocking bootloader will factory reset your device! Backup anything you need first. |
-
Go to "Settings > About phone" and tap the build number at the bottom 7 times to enable Developer Mode. Then, go to "Settings > System > Advanced > Developer options" and enable "OEM unlocking" and "USB debugging".
-
Reboot the phone into bootloader mode by holding
Volume Down + Power
. -
Connect it to a computer with USB and unlock the bootloader from command prompt:
fastboot devices # The device should be listed fastboot flashing unlock fastboot reboot
Note
|
The following instructions are adjusted for use in the Solus distribution and my own backup folder structure, slight path changes may be required on other machines and distributions. |
-
Download the latest SFOS CI image (download button on the right; prefer a "run-build-testing" version, the "run-build" is a devel version and may break things or kill kittens), extract
artifacts.zip
to save the other .zip file it contains to a vfat, ext3 or ext4 formatted micro SD card (other filesystems might work too, but those are confirmed to work). It was reported that copying the .zip file over to internal storage via USB/MTP while in TWRP works too after step 7 below. -
Insert the micro SD card in the Pro¹ unless you intend to transfer the SFOS archive to internal storage instead (see step 7), reboot in bootloader mode (
Volume Down + Power
) and connect through USB to the computer. Note that whether you use internal storage or SD card to flash the SFOS archive will have no influence on where the final OS will be installed, it will always be installed on internal storage in the end. -
Check that the device is properly connected:
fastboot devices # The device should be listed
-
Download the TWRP boot image for Pro¹ and save it to the computer (
/media/stockage/Fxtec\ Pro1/TWRP\ flash\ SFOS,\ backup\ and\ restore/twrp-3.3.1-qx1000.img
in my case). -
Flash the TWRP boot image:
fastboot set_active a fastboot flash boot /media/stockage/Fxtec\ Pro1/TWRP\ flash\ SFOS,\ backup\ and\ restore/twrp-3.3.1-qx1000.img
NoteAdjust the path on the computer side to your preferences. -
When completed, reboot the phone in recovery mode using
Volume
buttons to select "Recovery" and confirm with thePower
button. -
In the TWRP interface, go to "Wipe > Format data", and confirm. If format fails, follow these instructions to change the filesystem to ext2 and then back to ext4 (it is silly, but it does work). If you have no SD card, at this stage you should now be able to use USB/MTP while in TWRP to copy the .zip file to internal storage.
-
When format is completed, go to "Reboot > Reboot in Recovery". Wait for reboot, then "Install zip firmware", navigate to the micro SD card or internal storage where the SFOS archive is, and select it. Make sure the signature verification is set to off. When the installation is completed, reboot and the phone should boot into SFOS.
It is not possible to go into recovery mode with the SFOS boot image because it overwrites the TWRP image. It is therefore necessary to reflash TWRP.
-
Make a backup of the SFOS boot image when the phone is running SFOS and connected to the same WiFi as the computer (Developer mode and password set from "Settings > Developer mode"); and check that it indeed created the file in the target directory on the computer:
devel-su cp /boot/hybris-boot.img /home/nemo/hybris-boot.img scp nemo@ip:/home/nemo/hybris-boot.img /media/stockage/Fxtec\ Pro1/TWRP\ flash\ SFOS,\ backup\ and\ restore/
NoteAdjust the path on the computer side to your preferences. -
Make sure a micro SD with enough space for a full backup is inserted in the Pro¹, reboot the phone in bootloader mode (
Volume Down + Power
) and connect through USB to the computer. -
Check device connection with computer:
fastboot devices # The device should be listed
-
Flash TWRP boot image (this will prevent SFOS from booting, but you should have a backup of the SFOS boot image already):
fastboot set_active a fastboot flash boot /media/stockage/Fxtec\ Pro1/TWRP\ flash\ SFOS,\ backup\ and\ restore/twrp-3.3.1-qx1000.img
-
When completed, reboot the phone in recovery mode using
Volume
buttons to select "Recovery" and confirm with thePower
button. -
Go to "Backup", check "Data" and save to the micro SD card after making sure there is enough space available.
-
When backup is completed, reboot in Bootloader mode by going back to the TWRP main menu, then "Reboot", and choose "Bootloader". You can then flash the SFOS boot image again to allow booting SFOS (alternatively, go the the Factory reset instructions if you want to restore stock Android to the phone):
fastboot set_active a fastboot flash boot /media/stockage/Fxtec\ Pro1/TWRP\ flash\ SFOS,\ backup\ and\ restore/hybris-boot.img
NoteAdjust the path on the computer side to your preferences.
It is not possible to go into recovery mode with the SFOS boot image because it overwrote the TWRP image. It is therefore necessary to reflash TWRP.
-
If not already done, make a backup of the SFOS boot image when the phone is running SFOS and connected to the same WiFi as the computer (Developer mode and password set from "Settings > Developer mode"); and check that it indeed created the file in the target directory on the computer:
devel-su cp /boot/hybris-boot.img /home/nemo/hybris-boot.img scp nemo@ip:/home/nemo/hybris-boot.img /media/stockage/Fxtec\ Pro1/TWRP\ flash\ SFOS,\ backup\ and\ restore/
NoteAdjust the path on the computer side to your preferences. -
Insert the micro SD that contains a previous TWRP backup in the Pro¹, reboot the phone in bootloader mode (
Volume Down + Power
) and connect through USB to the computer. -
Check that the device is properly connected:
fastboot devices # The device should be listed
-
Flash TWRP boot image (this will prevent SFOS from booting, but you should have a backup of the SFOS boot image already):
fastboot set_active a fastboot flash boot /media/stockage/Fxtec\ Pro1/TWRP\ flash\ SFOS,\ backup\ and\ restore/twrp-3.3.1-qx1000.img
NoteAdjust the path on the computer side to your preferences. -
When completed, reboot the phone in recovery mode using
Volume
buttons to select "Recovery" and confirm with thePower
button. -
In the TWRP interface, go to "Wipe > Format data", and confirm. If format fails, follow these instructions to change the filesystem to ext2 and then back to ext4 (it is silly, but it does work).
-
Go to "Restore", select the micro SD card, and start restoring from it (checking digests might not be necessary).
-
When the restoration is completed, reboot in Bootloader mode by going back to the TWRP main menu, then "Reboot", and choose "Bootloader". You can then flash the SFOS boot image again to allow booting SFOS:
fastboot flash boot /media/stockage/Fxtec\ Pro1/TWRP\ flash\ SFOS,\ backup\ and\ restore/hybris-boot.img
NoteAdjust the path on the computer side to your preferences. NoteThe first boot will be long, and the the SIM card won’t be detected before a second reboot. Don’t panic.
Browse your backup from a computer, to selectively restore individual files or folders on a working SFOS device
TWRP generates a bunch of .win000
to .winxxx
files, which under the hood are tar
files. If what you want is to browse the backup and selectively restore some files or folders, then instead of doing a full restoration from TWRP itself, you could extract those tar
files.
-
Copy the TWRP backfup folder from the micro SD card to some folder on your computer. You can do that with
scp
orrsync
andssh
as shown above, or from a micro SD card reader. -
Run the following commands to extract the split archive:
mkdir -p /path/to/twrp/backup/sha2 mv /path/to/twrp/backup/*.sha2 sha2 cd /path/to/where/you/want/to/extract/the/files for i in /path/to/twrp/backup/*.win*`; do tar xvf $i; done
Then all the interesting stuff will be in data/.stowaways/sailfishos
.
-
Reboot in bootloader mode (
Volume Down + Power
) and connect through USB to the computer. -
Check that the device is properly connected:
fastboot devices # The device should be listed
-
Download the restoration files and extract them into the current folder.
-
Flash the device with the files:
fastboot flash devcfg_a devcfg.mbn fastboot flash devcfg_b devcfg.mbn fastboot flash dsp_a adspso.bin fastboot flash dsp_b adspso.bin fastboot flash bluetooth_a BTFM.bin fastboot flash bluetooth_b BTFM.bin fastboot flash modem_a NON-HLOS.bin fastboot flash modem_b NON-HLOS.bin fastboot flash pmic_a pmic.elf fastboot flash pmic_b pmic.elf fastboot flash rpm_a rpm.mbn fastboot flash rpm_b rpm.mbn fastboot flash splash splash.img fastboot flash tz_a tz.mbn fastboot flash tz_b tz.mbn fastboot flash xbl_a xbl.elf fastboot flash xbl_b xbl.elf fastboot flash abl_a abl.elf fastboot flash abl_b abl.elf fastboot flash boot_a boot.img fastboot flash boot_b boot.img fastboot flash dtbo_a dtbo.img fastboot flash dtbo_b dtbo.img fastboot flash system_a system.img fastboot flash system_b system.img fastboot flash vendor_a vendor.img fastboot flash vendor_b vendor.img fastboot flash mdtp_a mdtp.img fastboot flash mdtp_b mdtp.img fastboot flash vbmeta_a vbmeta.img fastboot flash vbmeta_b vbmeta.img
fastboot erase userdata
-
Reboot the device:
fastboot reboot
Thanks a lot for the comments. It should be clearer now, but else let me know here please.