The Mer Wiki now uses your Mer user account and password (create account on https://bugs.merproject.org/)


Sailfish/Backup Device

From Mer Wiki
< Sailfish(Difference between revisions)
Jump to: navigation, search
m (Compile own kernel iamge)
m (add links to https://github.com/djselbeck/jollarecovery)
 
(12 intermediate revisions by 4 users not shown)
Line 3: Line 3:
 
'''Prerequisites:'''
 
'''Prerequisites:'''
  
* fastboot (x64 Linux version in git of jollarecovery)
+
* fastboot
* mkbootimg (x64 Linux version in git of jollarecovery)
+
** Linux: 64-bit version in [https://github.com/djselbeck/jollarecovery git of jollarecovery]
* arm crosscompile chain ( if you want to compile your own kernel )
+
** Mac OS X: [http://forum.xda-developers.com/showthread.php?t=1917237 instructions]
* telnet client
+
* mkbootimg (x64 Linux version in git of jollarecovery)
* patience
+
** Linux: 64-bit version in [https://github.com/djselbeck/jollarecovery git of jollarecovery]
* microsd card with minimum of 16GB capacity (formatted with fs capable of storing files with 15GB size (ext4,btrfs should be working))
+
* 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 =  
 
= Using prebuilt image =  
* download image from here: https://github.com/djselbeck/jollarecovery/raw/master/boot-telnet-initrd.img
 
* boot image with: fastboot -i 0x2931 boot boot-telnet-initrd.img
 
* Check if LED turns blue, if yes wait for it to turn red after some time
 
* if LED is red your network is up and running with ip 192.168.42.17 and probably running an dhcp server
 
* telnet to 192.168.42.17
 
* Mount your sd card with: mkdir /sd; mount /dev/mmcblk1p1 /sd
 
* backup all you internal eMMC partitons with:
 
** cd /dev
 
** for i in mmcblk0* ; do echo $i; dd if=$i of=/sd/$i; done; sync
 
 
** wait a long time
 
  
= Compile own kernel image =  
+
* Download the [https://github.com/djselbeck/jollarecovery/raw/master/boot-telnet-initrd.img 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''')
 +
  $ fastboot -i 0x2931 boot boot-telnet-initrd.img
 +
* 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 "<code>sudo ifconfig usb0 192.168.42.18 netmask 255.255.255.0 up</code>")
 +
* Connect to Jolla using telnet
 +
  $ telnet 192.168.42.17
 +
* Mount your SD card
 +
  $ mkdir /sd
 +
  $ mount /dev/mmcblk1p1 /sd
 +
* Backup all your internal eMMC partitons with:
 +
  $ cd /dev
 +
  $ for i in mmcblk0p* ; do echo $i; dd if=$i of=/sd/$i; done; sync
 +
* Wait a long time until the command finishes
 +
* Unmount the SD card
 +
  $ umount /sd
 +
* Reboot normally
  
== Create initrd tree ==
+
= Build your own recovery image =  
  
* Download source tree at: https://github.com/djselbeck/jollarecovery for example to /home/user/jollarecovery
+
== Building the kernel ==
  
 +
# Download sources at: https://github.com/KonstaT/sailfishos_kernel_jolla_msm8930/
 +
# <code>export ARCH=arm</code>
 +
# <code>export CROSS_COMPILE=armv7hl-hardfloat-linux-gnueabi-</code> (replace with your arm crosscompiler)
 +
# Make default config: <code>make sbj_defconfig</code>
 +
# Change config with <code>make menuconfig</code> (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.
 +
# <code>make -j4 zImage</code>
  
== Build Kernel image ==  
+
== Building a initramfs ==
* Download sources at: https://github.com/KonstaT/sailfishos_kernel_jolla_msm8930/
+
 
* export ARCH=arm
+
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:
* export CROSS_COMPILE=armv7hl-hardfloat-linux-gnueabi- (replace with your arm crosscompiler)
+
 
* Make default config: <code>make sbj_defconfig</code>
+
# In the directory where the initramfs directory is stored, <code>find . | cpio -H newc -o | gzip > ../ramfs.cpio.gz</code>
* Change config with make menuconfig (see for e.x. https://github.com/djselbeck/jollarecovery/blob/master/kernelconfig)
+
 
* Set CONFIG_CMDLINE: root=/dev/ram0 rw init=/init androidboot.hardware=qcom user_debug=31 ehci-hcd.park=3 maxcpus=2
+
== Packing everything into a boot.img ==
* Set CONFIG_CMDLINE_FORCE
+
 
* Set General Setup->Initramfs source file(s) to your path of initrd-root tree, example (/home/user/jollarecovery/root)
+
<code><nowiki>mkbootimg --cmdline 'root=/dev/ram0 rw init=/init androidboot.hardware=qcom user_debug=31 ehci-hcd.park=3 maxcpus=2' --base 0x00000000 --pagesize 2048 --kernel_offset 0x80208000 --ramdisk_offset 0x82200000 --second_offset 0x81100000 --tags_offset 0x80200100 --board '' --ramdisk ramfs.cpio.gz --kernel kernelsourcetreepath/arch/arm/boot/zImage --output boot.img</nowiki></code>
* make -j8 zImage
+
* create bootable image:
+
** mkbootimg --cmdline '' --base 0x00000000 --pagesize 2048 --kernel_offset 0x80208000 --ramdisk_offset 0x82200000 --second_offset 0x81100000 --tags_offset 0x80200100 --board '' --ramdisk boot.img-ramdisk --kernel kernelsourcetreepath/arch/arm/boot/zImage --output "boot-telnet-initrd.img"
+

Latest revision as of 22:09, 15 January 2014

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
  • mkbootimg (x64 Linux 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)

Contents

[edit] Using prebuilt image

  • 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)
 $ fastboot -i 0x2931 boot boot-telnet-initrd.img
  • 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 "sudo ifconfig usb0 192.168.42.18 netmask 255.255.255.0 up")
  • Connect to Jolla using telnet
 $ telnet 192.168.42.17
  • Mount your SD card
 $ mkdir /sd
 $ mount /dev/mmcblk1p1 /sd
  • Backup all your internal eMMC partitons with:
 $ cd /dev
 $ for i in mmcblk0p* ; do echo $i; dd if=$i of=/sd/$i; done; sync
  • Wait a long time until the command finishes
  • Unmount the SD card
 $ umount /sd
  • Reboot normally

[edit] Build your own recovery image

[edit] Building the kernel

  1. Download sources at: https://github.com/KonstaT/sailfishos_kernel_jolla_msm8930/
  2. export ARCH=arm
  3. export CROSS_COMPILE=armv7hl-hardfloat-linux-gnueabi- (replace with your arm crosscompiler)
  4. Make default config: make sbj_defconfig
  5. Change config with make menuconfig (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.
  6. make -j4 zImage

[edit] 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, find . | cpio -H newc -o | gzip > ../ramfs.cpio.gz

[edit] Packing everything into a boot.img

mkbootimg --cmdline 'root=/dev/ram0 rw init=/init androidboot.hardware=qcom user_debug=31 ehci-hcd.park=3 maxcpus=2' --base 0x00000000 --pagesize 2048 --kernel_offset 0x80208000 --ramdisk_offset 0x82200000 --second_offset 0x81100000 --tags_offset 0x80200100 --board '' --ramdisk ramfs.cpio.gz --kernel kernelsourcetreepath/arch/arm/boot/zImage --output boot.img

Personal tools