Sailfish/Backup Device

'''DISCLAIMER: Be careful with all your actions. The author of this page will not take any responsibility for you if you brick your device. YOU ARE DOING ALL THE FOLLOWING STEPS ON YOUR OWN. Please make sure your device is fully charged'''

Prerequisites:


 * fastboot
 * Linux: 64-bit version in git of jollarecovery
 * Mac OS X: instructions
 * mkbootimg (x64 Linux version in git of jollarecovery)
 * Linux: 64-bit version in git of jollarecovery
 * Cross-compile toolchain for armv7hl-hardfloat-linux-gnueabi, if you want to compile your own kernel
 * telnet client
 * Patience
 * MicroSD card with a minimum capacity of 16GB (formatted with a filesystem capable of storing files with 15GB size, e.g. ext4 or btrfs, not FAT32)

= Using prebuilt image =

$ fastboot -i 0x2931 boot boot-telnet-initrd.img $ telnet 192.168.42.17 $ mkdir /sd $ mount /dev/mmcblk1p1 /sd $ cd /dev $ for i in mmcblk0p* ; do echo $i; dd if=$i of=/sd/$i; done; sync $ umount /sd
 * Download the boot image
 * Start fastboot on your computer (may need to be run as root) (This is not possible with bootloader after update to 1.0.25)
 * While holding the volume down key pressed, connect the USB cable
 * Jolla logo should appear, message "fastboot mode" on the very first line of the display
 * Check if LED turns blue and wait for it to turn red after some time
 * As soon as the LED is red, your network is up and running with the IP 192.168.42.17 and should be running a DHCP server
 * Configure the USB networking on your computer accordingly (if DHCP fails, try " ")
 * Connect to Jolla using telnet
 * Mount your SD card
 * Backup all your internal eMMC partitons with:
 * Wait a long time until the command finishes
 * Unmount the SD card
 * Reboot normally

= Build your own recovery image =

Building the kernel

 * 1) Download sources at: https://github.com/KonstaT/sailfishos_kernel_jolla_msm8930/
 * 2)   (replace with your arm crosscompiler)
 * 3) Make default config:
 * 4) Change config with   (see for example https://github.com/djselbeck/jollarecovery/blob/master/kernelconfig). Setting a builtin CONFIG_CMDLINE here is optional as you can set one using mkbootimg.
 * 1) Change config with   (see for example https://github.com/djselbeck/jollarecovery/blob/master/kernelconfig). Setting a builtin CONFIG_CMDLINE here is optional as you can set one using mkbootimg.

Building a initramfs
This is a standard Linux concept and there's plenty of documentation around the web and this wiki. You may also use the initramfs in https://github.com/djselbeck/jollarecovery. To create a very simple initramfs, either use a crosscompiler (scratchbox2, crossdev), or just copy the binaries (and libraries!) from the Jolla device. Once you've done that:


 * 1) In the directory where the initramfs directory is stored,